godiard | 10 Feb 15:38
Favicon

[PATCH Record] Use named parameters in gettext strings

From: Gonzalo Odiard <godiard <at> gmail.com>

When there are more than one parameter with the same type
gettext need named parameters to enable the translators to change
the order if needed.
Pootle server complain about this format strings in Record activity,
and you can see the same error doing "./setup.py genpot"

Signed-off-by: Gonzalo Odiard <gonzalo <at> laptop.org>
---
 glive.py |    3 ++-
 model.py |    6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/glive.py b/glive.py
index fd9a5af..413dc60 100644
--- a/glive.py
+++ b/glive.py
@@ -393,7 +393,8 @@ class Glive:
         stringType = constants.MEDIA_INFO[type]['istr']

         # Translators: photo by photographer, e.g. "Photo by Mary"
-        tl[gst.TAG_TITLE] = _('%s by %s') % (stringType, self.model.get_nickname())
+        tl[gst.TAG_TITLE] = _('%(type)s by %(name)s') % {'type': cstringType,
+                'name': self.model.get_nickname()}
         return tl

     def blockedCb(self, x, y, z):
diff --git a/model.py b/model.py
index 884325b..d47671c 100644
(Continue reading)

godiard | 10 Feb 14:49
Favicon

[PATCH StopWatch] Add mime type when save in the journal

From: Agustin Zubiaga <aguz <at> sugarlabs.org>

This enable to other activities to identify the data

Signed-off-by: Agustin Zubiaga <aguz <at> sugarlabs.org>
Reviewed-by: Gonzalo Odiard <gonzalo <at> laptop.org>
---
 activity.py            |    1 +
 activity/activity.info |    1 +
 activity/mimetypes.xml |    7 +++++++
 3 files changed, 9 insertions(+), 0 deletions(-)
 create mode 100644 activity/mimetypes.xml

diff --git a/activity.py b/activity.py
index 88313e2..306b081 100644
--- a/activity.py
+++ b/activity.py
@@ -166,6 +166,7 @@ class StopWatchActivity(Activity):
         self.gui.set_all(q)

     def write_file(self, file_path):
+        self.metadata['mime_type'] = 'application/x-stopwatch-activity'
         q = self.gui.get_all()
         f = open(file_path, 'w')
         cPickle.dump(q, f)
diff --git a/activity/activity.info b/activity/activity.info
index c8fd3da..5ccabfa 100644
--- a/activity/activity.info
+++ b/activity/activity.info
@@ -6,3 +6,4 @@ icon = activity-stopwatch
(Continue reading)

Kalpa Welivitigoda | 10 Feb 06:39
Picon
Gravatar

error in ./sugar-jhbuild update

Hi,

I was trying to build sugar base system as instruction at here [1] and
I got this error message,

./sugar-jhbuild update
Cloning upstream jhbuild
Cloning into jhbuild...
remote: Counting objects: 30895, done.
remote: Compressing objects: 100% (8597/8597), done.
remote: Total 30895 (delta 23961), reused 28682 (delta 22191)
Receiving objects: 100% (30895/30895), 6.00 MiB | 118 KiB/s, done.
Resolving deltas: 100% (23961/23961), done.
Warning: unknown distro version, automatic fallback to rawhide.
Traceback (most recent call last):
  File "./sugar-jhbuild", line 62, in <module>
    sys.exit(main.main(base_dir, sys.argv[1:]))
  File "/home/kalpa/sugar-devel/sugar-jhbuild/sjhbuild/main.py", line
111, in main
    rc = jhbuild.commands.run(command, config, args, help=lambda:
jhbuild.main.print_help(parser))
  File "/home/kalpa/.local/lib/python2.7/site-packages/jhbuild/commands/__init__.py",
line 123, in run
    return cmd.execute(config, args, help)
  File "/home/kalpa/.local/lib/python2.7/site-packages/jhbuild/commands/__init__.py",
line 52, in execute
    return self.run(config, options, args, help)
  File "/home/kalpa/.local/lib/python2.7/site-packages/jhbuild/commands/base.py",
line 63, in run
    module_set = jhbuild.moduleset.load(config)
(Continue reading)

Ajay Garg | 10 Feb 06:33
Favicon
Gravatar

Treeview-Treemodel coupling, and persistence (in journal)

Hi all.

I have been trying to integrate the batch-operations (copy, erase) ([1]).
There is already a working patch landed at [2]

However, there is a major performance bottleneck; for every toggling
of the checkbox by the user, the metadata (corresponding to the
checkbox listview) is wriiten on-disk, and a refresh done.
As the number of entries become large, the performance degrades exponentially.

Codewise, the bottleneck is in the section at [2] (I am pasting a fair
section of code, for easy location)

"""
 # Copyright (C) 2009, Tomeu Vizoso
+# Copyright (C) 2012, Walter Bender  <walter <at> sugarlabs.org>
+# Copyright (C) 2012, Gonzalo Odiard <gonzalo <at> laptop.org>
+# Copyright (C) 2012, Martin Abente  <tch <at> sugarlabs.org>
+# Copyright (C) 2012, Ajay Garg      <ajay <at> activitycentral.com>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -98,6 +102,8 @@  class BaseListView(gtk.Bin):
         self._title_column = None
         self.sort_column = None
         self._add_columns()
+        self._inhibit_refresh = False
+        self._selected_entries = 0

         self.tree_view.enable_model_drag_source(gtk.gdk.BUTTON1_MASK,
(Continue reading)

Thomas C Gilliard | 10 Feb 03:17
Favicon
Gravatar

Activity Errors in Fedora-17-Alpha-TC2-i686-Live-SoaS please fix.

http://wiki.sugarlabs.org/go/Community/Distributions/Fedora-SoaS#Fedora-17-Alpha-TC2-i686-Live-SoaS 
godiard | 9 Feb 21:08
Favicon

[PATCH sugar-toolkit-gtk3] Do the preview in the activity using cairo intead of GdkPixbuf

From: Gonzalo Odiard <godiard <at> gmail.com>

Signed-off-by: Gonzalo Odiard <gonzalo <at> laptop.org>
---
 src/sugar3/activity/activity.py |   33 ++++++++++++++++++---------------
 1 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/src/sugar3/activity/activity.py b/src/sugar3/activity/activity.py
index 19c1974..e943d44 100644
--- a/src/sugar3/activity/activity.py
+++ b/src/sugar3/activity/activity.py
@@ -54,11 +54,12 @@ import os
 import time
 from hashlib import sha1
 from functools import partial
+import StringIO

 from gi.repository import GConf
 from gi.repository import Gtk
 from gi.repository import Gdk
-from gi.repository import GdkPixbuf
+import cairo
 from gi.repository import GObject
 import dbus
 import dbus.service
@@ -642,26 +643,28 @@ class Activity(Window, Gtk.Container):
         binary content of a png image with a width of 300 and a height of 225
         pixels.
         """
-        if self.canvas is None or not hasattr(self.canvas, 'get_snapshot'):
(Continue reading)

Walter Bender | 9 Feb 19:30
Picon

re GSoC

Last year, we were not awarded any slots because:

"Our concern was primarily around your ideas page this year. While
other returning organizations had quite extensive and lengthy ideas,
yours was quite sparse. We would like to see on the order of 8-10
fleshed out ideas listed with potential mentors, use cases,
difficulty, and more information on your project and your community. I
hope you'll apply again next year. Have a great summer."

Let's please get some ideas written up [1]--I am sure there are many
out there--so that we can take advantage of the program this year.

-walter

--

-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org

[1] http://wiki.sugarlabs.org/go/Summer_of_Code/2012
Gonzalo Odiard | 9 Feb 15:19
Favicon

Easy Hacks in activities

I have received questions from volunteers about easy tasks to start hacking in Sugar.
Of course, start with activities is easier than core Sugar, then I reviewed the open ticket
in the activities and added a "easy-hack" tag to tickets I think can be solved by a newbie hacker.

The list is here: http://bugs.sugarlabs.org/query?status=accepted&status=assigned&status=new&status=reopened&group=component&order=priority&col=id&col=summary&col=status&col=owner&col=type&col=priority&col=milestone&keywords=~easy-hack

We used to have another similar tag "sugar-love", but I found the tickets no so easy to solve,
and the list not maintained. If anybody will maintain/use the sugar-love tag, we can keep it,
if not may be is a good idea remove the tag.

Gonzalo

_______________________________________________
Sugar-devel mailing list
Sugar-devel <at> lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel
Walter Bender | 9 Feb 00:15
Picon

Google Summer of Code

It is that time of year again. We need to start soliciting
participants in Google Summer of Code [1, 2]. We also need to organize
our application to the program as a mentoring organization. Please
contact me if you are interested in participating as a coder, a
mentor, or administrator.

regards.

-walter

--

-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org

[1] http://code.google.com/soc/
[2] http://www.google-melange.com/gsoc/homepage/google/gsoc2012
godiard | 8 Feb 21:48
Favicon

[PATCH Moon] Add date information to the information displayed - SL #2749

From: Gonzalo Odiard <godiard <at> gmail.com>

The patch set the locale to use calendar to get week days and mont days.

Signed-off-by: Flavio Danesse <fdanesse <at> gmail.com>
Reviewed-by: Gonzalo Odiard <gonzalo <at> laptop.org>
---
 moon.py |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/moon.py b/moon.py
index f9eca9d..bd4bd2b 100755
--- a/moon.py
+++ b/moon.py
@@ -36,7 +36,9 @@ from sugar.graphics.toggletoolbutton import ToggleToolButton
 from gettext import gettext as _
 import math
 import time
+import calendar
 import os
+import locale

 try:
     import json
@@ -67,6 +69,12 @@ class MoonActivity(activity.Activity):
         self._name = handle
         self.set_title(_("Moon"))

+        # Set the locale to format dates
+        lang = os.getenv('LANG')
+        if lang.find('.') > -1:
+            lang = lang[:lang.find('.')]
+        locale.setlocale(locale.LC_TIME, lang)
+
         # Defaults (Resume priority, persistent file secondary, fall-back hardcoded)
         if handle.object_id == None:
             print "Launched from home."
@@ -242,12 +250,21 @@ class MoonActivity(activity.Activity):
         gobject.source_remove(self.update_moon_image_timeout)
         self.update_moon_image_view()

+    def format_date(self, date_time):
+        year = date_time.tm_year
+        month = calendar.month_name[date_time.tm_mon - 1]
+        day = date_time.tm_mday
+        week_day = calendar.day_name[date_time.tm_wday - 1]
+        return "%(week_day)s, %(day)s %(month)s %(year)s" % \
+                {'week_day':week_day, 'day':day, 'month':month, 'year':year}
+
     def update_text_information_view(self):
         """Generate Moon data and update text based information view.
         """
         self.data_model.update_moon_calculations(time.time())
         information_string = ""
-        information_string += _("Today's Moon Information\n\n")
+        information_string += _("Today's Moon Information\n")
+        information_string += "%s\n\n" % self.format_date(time.localtime())
         information_string += _("Phase:\n%s\n\n") % (self.data_model.moon_phase_name(self.data_model.phase_of_moon))
         information_string += _("Julian Date:\n%.2f (astronomical)\n\n") % (self.data_model.julian_date)
         information_string += _("Age:\n%(days).0f days, %(hours).0f hours, %(minutes).0f minutes\n\n") %
{'days':self.data_model.days_old, 'hours':self.data_model.hours_old, 'minutes':self.data_model.minutes_old}
--

-- 
1.7.7.6
Favicon

[ASLO] Release WikipediaRW-33.3

Activity Homepage:
http://activities.sugarlabs.org/addon/4532

Sugar Platform:
0.86 - 0.96

Download Now:
http://activities.sugarlabs.org/downloads/file/27858/wikipediarw-33.3.xo

Release notes:

Sugar Labs Activities
http://activities.sugarlabs.org

Gmane