Re: [Sugar-devel] [ASLO] Release Turtle Blocks-115

2011-09-26 Thread Peter Robinson
Hi Walter,

On Mon, Sep 26, 2011 at 1:45 AM, Sugar Labs Activities
activit...@sugarlabs.org wrote:
 Activity Homepage:
 http://activities.sugarlabs.org/addon/4027

 Sugar Platform:
 0.82 - 0.94

 Download Now:
 http://activities.sugarlabs.org/downloads/file/27584/turtle_art-115.xo

 Release notes:
 115

 ENHANCEMENTS
 * Support for light sensor on XO 1.75 hardware
 * New translations

 BUG FIXES
 * Returning float values from sensors as per OLPC #11166

Getting a compile error when binary compiling it.

Compiling 
/builddir/build/BUILDROOT/sugar-turtleart-115-1.fc17.noarch/usr/share/sugar/activities/TurtleArt.activity/taextras.py
...
SyntaxError: ('invalid syntax',
('/usr/share/sugar/activities/TurtleArt.activity/taextras.py', 110, 5,
_('Error on the initialization of the camera.')\n))
error: Bad exit status from /var/tmp/rpm-tmp.FDluP8 (%install)
Bad exit status from /var/tmp/rpm-tmp.FDluP8 (%install)
RPM build errors:

Peter
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Update alpha according to filter after events in neighborhoodview icons - SL #3091

2011-09-26 Thread Sascha Silbe
Excerpts from godiard's message of 2011-09-22 21:11:42 +0200:

[src/jarabe/desktop/networkviews.py]
 @@ -149,6 +149,7 @@ class WirelessNetworkView(CanvasPulsingIcon):
  self._update_state()
  self._update_icon()
  self._update_badge()
 +self._update_color()
[...]

Thanks for the patch! However it looks more like a workaround than a
real fix.

Why do _all_ AP icons get updated when the state of at most two
connections changes? Why does the alpha value get reset when the icons
are updated?

Neither the patch description nor the ticket nor digging into the source
answer the above questions.

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


signature.asc
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [ASLO] Release Abacus-23

2011-09-26 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4293

Sugar Platform:
0.82 - 0.94

Download Now:
http://activities.sugarlabs.org/downloads/file/27585/abacus-23.xo

Release notes:
ENHANCEMENTS
* new translations
* icon update


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

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar-toolkit] bundlebuilder: add back build_locale functionality to XOPackager SL #3116

2011-09-26 Thread Sascha Silbe
Excerpts from Simon Schampijer's message of 2011-09-22 16:18:59 +0200:
 Due to the removal of the manifest support we lost as well
 the part of the code that does build the locale. This patch
 adds that functionality back.

Thanks for the patch!

Acked-By: Sascha Silbe si...@activitycentral.com

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


signature.asc
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH sugar-toolkit v2] Add TODOs reminding us to escape labels by default

2011-09-26 Thread Sascha Silbe
Changing API now to escape labels by default would be more trouble than it's
worth (all activities would need changing, distinguishing between pre and
post API change sugar-toolkit versions). The upcoming GTK-3 port, however,
is a nice opportunity for this kind of change.

Signed-off-by: Sascha Silbe si...@activitycentral.com
---
 src/sugar/graphics/palette.py |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/sugar/graphics/palette.py b/src/sugar/graphics/palette.py
index 46f167b..c68185f 100644
--- a/src/sugar/graphics/palette.py
+++ b/src/sugar/graphics/palette.py
@@ -231,6 +231,8 @@ class Palette(PaletteWindow):
 self._label.props.accel_widget = self.props.invoker.props.widget

 def set_primary_text(self, label, accel_path=None):
+# TODO: for the GTK-3 port we should escape the label by default and
+# add API for the rare case somebody actually wants to use markup.
 self._primary_text = label

 if label is not None:
@@ -245,6 +247,8 @@ class Palette(PaletteWindow):
 setter=set_primary_text)

 def set_secondary_text(self, label):
+# TODO: for the GTK-3 port we should escape the label by default and
+# add API for the rare case somebody actually wants to use markup.
 if label is not None:
 label = label.split('\n', 1)[0]
 self._secondary_text = label
--
1.7.6.3

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar-toolkit] Remove hippo from naming alert

2011-09-26 Thread Sascha Silbe
Excerpts from Daniel Drake's message of 2011-09-17 19:37:48 +0200:

 Reimplement the favorite icon as a ToggleButton, and use standard
 boxes, entrys and textviews for the other aspects.

Thanks for the patch! The sooner we can get rid of HippoCanvas the
better. :)

I haven't tried it out to verify the layout, but the code changes look
sane to me.

Reviewed-By: Sascha Silbe si...@activitycentral.com

[src/sugar/activity/namingalert.py]
[NamingAlert._create_text_view()]
 +#scrolled_window.set_border_width(30)

Leftover from testing?

[NamingAlert.__keep_cb()]
 +text_buffer = self._tags.get_buffer()
 +bounds = text_buffer.get_bounds()
 +new_tags = text_buffer.get_text(bounds[0], bounds[1])

How about start, end instead of bounds?

 +text_buffer = self._description.get_buffer()
 +bounds = text_buffer.get_bounds()
 +new_description = text_buffer.get_text(bounds[0], bounds[1])

Dto.

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


signature.asc
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar-toolkit] bundlebuilder: refactor get_files_git to Packager to avoid code duplication

2011-09-26 Thread Sascha Silbe
Excerpts from Simon Schampijer's message of 2011-09-19 19:12:39 +0200:

 Follow up patch for b582736375218e8944b3ce3daac667c7910a7e73

Thanks for the patch!

Acked-By: Sascha Silbe si...@activitycentral.com

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


signature.asc
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [ASLO] Release Pukllanapac-7

2011-09-26 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4320

Sugar Platform:
0.82 - 0.94

Download Now:
http://activities.sugarlabs.org/downloads/file/27586/pukllanapac-7.xo

Release notes:
BUG FIX:
* Fixed problems with license text to make it consistent with GPL v3


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

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Remove hippo from the intro screens

2011-09-26 Thread Sascha Silbe
Excerpts from Daniel Drake's message of 2011-09-17 13:30:38 +0200:
 Switch to standard GTK containers. Specific coloring details have been
 moved to the theme at the same time.
 
 Based on earlier work by Raul Gutierrez and Walter Bender.

Thanks for the patch! The code looks good; I haven't tried it out to
verify the layout.

[class ColorPicker]
 +def _button_press_cb(self, widget, event):
 +if event.button == 1 and event.type == gtk.gdk.BUTTON_PRESS:

Why do we need to check for BUTTON_PRESS here? We only subscribed to
button-press-event, so what other events could we received?

Reviewed-By: Sascha Silbe si...@activitycentral.com

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


signature.asc
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar-toolkit] Don't put event box in toplevel window

2011-09-26 Thread Sascha Silbe
Excerpts from Daniel Drake's message of 2011-09-17 13:47:59 +0200:

 Remove an unnecessary toplevel widget.
[...]

Thanks, keep those clean-up patches coming! ;)

Acked-By: Sascha Silbe si...@activitycentral.com

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


signature.asc
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Wireless key dialog: Translate more strings (OLPC#9268)

2011-09-26 Thread Sascha Silbe
Excerpts from Daniel Drake's message of 2011-09-14 22:35:43 +0200:
 On Wed, Sep 14, 2011 at 8:01 PM, Chris Leonard cjlhomeaddr...@gmail.com 
 wrote:
  tuples (and singleton tuples) are also discussed on the link above.
 
 Thanks, I don't think this is what Sascha was getting at though. As written:
   If format requires a single argument, values may be a single non-tuple 
 object.

Just to repeat it on the list: What the patch does is perfectly valid
Python code and will work just fine as long as it gets passed exactly
the argument types it's expecting. However if the argument changes to be
a tuple, Python will choke with the format % arg syntax, whereas it
will continue to work with format % (arg, ). I've hit this problem
quite a lot in my version support branch (because I changed object_id
from a string to a 2-tuple of strings), so I prefer making Sugar more
robust by default (i.e. as a matter of style). In addition it looks more
consistent to my eye to always use format % (tuple contents,...)
rather than using format % arg in some of the cases.

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


signature.asc
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [DESIGN] Toolbars review

2011-09-26 Thread Walter Bender
On Sun, Sep 25, 2011 at 11:20 PM, Gonzalo Odiard gonz...@laptop.org wrote:
 Hi Gary and team :)
 Here, in SugarCamp Junin, we did a review at the state of the toolbars.
 These are ideas to discuss, if you want in the meeting, or start over mail.
 We don't know if will be available tomorrow to participate in the Design
 Team meeting.
 Regards,

 Gonzalo  Manuel

 Toolbar Catalog: http://wiki.sugarlabs.org/go/Design_Team/Toolbar_Catalog


 Browse:
 * Can we move the Next/Previous buttons to the left of the url entry, like
 in other browsers,
 and may be move the home button to the rigth.

 Finance:
 * Replace the Period label and the combo, with a RadioMenuButton with
 calendar icon.
 * Add a Edit button and implement copy/paste.
 * Move the transactions buttons to the right of the view button.
 * Move the help bar to the bottom of the screen?

 Fototoon:
 * Check activity icon, looks smaller than the others.

 GetBooks:
 * Move the Journal source option in the combo to separated button in the
 toolbar?
 * Move the language combo to a configuration (spanner) subtoolbar?

 ImageViewer:
 * We should standarize rotate buttons in ImageViewer, Paint and FototToon.
 * Move fullscreen button at the rigth of Zoom buttons, add a separator and
 next the rotate buttons.

 Implode:
 * The buttons in the main toollbar should be left aligned (Manu has a
 patch).

 Infoslicer:
 * The icon used in Publish button, is the Keep button icon and should be
 replaced
 by a export icon.

Patch pushed to git


 Jukebox:
 * We can replace the sound icon, by a icon with a plus sign because is a add
 sound button.
 * We can add another button with to add video, opening the object chooser
 filtering video files.
 * The play button looks bigger than the other media operations buttons.
 * Can we improve the volume control? May be use the same icons than the
 frame and a more conventional palette?
 Try standarize the icon with other sound activities, like TamTamSuite.

 Labyrinth:
 * Replace the export icons with the icons with the journal badge (Manuel
 will improve the icons from Write)
 * There changesin the toolbar in git, without packaging.
 * Need a help button (for example is difficult discover the move of objects
 with the right button)
 * There are mode buttons in a subtoolbar? May be should be in the main
 toolbar.

 Log:
 * There are a separator before the copy button?
 * The wrap button is using a left align icon and is not the proper
 metaphore.
 * The gear button is not correct for the used subtoolbar. In fact, we can
 move the two buttons in
 the subtooolbar to the main toolbar.
 * The log colllector icon should not be the loupe. May be use a export icon.
 * Move the wrap button after the separator next to the search controls.

 Maze:
 * Move the activity name entry to the main toolbar.
 * Move the share button after the activity name entry like in the other
 activities.

 Measure:
 * Replace the lips icon, with the microphone like in Record.

Patch pushed to git


 Pippy:
 * How can the user save a modification?

 Read:
 * Use the Next/Previous icons like in Browse?
 * The index button can use a RadioMenuButton to show the options in the
 combo,
 and avoid use a subtoolbar only to this combo.
 * Move the favorite button to the last position.

 Record:
 * May be replace the combos with the icons by RadioMenuButtons?

 Speak:
 * Replace the last icon (robot) by the spanner.
 * Improve the mode icons?

 TamTamEdit
 * The Record button cen be removed, and move the Save to ogg button to the
 activity toolbar,
 changing the icon to a export sound icon.
 * What is the function of the save keyboard button.
 * The volumen/tempo button in the configuration subtoolbar can be moved to
 the main toolbar.
 * The palette in the spanner in the configuration subtoolbar, can be moved
 to the spanner
 in the main toolbar, then we can remove the subtoolbar and avoid duplicating
 the icon.

 TamTamJam:
 * The Mute loops icon is not very intuitive. Looks like mute speakers
 icon.
 * We should unify the design of the volume/tempo palettes with TamTamEdit:
   no strings, put icons on the left of the Adjustement widgets.
 * The collections should be left aligned.

 TamTamSynth:
 * The rounded clear icon to clear the desktop, should be the rectangular
 clear icon, like in Paint

 Terminal:
 * Use the same style in the tabs as Browse.




-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Remove hippo from the frame

2011-09-26 Thread Sascha Silbe
Excerpts from Daniel Drake's message of 2011-09-18 14:47:09 +0200:

 Based on earlier work by Raul Gutierrez and Walter Bender.
[...]

Thanks for the patch!

[src/jarabe/frame/framewindow.py]
[class FrameContainer]
 +def do_realize(self):
 +self.set_flags(gtk.REALIZED)
 +
 +self.window = gdk.Window(
 +self.get_parent_window(),
[...]

Why do we need additional windows? AIUI we already have one
SugarFrameWindow for each edge (which is probably what
self.get_parent_window() returns). Shouldn't adding the container (or
maybe HBoxes and VBoxes if gtk.Container is too generic) to
SugarFrameWindow suffice?

Feel free to point me to GTK documentation if it's already explained
somewhere - I couldn't figure it out myself.

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


signature.asc
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [ASLO] Release Speak-32

2011-09-26 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4038

Sugar Platform:
0.82 - 0.94

Download Now:
http://activities.sugarlabs.org/downloads/file/27587/speak-32.xo

Release notes:
 * Set-english-rp-as-default-for-en_AU (Sebastian Silva)
 * Avoiding gettext warning (based on cjl suggestion)
 * New translations



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

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [DESIGN] Toolbars review

2011-09-26 Thread Walter Bender
On Sun, Sep 25, 2011 at 11:20 PM, Gonzalo Odiard gonz...@laptop.org wrote:
 Hi Gary and team :)
 Here, in SugarCamp Junin, we did a review at the state of the toolbars.
 These are ideas to discuss, if you want in the meeting, or start over mail.
 We don't know if will be available tomorrow to participate in the Design
 Team meeting.
 Regards,

 Gonzalo  Manuel

 Toolbar Catalog: http://wiki.sugarlabs.org/go/Design_Team/Toolbar_Catalog


 Browse:
 * Can we move the Next/Previous buttons to the left of the url entry, like
 in other browsers,
 and may be move the home button to the rigth.

 Finance:
 * Replace the Period label and the combo, with a RadioMenuButton with
 calendar icon.
 * Add a Edit button and implement copy/paste.
 * Move the transactions buttons to the right of the view button.
 * Move the help bar to the bottom of the screen?

 Fototoon:
 * Check activity icon, looks smaller than the others.

 GetBooks:
 * Move the Journal source option in the combo to separated button in the
 toolbar?
 * Move the language combo to a configuration (spanner) subtoolbar?

 ImageViewer:
 * We should standarize rotate buttons in ImageViewer, Paint and FototToon.
 * Move fullscreen button at the rigth of Zoom buttons, add a separator and
 next the rotate buttons.

 Implode:
 * The buttons in the main toollbar should be left aligned (Manu has a
 patch).

 Infoslicer:
 * The icon used in Publish button, is the Keep button icon and should be
 replaced
 by a export icon.

 Jukebox:
 * We can replace the sound icon, by a icon with a plus sign because is a add
 sound button.
 * We can add another button with to add video, opening the object chooser
 filtering video files.
 * The play button looks bigger than the other media operations buttons.
 * Can we improve the volume control? May be use the same icons than the
 frame and a more conventional palette?
 Try standarize the icon with other sound activities, like TamTamSuite.

 Labyrinth:
 * Replace the export icons with the icons with the journal badge (Manuel
 will improve the icons from Write)
 * There changesin the toolbar in git, without packaging.
 * Need a help button (for example is difficult discover the move of objects
 with the right button)
 * There are mode buttons in a subtoolbar? May be should be in the main
 toolbar.

 Log:
 * There are a separator before the copy button?
 * The wrap button is using a left align icon and is not the proper
 metaphore.
 * The gear button is not correct for the used subtoolbar. In fact, we can
 move the two buttons in
 the subtooolbar to the main toolbar.
 * The log colllector icon should not be the loupe. May be use a export icon.
 * Move the wrap button after the separator next to the search controls.

 Maze:
 * Move the activity name entry to the main toolbar.
 * Move the share button after the activity name entry like in the other
 activities.

 Measure:
 * Replace the lips icon, with the microphone like in Record.

 Pippy:
 * How can the user save a modification?

 Read:
 * Use the Next/Previous icons like in Browse?
 * The index button can use a RadioMenuButton to show the options in the
 combo,
 and avoid use a subtoolbar only to this combo.
 * Move the favorite button to the last position.

 Record:
 * May be replace the combos with the icons by RadioMenuButtons?

 Speak:
 * Replace the last icon (robot) by the spanner.
 * Improve the mode icons?

 TamTamEdit
 * The Record button cen be removed, and move the Save to ogg button to the
 activity toolbar,
 changing the icon to a export sound icon.
 * What is the function of the save keyboard button.
 * The volumen/tempo button in the configuration subtoolbar can be moved to
 the main toolbar.
 * The palette in the spanner in the configuration subtoolbar, can be moved
 to the spanner
 in the main toolbar, then we can remove the subtoolbar and avoid duplicating
 the icon.

 TamTamJam:
 * The Mute loops icon is not very intuitive. Looks like mute speakers
 icon.
 * We should unify the design of the volume/tempo palettes with TamTamEdit:
   no strings, put icons on the left of the Adjustement widgets.
 * The collections should be left aligned.

 TamTamSynth:
 * The rounded clear icon to clear the desktop, should be the rectangular
 clear icon, like in Paint

Patch sent to maintainers.


 Terminal:
 * Use the same style in the tabs as Browse.




-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Playlist for Jukebox

2011-09-26 Thread Sascha Silbe
Excerpts from Manuel Quiñones's message of 2011-09-16 07:02:18 +0200:

[ControlToolbar.py]
  class Control(gobject.GObject):
  Class to create the Control (play) toolbar
 diff --git a/jukeboxactivity.py b/jukeboxactivity.py
 index 0ba3f4c..98acdd4 100644
 --- a/jukeboxactivity.py
 +++ b/jukeboxactivity.py
 @@ -24,6 +24,7 @@
  
  import logging
  from gettext import gettext as _

 +import cjson

You might want to consider using the Python 2.6 json module with
fallback to simplejson (which is the same thing for Python  2.6)
instead:

try:
import json
except ImportError:
import simplejson as json


cjson is buggy [1]; simplejson has been used by Sugar since 0.79.2, so
should be available on all systems.

 +def __size_allocate_cb(self, widget, allocation):
 +canvas_size = self.bin.get_allocation()
 +self.playlist_widget.set_size_request(canvas_size.width/3, 0)

This looks like a dirty hack, but I can't find a better way. Maybe one
of our GTK experts can point out a good solution?


 @@ -310,17 +325,57 @@ class JukeboxActivity(activity.Activity):
  jobject = chooser.get_selected_object()
  if jobject and jobject.file_path:
  self.jobjectlist.append(jobject)
 -self._start(jobject.file_path)
 +title = jobject.metadata.get('title', None)

None is the default for dict.get(), so ...get('title') should suffice.


 +def _get_data_from_file_path(self, file_path):
 +fd = open(file_path, 'r')
 +try:
 +data = fd.read()
 +finally:
 +fd.close()
 +return data

You can just do return fd.read(), finally will still work. And since
you're only reading a single file, letting the garbage collector close
the file should work well enough, so you can simplify this to:

def _get_data_from_file_path(self, file_path):
return open(file_path).read()

Since the code is now shorter than the name of the function, you could
even just use it inline. ;)

  def read_file(self, file_path):
 -self.uri = os.path.abspath(file_path)
 -if os.path.islink(self.uri):
 -self.uri = os.path.realpath(self.uri)
 -gobject.idle_add(self._start, self.uri)
 +def deserialize_playlist(data):
 +return cjson.decode(data)
 +
 +def get_uri_title(file_path):
 +Return the media URI and the title to show in the playlist.
 +uri = os.path.abspath(file_path)
 +title = os.path.basename(file_path)
 +if os.path.islink(uri):
 +uri = os.path.realpath(uri)
 +return uri, title
 +
 +if self.metadata['mime_type'] == 'text/plain':
 +logging.debug(reading playlist from file...)
 +data = self._get_data_from_file_path(file_path)
 +playlist = deserialize_playlist(data)

With json / simplejson you can deserialise directly from a file:

playlist = json.load(open(file_path))

 +for elem in playlist:
 +gobject.idle_add(self._start, elem['url'], elem['title'])
 +
 +else:
 +logging.debug(reading one media from file...)
 +self.uri, title = get_uri_title(file_path)
 +gobject.idle_add(self._start, self.uri, title)
 +
 +def write_file(self, file_path):
 +def serialize_playlist(playlist):
 +return cjson.encode(playlist)
 +
 +logging.debug(writing playlist to file...)
 +self.metadata['mime_type'] = 'text/plain'

 +playlist_str = serialize_playlist(self.playlist)
 +f = open(file_path, 'w')
 +try:
 +f.write(playlist_str)
 +finally:
 +f.close()

Similarly, you can serialise directly to the file. Since you are writing
(not reading) the explicit close() call is required, though:

f = open(file_path, 'w')
try:
json.dump(f, self.playlist)
finally:
f.close()

It could be argued that you only care about the data being available to
other processes (which is what close() ensures) if there was no error,
in which case you could get rid of the try/finally (but keep the
f.close() after json.dump()). The try/finally doesn't hurt, though.

[_start()]
  if uri.endswith(.m3u) or uri.endswith(.m3u8):
 -self.playlist.extend(self.getplaylist([line.strip() for line in 
 open(uri).readlines()]))
 +for line in open(uri).readlines():

A file object is an iterator that returns each line, so

for line in open(uri):

should suffice.

 +url = line.strip()
 +self.playlist.extend({'url': url, 'title': title})

Are you sure this does what you want it to do? Did you mean append
instead of extend?

  elif uri.endswith('.pls'):
  try:
  cf.readfp(open(uri))
  x = 1
  while True:
 - 

Re: [Sugar-devel] Translations: We need help from activity maintainers

2011-09-26 Thread Rafael Ortiz
On Sat, Sep 24, 2011 at 2:39 PM, Aleksey Lim alsr...@activitycentral.orgwrote:

 On Fri, Sep 23, 2011 at 07:24:48AM -0300, Gonzalo Odiard wrote:
  Hello maintainers,

 In fact, it should be more useful to file tickets on bugs.sl.o.
 Not all activity devs might track sugar-devel@ on regular basis and it
 is mostly hard to track bugs on ML.

  You know pootle server is creating the pot files again,
  now a few activities have errors and need your help to enable the
  translators to do his work properly.
 
  The activities involved are Record, Browse, Distance, Speak,
   hmouse, Kandid, jigsaw-puzzle, slider puzzle, mateton





 Will file tickets (for not CCed devs) and fix issues in activities
 I'm maintaining...


Update

Distance and speak, should be fixed now.

I've filled a bug against hmouse

 http://bugs.sugarlabs.org/ticket/3046



 --
 Aleksey
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [ASLO] Release Speak-32

2011-09-26 Thread Chris Leonard
On Mon, Sep 26, 2011 at 3:35 PM, Sugar Labs Activities
activit...@sugarlabs.org wrote:
 Activity Homepage:
 http://activities.sugarlabs.org/addon/4038

 Sugar Platform:
 0.82 - 0.94

 Download Now:
 http://activities.sugarlabs.org/downloads/file/27587/speak-32.xo

 Release notes:
  * Set-english-rp-as-default-for-en_AU (Sebastian Silva)
  * Avoiding gettext warning (based on cjl suggestion)


I looked at this commit

http://git.sugarlabs.org/speak/mainline/commit/b7c2e4d33cee6757ef1f9a960a9fca65f242f5c9

and I wonder if it really solves the problem from a L10n perspective.

Changing %s to %(speak)s may trick the cron job from thinking there is
a problem, but as long as both subject and object are represented by
the same variable name [ either %s or %(speak)s ], I don't see how it
will work well for localizers whose languages have different syntaxes.

Sorry, I can't %(speak)s, let's %(speak)s instead.

maybe it will work, but I'm a little skeptical.

cjl
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [Localization] 0.94 Branching

2011-09-26 Thread Chris Leonard
On Fri, Sep 23, 2011 at 6:03 AM, Simon Schampijer si...@schampijer.de wrote:
 Hi,

 we have been branching [1] off 'sucrose-0.94' with the Sucrose 0.93.5
 release [2].

 This is important to have the master branch available again for new
 development. The 'sucrose-0.94' will be used to host further stable
 development.

 The following branches have been created:

 - sugar (branched off at version 0.93.5)
 - sugar-toolkit (branched off at version 0.93.4)
 - sugar-artwork (branched off at version 0.93.4)
 - sugar-base (branched off at version 0.93.2)
 - sugar-datastore (branched off at version 0.93.2)

 Pootle has to be updated accordingly and branches for sucrose-0.94 have to
 be created.

 Regards,
   Simon

 [1] http://wiki.sugarlabs.org/go/Development_Team/Release#Branching
 [2] http://wiki.sugarlabs.org/go/0.94/Roadmap#Schedule



Thanks to alsroot, Glucose branching in Pootle (freezing a glucose94
version) has been completed,

Glucose
http://translate.sugarlabs.org/projects/glucose/

Glucose 0.94
http://translate.sugarlabs.org/projects/glucose94/

There has a change in the Pootle project for sugar-update-control.po

http://git.sugarlabs.org/sugar-update-control

It formerly lived in Glucose on Pootle, but after discussing it with
Daniel Drake this has been changed.  This is an OLPC-specific update
component, and Daniel wants it to avoid the glucose branching process
and so we've agreed to move it into the OLPC Software project which
already contains the Sugar-Gnome switching panel specific to OLPC
dual-boot builds.  We've moved any completed strings as well.

cjl
Sugar Labs Translation Team Coordinator
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] Fructose, to branch or not to branch

2011-09-26 Thread Chris Leonard
All,

At some point over the next few Sugar builds we will probably want to
freeze a last known good set of Fructose Activities as there is a
growing possibility that the ongoing changes (de-hippofication, gtk3,
PyGobject introspection) will cause problems with these important
activities.

The question is when is the right time to freeze a Fructose set
(0.94?, 0.96?, 0.98?, your thoughts and insights would be welcome so
that we can take the appropriate action coordinated between Fructose
activity maintainers and L10n infrastructure at the proper time.

cjl
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel