[Sugar-devel] [PATCH] VncLauncher can't find the needed libs on OLPC's 10.1.2 release
Hi, The deployment here in Nigeria is updating their laptops to the 10.1.2 release. In the process, we found out the VncLauncher (v6) is not working because the bundled binary (x11vnc) needs a few libs. Even though one of the libs is included, the code doesn't export the library path before running the binary. The attached patch exports the path that contains the needed (lib/{libvncserver.so,libvncclient.so}). If the activity currently lacks maintainer I can prepare a new release (if someone can give me the right access) that includes this patch and the needed library. This activity is kind of popular in this deployment. Cheers, Raul --- VncLauncher.activity/vnclauncher.py 2009-01-07 03:36:36.0 -0300 +++ VncLauncher.activity-modified/vnclauncher.py 2010-09-09 18:14:46.0 -0400 @@ -108,7 +108,14 @@ def connectVNC(self,button): self._vte.grab_focus() - cmd = "/home/olpc/Activities/VncLauncher.activity/x11vnc" +src_dir = os.path.dirname(__file__) +lib_dir = os.path.join(src_dir, "lib") +cmd = os.path.join(src_dir, "x11vnc") +ld_library_path = os.getenv("LD_LIBRARY_PATH") +if ld_library_path is None: +os.putenv("LD_LIBRARY_PATH", lib_dir) +else: +os.putenv("LD_LIBRARY_PATH", lib_dir + ":" + ld_library_path) self._vte.fork_command(cmd) def __key_press_cb(self, window, event): ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Shutdown and Logout menu items should activate the buzzy cursor (SL#2151)
On Wed, Sep 8, 2010 at 01:39, James Cameron wrote: > On Wed, Sep 08, 2010 at 08:10:27AM +0530, Anurag Chowdhury wrote: >> Shutdown (and Logout) menu items should activate the buzzy cursor (or >> provide some other visual feedback, perhaps dimming/locking the UI >> from use). > > You mean the busy cursor. > > I've tried the patch you proposed. It doesn't work. The GTK+ event > loop doesn't even get a chance to refresh the area under the menu > palette before the X server collapses. I tried adding a call to > gtk.gdk.flush() but there was no impact. The X server collapses within > about a second. Even in that time, there was no change to the cursor > that I could see. > > On what platform do you see a delay between releasing the mouse button > and the X server terminating, and what amount of delay occurs? There's some info from Gary in the original bug report: http://bugs.sugarlabs.org/ticket/2151 Regards, Tomeu >> def __logout_activate_cb(self, menu_item): >> + self.window.set_cursor( gtk.gdk.Cursor(gtk.gdk.WATCH) ) # newline > > The " # newline" is unnecessary. > > The "self.window" would refer only to the menu button on the palette, > which is dismissed by the operation. You should refer instead to the > top level window. Perhaps that is why it did nothing for me. > > Does it work for you? > > -- > James Cameron > http://quozl.linux.org.au/ > ___ > 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] [PATCH] VncLauncher can't find the needed libs on OLPC's 10.1.2 release
Can we help by adding back a package for 10.1.3? -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Shutdown and Logout menu items should activate the buzzy cursor (SL#2151)
On Fri, Sep 10, 2010 at 10:02:22AM +0200, Tomeu Vizoso wrote: > On Wed, Sep 8, 2010 at 01:39, James Cameron wrote: > > On Wed, Sep 08, 2010 at 08:10:27AM +0530, Anurag Chowdhury wrote: > >> Shutdown (and Logout) menu items should activate the buzzy cursor (or > >> provide some other visual feedback, perhaps dimming/locking the UI > >> from use). > > > > On what platform do you see a delay between releasing the mouse button > > and the X server terminating, and what amount of delay occurs? > > There's some info from Gary in the original bug report: > http://bugs.sugarlabs.org/ticket/2151 Ah, right. I see from the bug report that the problem only occurs with many activities open. That wasn't mentioned in the patch commit message. -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Shutdown and Logout menu items should activate the buzzy cursor (SL#2151)
On Fri, Sep 10, 2010 at 10:15, James Cameron wrote: > On Fri, Sep 10, 2010 at 10:02:22AM +0200, Tomeu Vizoso wrote: >> On Wed, Sep 8, 2010 at 01:39, James Cameron wrote: >> > On Wed, Sep 08, 2010 at 08:10:27AM +0530, Anurag Chowdhury wrote: >> >> Shutdown (and Logout) menu items should activate the buzzy cursor (or >> >> provide some other visual feedback, perhaps dimming/locking the UI >> >> from use). >> > >> > On what platform do you see a delay between releasing the mouse button >> > and the X server terminating, and what amount of delay occurs? >> >> There's some info from Gary in the original bug report: >> http://bugs.sugarlabs.org/ticket/2151 > > Ah, right. I see from the bug report that the problem only occurs with > many activities open. That wasn't mentioned in the patch commit > message. Yup, have spent some minutes on this and this approach indeed should work. It should be easily reproducible anywhere by inserting a "import time; time.sleep(10)" as the first line in an activity's write_file method. The shell will wait until all activities have saved their state before actually shutting down. As James said, the cursor needs to be set in the appropriate window, in this case it's the desktop window which is accessible by: from jarabe.desktop import homewindow homewindow.get_instance() Seems to work fine here. Regards, Tomeu > -- > James Cameron > http://quozl.linux.org.au/ > ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] VncLauncher can't find the needed libs on OLPC's 10.1.2 release
On Fri, Sep 10, 2010 at 10:11, James Cameron wrote: > Can we help by adding back a package for 10.1.3? Or maybe we should set the env var in sugar-activity? I guess this worked in 0.82 because Rainbow used to set it. Regards, Tomeu > -- > James Cameron > http://quozl.linux.org.au/ > ___ > 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] [PATCH] VncLauncher can't find the needed libs on OLPC's 10.1.2 release
Here is a working (temporary) release: http://people.sugarlabs.org/~rgs/activities/vnclauncher-7.xo Note: I think this problem only affects 10.1.2. Dextrose users shouldn't be affected because the libvncserver package is included on those builds. On Fri, 2010-09-10 at 04:00 -0400, Raul Gutierrez Segales wrote: > Hi, > > The deployment here in Nigeria is updating their laptops to the 10.1.2 > release. In the process, we found out the VncLauncher (v6) is not > working because the bundled binary (x11vnc) needs a few libs. Even > though one of the libs is included, the code doesn't export the library > path before running the binary. > > The attached patch exports the path that contains the needed > (lib/{libvncserver.so,libvncclient.so}). > > If the activity currently lacks maintainer I can prepare a new release > (if someone can give me the right access) that includes this patch and > the needed library. > > This activity is kind of popular in this deployment. > > Cheers, > Raul > ___ > 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] SL bug #1520
On Wed, Sep 8, 2010 at 11:15, Tomeu Vizoso wrote: > On Tue, Sep 7, 2010 at 20:01, Mukul Gupta wrote: >> Team, >> >> I am working on Bug # 1520 on sugarlabs. >> http://bugs.sugarlabs.org/ticket/1520 >> I tried to reproduce the issue on sugar-emulator. I realised that Alt + Tab >> did nothing. Instead, Alt+Tab functioned for GNOME. I tried to run sugar >> from sugar-session. Still, Alt+ Tab did nothing. >> Firstly, I would require some pointers on how to reproduce the bug. >> Secondly, when I read the comments on the bugs page, I realised that fran >> pointed out that this functioning of the Alt+Tab as mentioned in the bug can >> also be considered as a utility rather than a bug. >> A very similar bug to bug #1520 is #1518. >> http://bugs.sugarlabs.org/ticket/1518 >> >> As far as solving the current bug is concerned I realised that Bernie had >> created a patch for the same in fedora and that could be implemented on >> ubuntu. I have studied the patch - >> http://sascha.silbe.org/patches/metacity-ungrab-keybindings.patch > > Should this patch go upstream? Ping, the metacity maintainer has shown interest but wants to give it a good deal of testing before pushing and has requested a bug to be filed. I just want to know if this patch is considered a proper fix that can go upstream. Regards, Tomeu > Regards, > > Tomeu > >> Regards, >> >> Mukul Gupta >> Research Engineer, SEETA >> ___ >> 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
[Sugar-devel] internationalization question about generating .pot
I am trying to internationalize an activity. The instructions here http://bit.ly/acg4Hz and http://wiki.laptop.org/go/Python_i18n explain that I need to run setup.py to generate a .pot file. The first link suggests my setup.py should read: from sugar.activity import bundlebuilder bundlebuilder.start() I need some help with this step... do I need to run setup.py from within the jhbuild shell? Is there a way to do this without jhbuild? ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] internationalization question about generating .pot
On Fri, Sep 10, 2010 at 8:57 AM, Erik Blankinship wrote: > I am trying to internationalize an activity. > > The instructions here http://bit.ly/acg4Hz and > http://wiki.laptop.org/go/Python_i18n explain that I need to run setup.py > to generate a .pot file. > > The first link suggests my setup.py should read: > > from sugar.activity import bundlebuilder > bundlebuilder.start() > > > I need some help with this step... do I need to run setup.py from within > the jhbuild shell? Is there a way to do this without jhbuild? > Thanks to alsroot, tomeu and marcopg on irc, it was pointed out that since I had sugar installed with my distro I did not need a special shell. I just ran python setup.py genpot and was all set! ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Feedback about ticket #10122
Hi Ben: I am trying to resolve the ticket http://dev.laptop.org/ticket/10122 Can you review it? Could you test it in XO-1.5? There are changes I did based in my tests, but I need to know if you agree. Thanks Gonzalo ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Feedback about ticket #10122
On 09/10/2010 09:54 AM, Gonzalo Odiard wrote: > Hi Ben: > I am trying to resolve the ticket http://dev.laptop.org/ticket/10122 > Can you review it? Could you test it in XO-1.5? I've been following the discussion, but I haven't looked at the patch yet. I've had a rather busy week. I can't easily test changes because my XO-1.5 is broken, but maybe I can fix it this weekend. > There are changes I did based in my tests, but I need to know if you agree. I'm concerned about any making Distance change the volume settings. This might make sense for the microphone amplification setting, but I would prefer to leave the speaker volume under the user's control. The appropriate volume to use for Distance depends on how long a distance one is trying to measure, the level of background noise, whether other people might be disturbed, etc. The changes in delay constant could make sense. I'll need to look at the changes and see if we can find an explanation for the changes. --Ben signature.asc Description: OpenPGP digital signature ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] #2295 UNSP: Sugar 0.88 [Dextrose] not reporting all favourite connections to NetworkManager at startup
Effectively by debugging both Sugar and NM I found that ListConnections shows all of the favourite connections on connetions.cfg -Double checked within sugar and in NM- but then NM doesn't pass them to real_get_best_autoconnection. So It's NM's fault, and doesn't involve Sugar. I'll report this to NM list and open a ticket in their track. Thanks for all your efforts to try to narrow this down. Cheers 2010/9/9 James Cameron > On Thu, Sep 09, 2010 at 10:26:40AM +0200, Tomeu Vizoso wrote: > > If anybody wants to reproduce James' tests, I would recommend > > redirecting dbus-monitor to a file and filtering afterwards the > > unwanted events. > > Yes, that's an alternate method, but it doesn't prove execution of code > in Sugar in response to events. Instrumenting Sugar is fairly easy, > although it does require a restart. > > -- > James Cameron > http://quozl.linux.org.au/ > ___ > Sugar-devel mailing list > Sugar-devel@lists.sugarlabs.org > http://lists.sugarlabs.org/listinfo/sugar-devel > -- Ing. Franco Miceli CITS - Plan Ceibal - Investigación & Desarrollo Av. Italia 6201 - Montevideo, Uruguay CP: 11500 Tel: (598 2) 601 5773 int.: 2227 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH sugar-0.84] journal scan of external media
Excerpts from James Cameron's message of Thu Sep 09 03:24:36 +0200 2010: > > > +if None not in [self._date_start, self._date_end] and \ > > > +(stat.st_mtime < self._date_start or > > > + stat.st_mtime > self._date_end): > > > +add_to_list = False > > > > How about either checking just self._date_start or splitting it up into > > two separate rules? > > Don't understand, sorry. I mean either: if self._date_start is not None and self.st_mtime < self._date_start: return True if self._date_end is not None and self.st_mtime > self._date_end: return True Or: if self._date_start is not None and not (self._date_start <= self.st_mtime <= self._date_end): return True > > We should use a single way to derive MIME types (sugar.mime) in our code > > to avoid using different MIME types in different parts of Sugar. > I don't understand sugar.mime enough to do that. OK, then we'll tackle that in a separate patch. FYI: This is the code used e.g. in jarabe.journal.palettes.ObjectPalette.__friend_select_cb(): mime_type = mime.get_for_file(file_name) (with mime = sugar.mime) [ENOTDIR during os.listdir()] > The reproducible instance is /media/disk/dev/fd/24 ... since fd is a > symlink to /proc/self/fd ... (awesome isn't it? One can insert a USB key > that will list the contents of any directory on the laptop, provided > access is allowed.) Ah, it's good that came up during testing, didn't think about it. We should make sure symlinks don't point outside the filesystem by resolving them (os.path.abspath()) and checking against the root path. > On nine test filesystems of varying sizes, the following exceptions were > counted: [...] Thanks for the details statistics! > os.lstat of an entry returned by os.listdir [...] > exception EIO a total of 7 times Interesting. Was the storage medium broken in some way (read error)? I don't even see EIO as a documented error code for lstat(2). > On the test filesystem of 73k files, the pending directory list in raw > form is about 250k, and worst case whole path list from "find /mnt" is > 4MB. OK, that sounds reasonable enough even given Pythons list overhead. FWIW, the output of "find / -xdev" on my XO-1.5 is 12.5MB (installed TeX recently). > > Why? The order in which os.listdir() returns the entries is undefined > > anyway. > > When one uses os.listdir and then reverses the order before going > through them, the resulting performance is low, since the files are > being accessed in reverse. Because I didn't know about pop(0), I had to > use .reverse() to maintain ordering. Ah, don't you love how undefined behaviour still affects performance? [_scan()] > +if len(self._pending_files) > 0: > +return self._scan_a_file() > + > +if len(self._pending_directories) > 0: > +return self._scan_a_directory() PEP-8 says we should use "if self._pending_*" instead (without len()). If we just call the functions and return True in _scan(), we don't need to ensure that we always return True in self._scan_a_*(). [_scan_a_directory()] > +try: > +entries = os.listdir(dir_path) > +except OSError, e: > +if e.errno not in [errno.EACCES, errno.ENOTDIR]: > +logging.exception('Error reading directory %r', dir_path) > +return True Once we fix the symlink issues, ENOTDIR shouldn't happen anymore. 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] internationalization: homonym handling in genpot?
(maybe there is genpot list where this message is more apropos? Sorry, genpot is opaque to me.) My activity has two identical-in-english strings (homonyms) which need translating, but have two different meanings depending on context in an activity. How should I flag genpot that these are two different strings which might require different translations? #TRANS: bow and arrow activeDisplay = _("Bow") #TRANS: the front of a ship istrDisplay = _("Bow") Currently python setup.py genpot produces this output, making it impossible for the translator to handle both meanings differently: #. TRANS: bow and arrow #. TRANS: the front of a ship #: constants.py:35 #: constants.py:38 msgid "Bow" msgstr "" ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Analysing code changes, git diff
Excerpts from Tomeu Vizoso's message of Thu Sep 09 15:01:01 +0200 2010: > Don't know about better diffs, but I like meld as driven by git mergetool. I like doing the merging in my text editor (though the presentation meld uses is interesting). You don't happen to know how I could tell git to include all three versions (common ancestor and both branch heads) instead of just two (the branch heads)? 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] SL bug #1520
Hi, The patch is a temporary fix. According to Bernie,some other component is broken(X server?) and this is just a work around. However, I have filed a bug at gnome-bugzilla ( https://bugzilla.gnome.org/show_bug.cgi?id=629210#c0 ) regarding the same. Regards, Mukul On Fri, Sep 10, 2010 at 2:27 PM, Tomeu Vizoso wrote: > On Wed, Sep 8, 2010 at 11:15, Tomeu Vizoso wrote: > > On Tue, Sep 7, 2010 at 20:01, Mukul Gupta wrote: > >> Team, > >> > >> I am working on Bug # 1520 on sugarlabs. > >> http://bugs.sugarlabs.org/ticket/1520 > >> I tried to reproduce the issue on sugar-emulator. I realised that Alt + > Tab > >> did nothing. Instead, Alt+Tab functioned for GNOME. I tried to run sugar > >> from sugar-session. Still, Alt+ Tab did nothing. > >> Firstly, I would require some pointers on how to reproduce the bug. > >> Secondly, when I read the comments on the bugs page, I realised that > fran > >> pointed out that this functioning of the Alt+Tab as mentioned in the bug > can > >> also be considered as a utility rather than a bug. > >> A very similar bug to bug #1520 is #1518. > >> http://bugs.sugarlabs.org/ticket/1518 > >> > >> As far as solving the current bug is concerned I realised that Bernie > had > >> created a patch for the same in fedora and that could be implemented on > >> ubuntu. I have studied the patch - > >> http://sascha.silbe.org/patches/metacity-ungrab-keybindings.patch > > > > Should this patch go upstream? > > Ping, the metacity maintainer has shown interest but wants to give it > a good deal of testing before pushing and has requested a bug to be > filed. > > I just want to know if this patch is considered a proper fix that can > go upstream. > > Regards, > > Tomeu > > > Regards, > > > > Tomeu > > > >> Regards, > >> > >> Mukul Gupta > >> Research Engineer, SEETA > >> ___ > >> 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] [PATCH sugar-0.84] journal scan of external media
Excerpts from James Cameron's message of Thu Sep 09 06:39:53 +0200 2010: > +if link == '.': > +return True > +if link.startswith('/') and full_path.startswith(link): > +return True Both shouldn't be necessary (will be catched by the loop detection). As mentioned in the other mail, we should also make sure we stay on the current device: if not os.path.abspath(full_path).startswith(self._mount_point): return True 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] Scale TA font proportional to Sugar font-settings. (SL#1858)
This patch scales the font in TA by using ZOOM_FACTOR set in sugar.graphics.style (SL#1858) --- tawindow.py |9 + 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tawindow.py b/tawindow.py index 6a5629e..271c78b 100644 --- a/tawindow.py +++ b/tawindow.py @@ -33,6 +33,7 @@ from gettext import gettext as _ try: from sugar.graphics.objectchooser import ObjectChooser +from sugar.graphics.style import ZOOM_FACTOR from sugar.datastore import datastore from sugar import profile except ImportError: @@ -124,16 +125,16 @@ class TurtleArtWindow(): self.orientation = HORIZONTAL_PALETTE if olpc_xo_1(): self.lead = 1.0 -self.scale = 0.67 +self.scale = 0.67 * ZOOM_FACTOR self.color_mode = '565' if self.running_sugar and not self.activity.new_sugar_system: self.orientation = VERTICAL_PALETTE else: self.lead = 1.0 -self.scale = 1.0 +self.scale = 1.0 * ZOOM_FACTOR self.color_mode = '888' # TODO: Read visual mode from gtk image -self.block_scale = BLOCK_SCALE +self.block_scale = BLOCK_SCALE * ZOOM_FACTOR self.trash_scale = 0.5 self.myblock = None self.nop = 'nop' @@ -2001,7 +2002,7 @@ class TurtleArtWindow(): blk.spr.set_label(blk.values[0].replace('\n', RETURN)) elif btype == 'start': # block size is saved in start block if value is not None: -self.block_scale = value +self.block_scale = value * ZOOM_FACTOR elif btype in EXPANDABLE or btype == 'nop': if btype == 'vspace': if value is not None: -- 1.7.1 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] internationalization: homonym handling in genpot?
On Fri, Sep 10, 2010 at 4:36 PM, Erik Blankinship wrote: > (maybe there is genpot list where this message is more apropos? Sorry, > genpot is opaque to me.) > My activity has two identical-in-english strings (homonyms) which need > translating, but have two different meanings depending on context in an > activity. > How should I flag genpot that these are two different strings which might > require different translations? > #TRANS: bow and arrow > activeDisplay = _("Bow") > #TRANS: the front of a ship > istrDisplay = _("Bow") > Currently python setup.py genpot produces this output, making it impossible > for the translator to handle both meanings differently: > > #. TRANS: bow and arrow > #. TRANS: the front of a ship > #: constants.py:35 > #: constants.py:38 > msgid "Bow" > msgstr "" It looks like python doesn't support contexts yet: http://bugs.python.org/issue2504 Bernie is subscribed to the bug, so he might know how we are dealing with this in other activities, adding him to cc. Marco ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Feedback about ticket #10122
On Fri, Sep 10, 2010 at 11:10 AM, Benjamin M. Schwartz < bmsch...@fas.harvard.edu> wrote: > On 09/10/2010 09:54 AM, Gonzalo Odiard wrote: > > Hi Ben: > > I am trying to resolve the ticket http://dev.laptop.org/ticket/10122 > > Can you review it? Could you test it in XO-1.5? > > I've been following the discussion, but I haven't looked at the patch yet. > I've had a rather busy week. > > I can't easily test changes because my XO-1.5 is broken, but maybe I can > fix it this weekend. > > Ok. Tell me if I can send you more information. > > There are changes I did based in my tests, but I need to know if you > agree. > > I'm concerned about any making Distance change the volume settings. This > might make sense for the microphone amplification setting, but I would > prefer to leave the speaker volume under the user's control. The > appropriate volume to use for Distance depends on how long a distance one > is trying to measure, the level of background noise, whether other people > might be disturbed, etc. > > I was thinking we can show a semaphore or any image with the quality of the measure, in base of the difference with the previous measurements. For example if the difference with the last is until 5% different its green , until 30% yellow, more is red. Also we can put a text suggesting turn up the volume for better results. > The changes in delay constant could make sense. I'll need to look at the > changes and see if we can find an explanation for the changes. > > Other problem I am having is (in Sugar 0.84) if I restart a previously shared activity, the activity starts shared, but not appears in the neighborhood view from the other machines. I need to start a new activity and then share. Also I don't know if it's a good idea Distance save in the Journal. Only saves the temp and humid values and the last measurement. May be we can save these values in the activity_root/data directory from the activity, not pollute the Journal and resolve the resume issue. What you think? The change is easy. Regards Gonzalo ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] internationalization: homonym handling in genpot?
Hi Erik, On 10 Sep 2010, at 16:36, Erik Blankinship wrote: > (maybe there is genpot list where this message is more apropos? Sorry, > genpot is opaque to me.) > > My activity has two identical-in-english strings (homonyms) which need > translating, but have two different meanings depending on context in an > activity. > How should I flag genpot that these are two different strings which might > require different translations? > > #TRANS: bow and arrow > activeDisplay = _("Bow") > > #TRANS: the front of a ship > istrDisplay = _("Bow") Ooh interesting, not bumped into this need myself yet, but (as a cheat) it strikes me that gettext is using the given strings as IDs for its string lookups so you could replace your strings with _("Arrow|Bow") and _("Ship|Bow"), then make sure the pot file actually has the correct Bow msgstr set. I think though what your really looking for is context support but have not tinkered other than a few min googling: http://bugs.python.org/issue2504 If the Python workflow is working/there, and I haven't tested... you'd get extra msgctxt entry in the pot file containing your extra context argument supplied with the string allowing for disambiguation. Interesting questing, hope that helped :) Regards, --Gary > Currently python setup.py genpot produces this output, making it impossible > for the translator to handle both meanings differently: > > #. TRANS: bow and arrow > #. TRANS: the front of a ship > #: constants.py:35 > #: constants.py:38 > msgid "Bow" > msgstr "" > > > > ___ > 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] internationalization: homonym handling in genpot?
> > #TRANS: bow and arrow > activeDisplay = _("Bow") > > #TRANS: the front of a ship > istrDisplay = _("Bow") > > > Ooh interesting, not bumped into this need myself yet, but (as a cheat) it > strikes me that gettext is using the given strings as IDs for its string > lookups so you could replace your strings with _("Arrow|Bow") and > _("Ship|Bow"), > then make sure the pot file actually has the correct Bow msgstr set. I think > though what your really looking for is context support but have not tinkered > other than a few min googling: > > Just to make sure I understand your solution, if the activity is run in an untranslated language, won't "Arrow|Bow" be displayed? I was thinking to use "bow" and "bow ", and them trim all white space before displaying in an activity. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] ticket #2195
Hi Simon I am working on the bug http://bugs.sugarlabs.org/ticket/2195. To correct the issue i did changes in file sugar-jhbuild/sources/sugar/extension/cpsection/datetime/model.py but even after re-building sugar-jhbuild there was no noticeable change in the time shown. I have used pippy activity to check for time. Can you provide me any pointers on the above mentioned bug? regards ishan ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] flickering mouse in an activity on an xo
> > > > > Is there somewhere to get the sugar cursor graphics within sugar itself? > I see that physics imports its own local copy: > > > http://git.sugarlabs.org/projects/physics/repos/mainline/blobs/master/standardcursor.png > > You can find the original git rep that I made standardcursor.png out of at: > > > http://git.sugarlabs.org/projects/sugar-artwork/repos/mainline/trees/master/cursor/sugar I see that your copy and the originals have opaque white where I would expect 100% transparency. Is there a reason for this or a suggested technique for removing the white at runtime? ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] Scale TA font proportional to Sugar font-settings. (SL#1858)
On Fri, Sep 10, 2010 at 12:51 PM, Kandarp Kaushik wrote: > This patch scales the font in TA by using ZOOM_FACTOR > set in sugar.graphics.style (SL#1858) > --- > tawindow.py | 9 + > 1 files changed, 5 insertions(+), 4 deletions(-) > > diff --git a/tawindow.py b/tawindow.py > index 6a5629e..271c78b 100644 > --- a/tawindow.py > +++ b/tawindow.py > @@ -33,6 +33,7 @@ from gettext import gettext as _ > > try: > from sugar.graphics.objectchooser import ObjectChooser > + from sugar.graphics.style import ZOOM_FACTOR > from sugar.datastore import datastore > from sugar import profile > except ImportError: > @@ -124,16 +125,16 @@ class TurtleArtWindow(): > self.orientation = HORIZONTAL_PALETTE > if olpc_xo_1(): > self.lead = 1.0 > - self.scale = 0.67 > + self.scale = 0.67 * ZOOM_FACTOR > self.color_mode = '565' > if self.running_sugar and not self.activity.new_sugar_system: > self.orientation = VERTICAL_PALETTE > else: > self.lead = 1.0 > - self.scale = 1.0 > + self.scale = 1.0 * ZOOM_FACTOR > self.color_mode = '888' # TODO: Read visual mode from gtk image > > - self.block_scale = BLOCK_SCALE > + self.block_scale = BLOCK_SCALE * ZOOM_FACTOR > self.trash_scale = 0.5 > self.myblock = None > self.nop = 'nop' > @@ -2001,7 +2002,7 @@ class TurtleArtWindow(): > blk.spr.set_label(blk.values[0].replace('\n', RETURN)) > elif btype == 'start': # block size is saved in start block > if value is not None: > - self.block_scale = value > + self.block_scale = value * ZOOM_FACTOR > elif btype in EXPANDABLE or btype == 'nop': > if btype == 'vspace': > if value is not None: > -- > 1.7.1 The ZOOM_FACTOR is only defined if we are in the Sugar environment. Alas, this is not taken into account in your patch. -walter > > ___ > Sugar-devel mailing list > Sugar-devel@lists.sugarlabs.org > http://lists.sugarlabs.org/listinfo/sugar-devel > -- 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] internationalization: homonym handling in genpot?
On Fri, Sep 10, 2010 at 1:17 PM, Erik Blankinship wrote: >> #TRANS: bow and arrow >> activeDisplay = _("Bow") >> #TRANS: the front of a ship >> istrDisplay = _("Bow") >> >> Ooh interesting, not bumped into this need myself yet, but (as a cheat) it >> strikes me that gettext is using the given strings as IDs for its string >> lookups so you could replace your strings with _("Arrow|Bow") >> and _("Ship|Bow"), then make sure the pot file actually has the correct Bow >> msgstr set. I think though what your really looking for is context support >> but have not tinkered other than a few min googling: > > Just to make sure I understand your solution, if the activity is run in an > untranslated language, won't "Arrow|Bow" be displayed? I think you can fill in (by hand) the msgstr in your POT file and it will "do the right thing" for untranslated languages. -walter > I was thinking to use "bow" and "bow ", and them trim all white space before > displaying in an activity. > ___ > Sugar-devel mailing list > Sugar-devel@lists.sugarlabs.org > http://lists.sugarlabs.org/listinfo/sugar-devel > > -- 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] internationalization: homonym handling in genpot?
On Fri, 2010-09-10 at 17:59 +0100, Marco Pesenti Gritti wrote: > > #. TRANS: bow and arrow > > #. TRANS: the front of a ship > > #: constants.py:35 > > #: constants.py:38 > > msgid "Bow" > > msgstr "" > > It looks like python doesn't support contexts yet: > > http://bugs.python.org/issue2504 > > Bernie is subscribed to the bug, so he might know how we are dealing > with this in other activities, adding him to cc. This should be a working implementation of pgettext for Python: def pgettext(ctx, msg): return gettext(ctx + "\x04" + msg) It's used like so: label1 = pgettext("device_icon_menu", "Remove") label2 = pgettext("file_menu", "Remove") So you can translate the first as "eject" and the second as "delete". Now, I'm not sure whether the gettext command will recognize pgettext when processing Python input, as it's not part of the gettext module. If it doesn't work, I guess you could also directly use the low-level encoding of context: label1 = _("device_icon_menu\x04Remove") -- // Bernie Innocenti - http://codewiz.org/ \X/ Sugar Labs - http://sugarlabs.org/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Sugar and activities flag day
Just wanted to summarize an enlightening conversation that just happened in #sugar: 1. GNOME 3 is expected to be released 6 months after GNOME-2.32. This roughly lines up with the release date for Sugar-0.92. 2. GNOME 3 is expected to be based on GTK+-3, which breaks compatibility with GTK2 (but can presumably be installed side-by-side with GTK2, like GTK2 can coexist with GTK1) 3. Programs cant use GTK2 and GTK3 at the same time. One or the other. 4. PyGTK (used extensively by Sugar and activities) is not expected to be ported for GNOME-3. 5. pygi ("gobject introspection") is the effective replacement for PyGTK but requires a truckload of trivial changes to every program/module that uses PyGTK (see http://live.gnome.org/PyGObject/IntrospectionPorting) 6. We'll also see problems where (e.g.) evince moves to GTK3, meaning that we lose the static Python bindings and are expected to switch to gobject introspection. The Read activity would then have to start using pygi+GTK3, but it can't do that because the Sugar GUI libraries which it uses use GTK2, and we arrive at point #3. 7. It is likely that distributions that ship GNOME-3 will start shipping pygi and stop shipping PyGTK (or ship a PyGTK with substantially reduced API), meaning that sugar and all activities will simply *stop working* This obviously calls for Sugar switching to GTK3 and remaining in sync with gnome, but will be a big headache w.r.t. activities. Some ideas that were thrown around: - Someone could write a compatibility layer that makes code written for pygi work with PyGTK (therefore we port the whole of the sugar world, but people can install the compat layer and keep it running with GTK2) ... but this would be a huge amount of work, and the time would be better spent on the work needed to bring sugar up-to-date - When making the switch we could bump sugar's version number to 1.0 in order to make the change really obvious ... but there are concerns about false implications that people would draw from such a number ("Sugar is mature!!") ... some people would want to use such a version jump to make backwards-incompatible changes in the Sugar API and those people would probably want more than 6 months in order to prepare for it - or we could just bump it to sugar-0.100, but thats not such a strong communication (under the current 6-month system we'd reach sugar-0.100 in 2.5 years time without breaking API) Daniel ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] internationalization: homonym handling in genpot?
Hi Erik, On 10 Sep 2010, at 18:17, Erik Blankinship wrote: >> #TRANS: bow and arrow >> activeDisplay = _("Bow") >> >> #TRANS: the front of a ship >> istrDisplay = _("Bow") > > Ooh interesting, not bumped into this need myself yet, but (as a cheat) it > strikes me that gettext is using the given strings as IDs for its string > lookups so you could replace your strings with _("Arrow|Bow") and > _("Ship|Bow"), then make sure the pot file actually has the correct Bow > msgstr set. I think though what your really looking for is context support > but have not tinkered other than a few min googling: > > > Just to make sure I understand your solution, if the activity is run in an > untranslated language, won't "Arrow|Bow" be displayed? Yes. However I was thinking that you could go create/edit the po/en.po file and add in those string corrections, then run './setup build' to generate the locale .mo files. I've just tested here, I guess making sure you have a clear comment so the translators are not too confused by this approach would be the critical step. FWIW in case you are using a Soas image, './setup build' is giving me a nasty traceback on two different images (Mirabell and a recent F14 beta build). Worked just fine in the latest official 852 build from OLPC on an XO-1. Was just going to give a dextrose XO-1 build a go as well, but am away from home and net connection is slow here, will be tomorrow before I can test that. Regards, --Gary > I was thinking to use "bow" and "bow ", and them trim all white space before > displaying in an activity. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] internationalization: homonym handling in genpot?
> > > I think you can fill in (by hand) the msgstr in your POT file and it > will "do the right thing" for untranslated languages. > > Alas, this does not seem to work. .pot files are, evidently, just the translation template. As far as I can tell the untranslated language gets what's in your python source. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] internationalization: homonym handling in genpot?
> > > > Just to make sure I understand your solution, if the activity is run in > an untranslated language, won't "Arrow|Bow" be displayed? > > Yes. However I was thinking that you could go create/edit the po/en.po file > and add in those string corrections, This assumes that English will be the default fall back language in a translation is not available? Is this always the case? ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] internationalization: homonym handling in genpot?
> > > If it doesn't work, I guess you could also directly use the low-level > encoding of context: > >label1 = _("device_icon_menu\x04Remove") > > label1 = _("device_icon_menu\x04Remove") label2 = _("file_menu\x04Remove") Not surprisingly, this creates unique entries in the .pot file since they are two different strings, and then both can be translated. However, if the translation is not available, you get one messed up looking string. Is there supposed to be a way to suppress the first half of that string when it is displayed with gettext? ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] xo colors & gradients
> > Of course special cases like icons with alpha gradients may well be > measurably helped by such optimisations, but are not part of the core Sugar > style guidelines, > Are there more guidelines than this? http://wiki.sugarlabs.org/go/Human_Interface_Guidelines/The_Sugar_Interface/Icons#Icon_Design_Guidelines ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] flickering mouse in an activity on an xo
On Fri, Sep 10, 2010 at 2:20 PM, Erik Blankinship wrote: > > >> > Is there somewhere to get the sugar cursor graphics within sugar itself? >> I see that physics imports its own local copy: >> > >> http://git.sugarlabs.org/projects/physics/repos/mainline/blobs/master/standardcursor.png >> >> You can find the original git rep that I made standardcursor.png out of >> at: >> >> >> http://git.sugarlabs.org/projects/sugar-artwork/repos/mainline/trees/master/cursor/sugar > > > I see that your copy and the originals have opaque white where I would > expect 100% transparency. Is there a reason for this or a suggested > technique for removing the white at runtime? > Never mind; my cheap shareware image editor was not a good investment :-) ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel