[Sugar-devel] Fwd: [OLPC-SF] OLPC SF Community Summit 2010! Fri, Oct 22 - Sun, Oct 24
Begin forwarded message: From: OLPCSF Contact cont...@olpcsf.org Date: September 22, 2010 8:38:13 PM PDT To: OLPC SF olpc...@lists.laptop.org Subject: [OLPC-SF] OLPC SF Community Summit 2010! Fri, Oct 22 - Sun, Oct 24 What: OLPC SF Community Summit 2010 is a community event that brings together educators, technologists, anthropologists, enthusiasts, champions and volunteers. We share stories, exchange ideas, solve problems, foster community and build collaboration around the One Laptop per Child project and its mission worldwide. The event is a combination of panel discussions, Birds of a Feather sessions, speed-geeking and much more! The event is hosted by the OLPC San Francisco volunteer community. Website: http://olpcsf.org/CommunitySummit2010/ Where: SFSU Downtown Campus, 835 Market St, San Francisco, CA 94103 When: Fri, Oct 22 - Sun Oct 24 See the Schedule on the website People: See pictures, bios and a list of confirmed registrants - People on the website Registration: Regular Price is $35. See Registration on the website Donate/Promote: Request for travel scholarships images for promoting the event - Donate/Promote on the website Contact: Join our email list http://lists.laptop.org/listinfo/olpc-sf http://twitter.com/olpcsf http://identi.ca/olpcsf http://www.facebook.com/group.php?gid=68179607655 ___ OLPC-SF mailing list olpc...@lists.laptop.org http://lists.laptop.org/listinfo/olpc-sf ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Sugar on Fedora and Sugar on a Stick QA Processes Announcement
On Wed, Sep 22, 2010 at 10:50, Peter Robinson pbrobin...@gmail.com wrote: Hi All, As some of you know I was at FUDCon Zurich last weekend. I took the opportunity to sit down with Adam Williamson who is in charge of the Fedora QA team and process to discuss how we could incorporate Sugar and SoaS testing into the QA process. Adam agreed that we would be able to incorporate Sugar into the Desktop QA which will expand our testing massively as Fedora has a great QA team. It will also have the ability to allow us to block a release if there is things broken. That is a double edged sword as if its broken we'll also need to pull out all stops to ensure it is fixed as well, but overall I believe that is positive! In the short term this won't affect this release too much but I will be spending some time to define the criteria for Alpha, Beta and Final releases. It will also mean we have official spins for each of the Alpha, Beta as well as the usual Final releases. While we will see the start of the benefits for the home run this will really start to kick in for the SoaSv5 release process. Overall I think this is a massively positive opportunity for Sugar as it opens it out more to the wider Fedora community and allows us to get involved in the Fedora QA more and define what is important for us for our releases and allows us to ride on the coattails and gain the benefit of the awesome work that Adam and his team are doing upstream. Sounds really excellent, congratulations. Please ping me when you need anything from upstream. There's a lot of value for Sugar upstream in our releases getting packaged so quickly in Fedora and the testing will have as well a big impact. Regards, Tomeu Regards, Peter ___ 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] [SoaS] Sugar on Fedora and Sugar on a Stick QA Processes Announcement
On Wed, Sep 22, 2010 at 20:07, David Farning dfarn...@gmail.com wrote: On Wed, Sep 22, 2010 at 3:50 AM, Peter Robinson pbrobin...@gmail.com wrote: Hi All, As some of you know I was at FUDCon Zurich last weekend. I took the opportunity to sit down with Adam Williamson who is in charge of the Fedora QA team and process to discuss how we could incorporate Sugar and SoaS testing into the QA process. Adam agreed that we would be able to incorporate Sugar into the Desktop QA which will expand our testing massively as Fedora has a great QA team. It will also have the ability to allow us to block a release if there is things broken. That is a double edged sword as if its broken we'll also need to pull out all stops to ensure it is fixed as well, but overall I believe that is positive! In the short term this won't affect this release too much but I will be spending some time to define the criteria for Alpha, Beta and Final releases. It will also mean we have official spins for each of the Alpha, Beta as well as the usual Final releases. While we will see the start of the benefits for the home run this will really start to kick in for the SoaSv5 release process. Overall I think this is a massively positive opportunity for Sugar as it opens it out more to the wider Fedora community and allows us to get involved in the Fedora QA more and define what is important for us for our releases and allows us to ride on the coattails and gain the benefit of the awesome work that Adam and his team are doing upstream. That is excellent news. That will make my life much easier as I work to get Ubuntu Sugar Remix approved as a official Ubuntu release. We are targeting the 11.04 release for inclusion. I hope we can contribute as much back to the ecosystem as the SoaS has contributed:) I am hoping to start by engaging the ubuntu translation community. Sounds very good, looking forward to work more closely with the Ubuntu community. Regards, Tomeu david ___ 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] [SoaS] Sugar on Fedora and Sugar on a Stick QA Processes Announcement
On 09/22/2010 08:07 PM, David Farning wrote: On Wed, Sep 22, 2010 at 3:50 AM, Peter Robinsonpbrobin...@gmail.com wrote: Hi All, As some of you know I was at FUDCon Zurich last weekend. I took the opportunity to sit down with Adam Williamson who is in charge of the Fedora QA team and process to discuss how we could incorporate Sugar and SoaS testing into the QA process. Adam agreed that we would be able to incorporate Sugar into the Desktop QA which will expand our testing massively as Fedora has a great QA team. It will also have the ability to allow us to block a release if there is things broken. That is a double edged sword as if its broken we'll also need to pull out all stops to ensure it is fixed as well, but overall I believe that is positive! In the short term this won't affect this release too much but I will be spending some time to define the criteria for Alpha, Beta and Final releases. It will also mean we have official spins for each of the Alpha, Beta as well as the usual Final releases. While we will see the start of the benefits for the home run this will really start to kick in for the SoaSv5 release process. Overall I think this is a massively positive opportunity for Sugar as it opens it out more to the wider Fedora community and allows us to get involved in the Fedora QA more and define what is important for us for our releases and allows us to ride on the coattails and gain the benefit of the awesome work that Adam and his team are doing upstream. That is excellent news. That will make my life much easier as I work to get Ubuntu Sugar Remix approved as a official Ubuntu release. We are targeting the 11.04 release for inclusion. I hope we can contribute as much back to the ecosystem as the SoaS has contributed:) I am hoping to start by engaging the ubuntu translation community. david Looking forward to that! Would be great to be more present in Ubuntu. Go David go! Regards, Simon ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] INVITE: OLPC SF Community Summit 2010 (Fri, Oct 22 - Sun, Oct 24)
Registration Site Now LIVE: http://olpcSF.org/CommunitySummit2010 _Please all help promote our Learning Revolution to those worldwide who have not so far had time for OLPC/Sugar/Realness -- but can take a stand to join us in SF to now finally begin making this happen... _Please include Mike Lee's graphics here on your blog: http://olpcSF.org/CommunitySummit2010/donate.php Blog Posts and Tweets rolling as we speak; please do what it takes to expand this into other caring communities you're also part of: http://blog.laptop.org/2010/09/23/olpc-sf-community-summit-2010/ http://olpclearningclub.org/meetings/im-going-to-the-olpc-sf-community-summit-2010/ http://twitter.com/olpcsf http://twitter.com/olpc Subject: Re: [OLPC-SF] OLPC SF Community Summit 2010! Fri, Oct 22 - Sun, Oct 24 Date: Wed, 22 Sep 2010 23:15:32 -0700 From: Grant Bowman grant...@gmail.com To: OLPC SF olpc...@lists.laptop.org On Wed, Sep 22, 2010 at 11:12 PM, Elizabeth Krumbach l...@princessleia.com wrote: On Wed, Sep 22, 2010 at 10:47 PM, Holt h...@laptop.org wrote: Are we all clear to shout this off rooftops in every country now? Someone grab the gong and say YES -- then our volunteer army will translate into 100 languages later :) Go for it :) Hang on, here we go! Grant ___ OLPC-SF mailing list olpc...@lists.laptop.org http://lists.laptop.org/listinfo/olpc-sf Subject: [OLPC-SF] OLPC SF Community Summit 2010! Fri, Oct 22 - Sun, Oct 24 Date: Wed, 22 Sep 2010 20:38:13 -0700 From: OLPCSF Contact cont...@olpcsf.org To: OLPC SF olpc...@lists.laptop.org What: OLPC SF Community Summit 2010 is a community event that brings together educators, technologists, anthropologists, enthusiasts, champions and volunteers. We share stories, exchange ideas, solve problems, foster community and build collaboration around the One Laptop per Child project and its mission worldwide. The event is a combination of panel discussions, Birds of a Feather sessions, speed-geeking and much more! The event is hosted by the OLPC San Francisco volunteer community. Website: http://olpcsf.org/CommunitySummit2010/ Where: SFSU Downtown Campus, 835 Market St, San Francisco, CA 94103 When: Fri, Oct 22 - Sun Oct 24 See the Schedule on the website People: See pictures, bios and a list of confirmed registrants - People on the website Registration: Regular Price is $35. See Registration on the website Donate/Promote: Request for travel scholarships images for promoting the event - Donate/Promote on the website Contact: Join our email list http://lists.laptop.org/listinfo/olpc-sf http://twitter.com/olpcsf http://identi.ca/olpcsf http://www.facebook.com/group.php?gid=68179607655 ___ OLPC-SF mailing list olpc...@lists.laptop.org http://lists.laptop.org/listinfo/olpc-sf ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Hard Code Freeze exception #2362
Hi all, http://bugs.sugarlabs.org/ticket/2362 Issue was introduced by selecting non-ds entries in ObjectChooser (it creates symlinks to not break existed practice in activities that assume that all ds files are on the same fs and can be hard linking) but the same problem might happen while trying to store symlinks directly. -- Aleksey ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] fix http://dev.laptop.org/ticket/8857 - Browse fails to download some files with non-ascii characters
On 09/22/2010 07:23 PM, godi...@sugarlabs.org wrote: From: Gonzalo Odiardgodi...@sugarlabs.org --- downloadmanager.py |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/downloadmanager.py b/downloadmanager.py index ed68d82..df80334 100644 --- a/downloadmanager.py +++ b/downloadmanager.py @@ -137,8 +137,9 @@ class Download: self._last_update_percent = 0 self._stop_alert = None -dom_window = _dest_to_window[self._target_file.path] -del _dest_to_window[self._target_file.path] +file_path = self._target_file.path.encode('utf-8', 'replace') +dom_window = _dest_to_window[file_path] +del _dest_to_window[file_path] view = hulahop.get_view_for_window(dom_window) logging.debug('Download.init dom_window: %r' % dom_window) Looks good to me, thanks. Regards, Simon ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] implements http://bugs.sugarlabs.org/ticket/1106 - Browse: No preview in Journal for downloaded image
On 09/22/2010 05:44 PM, godi...@sugarlabs.org wrote: From: Gonzalo Odiardgodi...@sugarlabs.org this patch adressed comments from silbe about segregate the check of a image mime type and use of sugar.style constant colors now opens the image in the original size because we don't want scale up small images --- downloadmanager.py | 46 ++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/downloadmanager.py b/downloadmanager.py index 3eec649..ed68d82 100644 --- a/downloadmanager.py +++ b/downloadmanager.py @@ -35,6 +35,7 @@ from sugar.datastore import datastore from sugar import profile from sugar import mime from sugar.graphics.alert import Alert, TimeoutAlert +from sugar.graphics import style from sugar.graphics.icon import Icon from sugar.activity import activity @@ -192,12 +193,57 @@ class Download: sniffed_mime_type = mime.get_for_file(self._target_file.path) self.dl_jobject.metadata['mime_type'] = sniffed_mime_type +if self._check_image_mime_type(): +self.dl_jobject.metadata['preview'] = self._get_preview_image() + datastore.write(self.dl_jobject, transfer_ownership=True, reply_handler=self._internal_save_cb, error_handler=self._internal_save_error_cb, timeout=360 * DBUS_PYTHON_TIMEOUT_UNITS_PER_SECOND) + +def _check_image_mime_type(self): +pixbuf_mime_types = [] +for pixbuf_format in gtk.gdk.pixbuf_get_formats(): +pixbuf_mime_types.extend(pixbuf_format['mime_types']) + +return self._mime_type in pixbuf_mime_types I guess you could do here as well (I think Sascha suggested so): for pixbuf_format in gtk.gdk.pixbuf_get_formats(): if self._mime_type in pixbuf_format['mime_types']: return True return False +def _get_preview_image(self): +preview_width, preview_height = style.zoom(300), style.zoom(225) + +pixbuf = gtk.gdk.pixbuf_new_from_file(self._target_file.path) +width, height = pixbuf.get_width(), pixbuf.get_height() + + +if (width preview_width) or (height preview_height): +scale_x = float(width) / preview_width +scale_y = float(height) / preview_height +scale = max(scale_x,scale_y) Please leave some space max(scale_x, scale_y). +pixbuf = pixbuf.scale_simple(float(width) / scale, height / scale, + gtk.gdk.INTERP_BILINEAR) + +width, height = pixbuf.get_width(), pixbuf.get_height() + +pixbuf2 = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, pixbuf.get_has_alpha(), +pixbuf.get_bits_per_sample(), preview_width, preview_height) + +pixbuf2.fill(style.COLOR_WHITE.get_int()) + +margin_x, margin_y = (preview_width - width) / 2, (preview_height - height) / 2 + +pixbuf.copy_area(0, 0, width, height, pixbuf2, margin_x, margin_y) + +preview_data = [] +def save_func(buf, data): +data.append(buf) + +pixbuf2.save_to_callback(save_func, 'png', user_data=preview_data) +preview_data = ''.join(preview_data) +return dbus.ByteArray(preview_data) + def __start_response_cb(self, alert, response_id): global _active_downloads if response_id is gtk.RESPONSE_CANCEL: Regards, Simon ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] wordgroupz ( A vocabulary building app) ported to sugar
On 09/22/2010 07:01 AM, Tim McNamara wrote: On 22 September 2010 16:50, Ratnadeep Debnathrtn...@gmail.com wrote: snip / Sugar bundle for wordgroupz available at http://rtnpro.fedorapeople.org/wordgroupz/Wordgroupz-1.xo Please check if this is satisfactory and feel free to suggest any improvements. I also need an icon for wordgroupz for sugar. Any help will be highly appreciable. Well done on your release! My *personal* feeling is that you should change the name of the Activity. Ideally, all Sugar Activities should be verbs.[1] I know that many Activities haven't followed the HIG guidelines, but following them demonstrates a level of care. At the very least, I'm not happy with the trailing Z. I don't think encouraging misspelling is entirely suitable for an educational environment. Well done on the software, it looks very promising. Tim Yes Tim is right, extra points of using verbs for activity names. Regards, Simon ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] wordgroupz ( A vocabulary building app) ported to sugar
On Wed, Sep 22, 2010 at 10:31 AM, Tim McNamara paperl...@timmcnamara.co.nz wrote: Well done on your release! My *personal* feeling is that you should change the name of the Activity. Ideally, all Sugar Activities should be verbs.[1] I know that many Activities haven't followed the HIG guidelines, but following them demonstrates a level of care. At the very least, I'm not happy with the trailing Z. I don't think encouraging misspelling is entirely suitable for an educational environment. Is there a way to request feedback on names that are along the lines mandated by the HIG ? -- sankarshan mukhopadhyay http://sankarshan.randomink.org/blog ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] wordgroupz ( A vocabulary building app) ported to sugar
On 09/21/2010 02:00 PM, Ratnadeep Debnath wrote: Hi, wordgroupz is a vocabulary building application. It's written using PyGTK. wordgroupz details available at http://ratnadeepdebnath.wordpress.com/2010/09/09/wordgroupz-version-0-3-released/ I ported wordgroupz to sugar desktop environment. I tested it on sugar-jhbuild. The following libraries are needed for running wordgroupz: python DB-API 2.0 interface for SQLite 3.x python-sqlite2 pygtk2 python-nltk pywebkitgtk urllib2 python-BeautifulSoup gstreamer-python espeak Dependencies like python-nltk are not part of the Sugar platform as of today [1]. We would need to solve that in some way (adding, bundling in the XO...). Regards, Simon [1] http://wiki.sugarlabs.org/go/0.88/Platform_Components ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH] implements http://bugs.sugarlabs.org/ticket/1106 - Browse: No preview in Journal for downloaded image
From: Gonzalo Odiard godi...@sugarlabs.org this patch adressed comments from silbe about segregate the check of a image mime type and use of sugar.style constant colors now opens the image in the original size because we don't want scale up small images also i did changes sugested by simon --- downloadmanager.py | 46 ++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/downloadmanager.py b/downloadmanager.py index 3eec649..ed68d82 100644 --- a/downloadmanager.py +++ b/downloadmanager.py @@ -35,6 +35,7 @@ from sugar.datastore import datastore from sugar import profile from sugar import mime from sugar.graphics.alert import Alert, TimeoutAlert +from sugar.graphics import style from sugar.graphics.icon import Icon from sugar.activity import activity @@ -192,12 +193,57 @@ class Download: sniffed_mime_type = mime.get_for_file(self._target_file.path) self.dl_jobject.metadata['mime_type'] = sniffed_mime_type +if self._check_image_mime_type(): +self.dl_jobject.metadata['preview'] = self._get_preview_image() + datastore.write(self.dl_jobject, transfer_ownership=True, reply_handler=self._internal_save_cb, error_handler=self._internal_save_error_cb, timeout=360 * DBUS_PYTHON_TIMEOUT_UNITS_PER_SECOND) + +def _check_image_mime_type(self): +for pixbuf_format in gtk.gdk.pixbuf_get_formats(): +if self._mime_type in pixbuf_format['mime_types']: +return True +return False + +def _get_preview_image(self): +preview_width, preview_height = style.zoom(300), style.zoom(225) + +pixbuf = gtk.gdk.pixbuf_new_from_file(self._target_file.path) +width, height = pixbuf.get_width(), pixbuf.get_height() + + +if (width preview_width) or (height preview_height): +scale_x = float(width) / preview_width +scale_y = float(height) / preview_height +scale = max(scale_x, scale_y) + +pixbuf = pixbuf.scale_simple(float(width) / scale, height / scale, + gtk.gdk.INTERP_BILINEAR) + +width, height = pixbuf.get_width(), pixbuf.get_height() + +pixbuf2 = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, pixbuf.get_has_alpha(), +pixbuf.get_bits_per_sample(), preview_width, preview_height) + +pixbuf2.fill(style.COLOR_WHITE.get_int()) + +margin_x, margin_y = (preview_width - width) / 2, (preview_height - height) / 2 + +pixbuf.copy_area(0, 0, width, height, pixbuf2, margin_x, margin_y) + +preview_data = [] +def save_func(buf, data): +data.append(buf) + +pixbuf2.save_to_callback(save_func, 'png', user_data=preview_data) +preview_data = ''.join(preview_data) +return dbus.ByteArray(preview_data) + def __start_response_cb(self, alert, response_id): global _active_downloads if response_id is gtk.RESPONSE_CANCEL: -- 1.7.2.3 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v2 sugar] Frame: show application-set icon for non-Sugar windows
On 09/20/2010 07:32 PM, Sascha Silbe wrote: Excerpts from James Cameron's message of Mon Sep 20 02:48:08 +0200 2010: +def _icon_changed_cb(self, window): +gobject.idle_add(self._update_icon, window) I'm puzzled. Why defer the update to an idle task? If it is because of a race, I'm worried this won't fix it. I don't remember why I did it that way originally. Maybe it was from when I triggered it (only) from __init__() instead of listening to the signal. It works fine without the idle task on both XO-1.5 and regular PC, so let's just remove it. +def _update_icon(self, window): +logging.debug('_update_icon: start') +pixbuf = window.get_icon() +if pixbuf is None: +return When a function is an idle task, the return value has significance, so I'm not sure if a bare return is the right thing here. While it does work (bare return is actually return None which gets evaluated to False in boolean contexts), it would be bad style. But removing the idle task already takes care of that. :) +self._icon.props.file = util.TempFilePath(path) +logging.debug('_update_icon: updated icon') When are these files cleaned up? sugar.util.TempFilePath is a wrapper around a file name that removes the file when the name gets garbage-collected. So the file should disappear on the first garbage collection run after the window was closed or a new icon assigned. Sascha Can we get an updated patch for that one? Looks quite good when addressing James comments. (I would remove the loggings). Regards, Simon ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] implements http://bugs.sugarlabs.org/ticket/1106 - Browse: No preview in Journal for downloaded image
On Wed, Sep 22, 2010 at 17:44, godi...@sugarlabs.org wrote: From: Gonzalo Odiard godi...@sugarlabs.org this patch adressed comments from silbe about segregate the check of a image mime type and use of sugar.style constant colors now opens the image in the original size because we don't want scale up small images Just two small remarks: - the commit subject line should be short but tell enough of the commit to spot most things easily. Just appending #1234 at the end may be enough. - the rest of the commit message should be addressed to someone reading git log in the future. So it should be about the commit as a whole and not about a particular revision of it. If there's anything specific to the proposed patch you want to note when sending it, you can use the --compose arg to git-send-email. Regards, Tomeu --- downloadmanager.py | 46 ++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/downloadmanager.py b/downloadmanager.py index 3eec649..ed68d82 100644 --- a/downloadmanager.py +++ b/downloadmanager.py @@ -35,6 +35,7 @@ from sugar.datastore import datastore from sugar import profile from sugar import mime from sugar.graphics.alert import Alert, TimeoutAlert +from sugar.graphics import style from sugar.graphics.icon import Icon from sugar.activity import activity @@ -192,12 +193,57 @@ class Download: sniffed_mime_type = mime.get_for_file(self._target_file.path) self.dl_jobject.metadata['mime_type'] = sniffed_mime_type + if self._check_image_mime_type(): + self.dl_jobject.metadata['preview'] = self._get_preview_image() + datastore.write(self.dl_jobject, transfer_ownership=True, reply_handler=self._internal_save_cb, error_handler=self._internal_save_error_cb, timeout=360 * DBUS_PYTHON_TIMEOUT_UNITS_PER_SECOND) + + def _check_image_mime_type(self): + pixbuf_mime_types = [] + for pixbuf_format in gtk.gdk.pixbuf_get_formats(): + pixbuf_mime_types.extend(pixbuf_format['mime_types']) + + return self._mime_type in pixbuf_mime_types + + def _get_preview_image(self): + preview_width, preview_height = style.zoom(300), style.zoom(225) + + pixbuf = gtk.gdk.pixbuf_new_from_file(self._target_file.path) + width, height = pixbuf.get_width(), pixbuf.get_height() + + + if (width preview_width) or (height preview_height): + scale_x = float(width) / preview_width + scale_y = float(height) / preview_height + scale = max(scale_x,scale_y) + + pixbuf = pixbuf.scale_simple(float(width) / scale, height / scale, + gtk.gdk.INTERP_BILINEAR) + + width, height = pixbuf.get_width(), pixbuf.get_height() + + pixbuf2 = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, pixbuf.get_has_alpha(), + pixbuf.get_bits_per_sample(), preview_width, preview_height) + + pixbuf2.fill(style.COLOR_WHITE.get_int()) + + margin_x, margin_y = (preview_width - width) / 2, (preview_height - height) / 2 + + pixbuf.copy_area(0, 0, width, height, pixbuf2, margin_x, margin_y) + + preview_data = [] + def save_func(buf, data): + data.append(buf) + + pixbuf2.save_to_callback(save_func, 'png', user_data=preview_data) + preview_data = ''.join(preview_data) + return dbus.ByteArray(preview_data) + def __start_response_cb(self, alert, response_id): global _active_downloads if response_id is gtk.RESPONSE_CANCEL: -- 1.7.2.3 ___ 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] [PATCH] Add dependencies on previous steps in bundlemodule.
This patch fixes building bundles for me. Without it sugar-jhbuild directly tries to install the module without first updating and building it. And with a clean checkout that means it will fail, because the repository has not even been downloaded at that point. --- sjhbuild/bundlemodule.py |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/sjhbuild/bundlemodule.py b/sjhbuild/bundlemodule.py index c9a950d..7526e31 100644 --- a/sjhbuild/bundlemodule.py +++ b/sjhbuild/bundlemodule.py @@ -71,6 +71,7 @@ class BundleModule(Package): buildscript.execute(cmd, cwd=srcdir) do_build.next_phase = PHASE_INSTALL do_build.error_phases = [PHASE_FORCE_CHECKOUT] +do_build.depends = [PHASE_CHECKOUT] def skip_install(self, buildscript, last_state): return buildscript.config.nobuild @@ -85,6 +86,7 @@ class BundleModule(Package): buildscript.packagedb.add(self.name, self.get_revision() or '') do_install.next_phase = Package.PHASE_DONE do_install.error_phases = [] +do_install.depends = [PHASE_BUILD] def parse_bundle(node, config, uri, repositories, default_repo): -- 1.7.1 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [ANNOUNCE] Sucrose 0.90 Tarballs Due
Dear Sucrose Maintainers, we will have our final release in the 0.90 development cycle September the 29th [1]. We are currently fixing the blockers we found. If no blocker issues arise we will release next Wednesday. Of course, please keep on reporting any issues with 0.90 you encounter. There will be as well a bug fix release in 1 month. Please provide the Sucrose 0.90.0 tarballs by Monday night (27th of September) and announce them as explained at [2]. Thanks, Simon [1] http://wiki.sugarlabs.org/go/0.90/Roadmap#Schedule [2] http://sugarlabs.org/go/Development_Team/Release#Module_release ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] RIT Humanitarian Open Source Software Class
RIT has a humanitarian open source class that willl be working on some more projects this semester. All our students have been instructed to get their blogs on the sugar planet. We have also aggregated their blogs in our own planet that can be found here: http://foss.rit.edu/planet/hoss/ Today we have decided on projects and the teams. See this blog post for more information: http://blog.jlewopensource.com/2010/09/class-092310.html Justin Lewis http://jlewopensource.com ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] wordgroupz ( A vocabulary building app) ported to sugar
Hi Sankarshan, On 23 Sep 2010, at 14:36, sankarshan wrote: On Wed, Sep 22, 2010 at 10:31 AM, Tim McNamara paperl...@timmcnamara.co.nz wrote: Well done on your release! My *personal* feeling is that you should change the name of the Activity. Ideally, all Sugar Activities should be verbs.[1] I know that many Activities haven't followed the HIG guidelines, but following them demonstrates a level of care. At the very least, I'm not happy with the trailing Z. I don't think encouraging misspelling is entirely suitable for an educational environment. Is there a way to request feedback on names that are along the lines mandated by the HIG ? Sure, if in doubt, post some names you'd consider here. FWIW, it can be tough finding a single verb that makes much sense (and can be quite a pain to change a name later on so is good to settle on a name early as possible). Regards, --Gary -- sankarshan mukhopadhyay http://sankarshan.randomink.org/blog ___ 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] Scale TA font proportional to Sugar font-settings. (SL#1858)
Hello, Thanks for reviewing the patch. I was not able to figure out how could we get the font zoom from gconf and to what variable should we assign that in tawindow.py. Regards, Kandarp Kaushik On Wed, Sep 22, 2010 at 1:51 PM, Walter Bender walter.ben...@gmail.comwrote: On Wed, Sep 22, 2010 at 12:15 AM, James Cameron qu...@laptop.org wrote: On Wed, Sep 22, 2010 at 09:10:21AM +0530, Kandarp Kaushik wrote: This patch scales the font in TA by using ZOOM_FACTOR set in sugar.graphics.style (SL#1858) But the font size is set by the gconf float /desktop/sugar/font/default_size ... available as sugar.graphics.style.FONT_SIZE Using ZOOM_FACTOR is too general, based on SUGAR_SCALING, and so Turtle Art won't scale fonts in proportion to the font-size setting. @@ -125,16 +126,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' @@ -2035,7 +2036,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 in EXPANDABLE_BLOCKS or \ btype in EXPANDABLE_ARGS or btype == 'nop': if btype == 'vspace' or btype in EXPANDABLE_BLOCKS: But it seems here you are not scaling the fonts, but rather block sizes. I'm confused. He is scaling the fonts and the block sizes. The original ticket was about using the gconf setting. It could be interesting to scale the blocks initially based on the zoom as well. So perhaps the patch should do both, but get the font zoom from gconf as you suggest. -walter -- James Cameron http://quozl.linux.org.au/ ___ 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] [PATCH v2 sugar] Frame: show application-set icon for non-Sugar windows
Excerpts from Sascha Silbe's message of Mon Sep 20 19:32:40 +0200 2010: When are these files cleaned up? sugar.util.TempFilePath is a wrapper around a file name that removes the file when the name gets garbage-collected. So the file should disappear on the first garbage collection run after the window was closed or a new icon assigned. It turned out the file never got garbage-collected. After trying to diagnose this leak for more than half a day I gave up and added a workaround. I haven't tested what happens if an application changes the icon multiple times at runtime. While I expect it to work just fine (the workaround does almost the same) it would be nice if you could try it or name an application that does change its icon so I can test it. 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 v3 sugar] Frame: show application-set icon for non-Sugar windows
Display the _NET_WM_ICON content instead of a generic icon for non-Sugar applications. Because the sugar.graphics.Icon API is based on file names, we need to create a temporary file to store the icon. A future patch could either enhance sugar.graphics.Icon to accept pixbufs or rework ActivityButton to use something different to show the icon. Tested on XO-1.5 running Debian Squeeze. Updating the icon took 0.1s (0.018s, 0.005s and 0.026s) with /tmp on tmpfs. Signed-off-by: Sascha Silbe sascha-...@silbe.org --- src/jarabe/frame/activitiestray.py | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) v1-v2: fix race condition causing application-set icon not to be shown on fast systems v2-v3: remove idle task, use __* for callback name, workaround for temp file leak diff --git a/src/jarabe/frame/activitiestray.py b/src/jarabe/frame/activitiestray.py index 6bd2a1b..07e834f 100644 --- a/src/jarabe/frame/activitiestray.py +++ b/src/jarabe/frame/activitiestray.py @@ -37,6 +37,7 @@ from sugar.graphics.menuitem import MenuItem from sugar.datastore import datastore from sugar import mime from sugar import env +from sugar import util from jarabe.model import shell from jarabe.model import invites @@ -67,6 +68,12 @@ class ActivityButton(RadioToolButton): self._icon.props.file = home_activity.get_icon_path() else: self._icon.props.icon_name = 'image-missing' +window = home_activity.get_window() +if window is not None: +window.connect('icon-changed', self.__icon_changed_cb) +if window.get_icon(): +self.__icon_changed_cb(window) + self.set_icon_widget(self._icon) self._icon.show() @@ -97,6 +104,16 @@ class ActivityButton(RadioToolButton): else: self._icon.props.pulsing = False +def __icon_changed_cb(self, window): +pixbuf = window.get_icon() +if pixbuf is None: +return + +fd, path = tempfile.mkstemp(suffix='.png') +os.close(fd) +pixbuf.save(path, 'png') +self._icon.props.icon_name = None +self._icon.props.file = util.TempFilePath(path) class InviteButton(ToolButton): @@ -241,6 +258,10 @@ class ActivitiesTray(HTray): button = self._buttons[home_activity] self.remove_item(button) del self._buttons[home_activity] +# FIXME: workaround for leaking temporary files because the file name +# (TempFilePath instance) doesn't get garbage-collected. See also +# SL#2360. +button._icon.props.file = None def _activate_activity(self, home_activity): button = self._buttons[home_activity] -- tg: (7fc14a7..) t/frame-show-legacy-icons (depends on: upstream/master) ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH] implements http://bugs.sugarlabs.org/ticket/1106 - Browse: No preview in Journal for downloaded image
Excerpts from godiard's message of Thu Sep 23 15:42:15 +0200 2010: this patch adressed comments from silbe about segregate the check of a image mime type and use of sugar.style constant colors now opens the image in the original size because we don't want scale up small images also i did changes sugested by simon Please adjust summary and description (and add a changelog) as explained by Tomeu and Simon. + Methods should only be separated by one blank line, not two. Normally I would recommend running pep8, but I haven't had time to clean up Browse yet so it's hard to find new complaints among all the previously existing ones, sorry. You might try redirecting the output to a file and using comm: $ git stash save $ ~/sugar-jhbuild/sugar-jhbuild run pep8 --repeat *.py pep8-old.log $ git stash pop $ ~/sugar-jhbuild/sugar-jhbuild run pep8 --repeat *.py pep8-new.log $ comm -3 pep8-old.log pep8-new.log |less This will report a lot of line number changes, but the first few lines of the output might be interesting. +def _get_preview_image(self): +preview_width, preview_height = style.zoom(300), style.zoom(225) I still think using zoom(300) here is a bad idea, but will stop arguing about it for now as sugar-toolkit does the same. We'll fix it up later. +pixbuf = gtk.gdk.pixbuf_new_from_file(self._target_file.path) +width, height = pixbuf.get_width(), pixbuf.get_height() + + Blocks inside methods should be separated by a single blank line only. +if (width preview_width) or (height preview_height): +scale_x = float(width) / preview_width +scale_y = float(height) / preview_height +scale = max(scale_x, scale_y) + +pixbuf = pixbuf.scale_simple(float(width) / scale, height / scale, + gtk.gdk.INTERP_BILINEAR) I guess you meant width / scale? scale_simple() expects integers. If you use scale(), you can get rid of one pixbuf (currently you use up to three). +width, height = pixbuf.get_width(), pixbuf.get_height() +pixbuf2 = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, pixbuf.get_has_alpha(), +pixbuf.get_bits_per_sample(), preview_width, preview_height) This creates a border around an image that's smaller than the preview size, thus wasting disk space. Please use width and height instead. Thanks again for working on this! 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] Add dependencies on previous steps in bundlemodule.
Excerpts from Benjamin Berg's message of Thu Sep 23 16:55:11 +0200 2010: This patch fixes building bundles for me. Without it sugar-jhbuild directly tries to install the module without first updating and building it. And with a clean checkout that means it will fail, because the repository has not even been downloaded at that point. Pushed, thanks! 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] implements http://bugs.sugarlabs.org/ticket/1106 - Browse: No preview in Journal for downloaded image
+if (width preview_width) or (height preview_height): +scale_x = float(width) / preview_width +scale_y = float(height) / preview_height +scale = max(scale_x, scale_y) + +pixbuf = pixbuf.scale_simple(float(width) / scale, height / scale, + gtk.gdk.INTERP_BILINEAR) I guess you meant width / scale? scale_simple() expects integers. Yes If you use scale(), you can get rid of one pixbuf (currently you use up to three). Ok. +width, height = pixbuf.get_width(), pixbuf.get_height() +pixbuf2 = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, pixbuf.get_has_alpha(), +pixbuf.get_bits_per_sample(), preview_width, preview_height) This creates a border around an image that's smaller than the preview size, thus wasting disk space. Please use width and height instead. That isn't true. If the image doesn't have the right proportions, it's stretch when displayed. -- Gonzalo Odiard SugarLabs Argentina ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel