Re: [Sugar-devel] How to copy something from the Journal to a pendrive? FotoToon export?
Hi, I've been trying for while now to copy journal entries to a usb stick. This works fine as long as files are concerned, e.g. Pics or Audio recordings taken with Record. It does not work if I try to copy an activity from the journal to the usb stick. No matter if I'm using the menu in the details view or drag and drop. The behavior is always the same: it appears to work, the little copy icon appears etc. but in the end the copied file is not on the stick. I've tried two different sticks, both have been recently formatted. Why would I want to copy an activity to a usb stick? Imagine two or more children. Half of them are in country1, the others are in country2. They would like to collaborate on an activity, e.g. FotoToon. One of the groups starts and adds a picture and some bubbles. Now they want to send their work to the other group so that they can add a picture and a couple of bubbles. This goes back and forth a couple of times. I actually managed somehow to store the FotoToon activity as a zip file. This zip contains the images and a .json file describing the bubbles. Unfortunately FotoToon does not seem to be able to open this zip file. More or less the same happens when I attach the activity to an email. If I rename the file to xxx.zip I can open it and there are the images and the json file. I cannot open it with FotoToon. If I do not rename the activity and try to start it it will open Etoys. Another problem is how to save the final story into a format that e.g. can be published on a website? FotoToon is just one example that the results that have been achieved while working with one activity cannot be used to be edited in another activity. I have the same problem with, amongst others, TamTamJam or Paint. Is it really not possible or am I missing something? Thanks a lot for your help, Tom On Aug 3, 2010, at 1:55 PM, Bernie Innocenti wrote: On Tue, 2010-08-03 at 09:11 +0200, Tomeu Vizoso wrote: How much effort would it be to add such an copy-to-USB option to the Journal hover palette? Is this something I could do with the help of my knowledgable flatmate Mr. Innocenti? Yep, shouldn't be hard nor a lot of code. As we're there, we might want to add a progress display for long copy operations. Currently, if you drop a large file on the journal icon, the UI freezes for a long time with no indication of progress, tempting the user to perform a hard reboot (and thus corrupting the datastore :-). If nobody has time to implement a nice progress bar, at least we could put on the busy cursor (which is animated in our cursor theme, iirc). The copy could probably be made fully asynchronous, but with no progress indication, there's a potential for users to extract USB sticks before the operation is finished. -- // 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 mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] Making people aware of the topic filter for sugar-devel
Hi! With the traffic rising on sugar-devel due to patch reviews, we should make sure people are aware they can use easy filtering on the mailing list side. A good first step would be to mention this possibility a) on the Mailing Lists wiki page [1] and b) in the welcome mail that is sent out to new subscribers. It would be nice if someone else could come up with a suitable text. Some rough instructions: To receive only mails for specific topics, select those topics in the Which topic categories would you like to subscribe to? option and answer No to Do you want to receive messages that do not match any topic filter?. To receive all mails except for a few specific topics (e.g. Patches and patch reviews), select all topics except those that don't interest you and answer Yes to Do you want to receive messages that do not match any topic filter?. The template for the welcome message currently looks like this: === Begin === Welcome to the %(real_name)s...@%(host_name)s mailing list! %(welcome)s To post to this list, send your email to: %(emailaddr)s General information about the mailing list is at: %(listinfo_url)s If you ever want to unsubscribe or change your options (eg, switch to or from digest mode, change your password, etc.), visit your subscription page at: %(optionsurl)s %(umbrella)s You can also make such adjustments via email by sending a message to: %(real_name)s-requ...@%(host_name)s with the word `help' in the subject or body (don't include the quotes), and you will get back a message with instructions. You must know your password to change your options (including changing the password, itself) or to unsubscribe. It is: %(password)s Normally, Mailman will remind you of your %(host_name)s mailing list passwords once every month, although you can disable this if you prefer. This reminder will also include instructions on how to unsubscribe or change your account options. There is also a button on your options page that will email your current password to you. === End === Sascha [1] https://wiki.sugarlabs.org/go/Mailing_Lists -- 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 v4 sugar] Downgrading activities not allowed. (#2164)
On Sun, Oct 17, 2010 at 01:55:00AM +0530, anub...@seeta.in wrote: Downgrading an activity is now made possible. When a .xo file of a version older than the currently installed version is clicked, a downgrading option is made available, by popping up of a confirmation alert. Depending upton the choice selected you can downgrade the activity. So we are in agreement to not use special window for downgrade alert (we have at least one response from Garry), so downgarade alert should be just regular alert(alert.py from sugar-toolkit) in Journal window. (and you didn't pass your patch though sugar-lint) v1 - v2. Named according to the nomenclature suggested,inline function used,signal emission condition revised,global variables removed. v2 - v3. Taking care of all calling of misc.resume. v3 - v4. Changes in the copyright of the new file Signed-off-by: Anubhav Aggarwal anub...@seeta.in , Shanjit Singh Jajmann shan...@seeta.in --- src/jarabe/journal/misc.py | 29 ++--- src/jarabe/journal/versionalert.py | 122 src/jarabe/model/bundleregistry.py |9 ++- 3 files changed, 148 insertions(+), 12 deletions(-) create mode 100644 src/jarabe/journal/versionalert.py diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py index 32a2847..f060bb2 100644 --- a/src/jarabe/journal/misc.py +++ b/src/jarabe/journal/misc.py @@ -30,12 +30,14 @@ from sugar.graphics.xocolor import XoColor from sugar import mime from sugar.bundle.activitybundle import ActivityBundle from sugar.bundle.contentbundle import ContentBundle +from sugar.bundle.bundle import AlreadyInstalledException from sugar import util from jarabe.view import launcher from jarabe.model import bundleregistry, shell from jarabe.journal.journalentrybundle import JournalEntryBundle from jarabe.journal import model +from jarabe.journal.versionalert import VersionAlert def _get_icon_for_mime(mime_type): generic_types = mime.get_all_generic_types() @@ -150,6 +152,7 @@ def get_activities(metadata): def resume(metadata, bundle_id=None): registry = bundleregistry.get_registry() +version_downgrade = False if is_activity_bundle(metadata) and bundle_id is None: @@ -159,19 +162,27 @@ def resume(metadata, bundle_id=None): bundle = ActivityBundle(file_path) if not registry.is_installed(bundle): logging.debug('Installing activity bundle') -registry.install(bundle) +try: +registry.install(bundle) +except AlreadyInstalledException: +v_alert = VersionAlert() +v_alert.give_bundle(bundle) +version_downgrade= True +logging.debug('done') + else: logging.debug('Upgrading activity bundle') registry.upgrade(bundle) -logging.debug('activityfactory.creating bundle with id %r', -bundle.get_bundle_id()) -installed_bundle = registry.get_bundle(bundle.get_bundle_id()) -if installed_bundle: -launch(installed_bundle) -else: -logging.error('Bundle %r is not installed.', - bundle.get_bundle_id()) +if not version_downgrade: +logging.debug('activityfactory.creating bundle with id %r', +bundle.get_bundle_id()) +installed_bundle = registry.get_bundle(bundle.get_bundle_id()) +if installed_bundle: +launch(installed_bundle) +else: +logging.error('Bundle %r is not installed.', + bundle.get_bundle_id()) elif is_content_bundle(metadata) and bundle_id is None: diff --git a/src/jarabe/journal/versionalert.py b/src/jarabe/journal/versionalert.py new file mode 100644 index 000..b0e30b0 --- /dev/null +++ b/src/jarabe/journal/versionalert.py @@ -0,0 +1,122 @@ +#Copyright (C) 2010 Software for Education, Entertainment and Training Activities +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import gtk +from gettext import gettext as _ + +from sugar.graphics import style +from jarabe.model import
[Sugar-devel] [PATCH v2 Paint] Changes made to save the last added text item. (OLPC #5917)
New variable text_status defined which could keep the track of the status of text being entered and save it when activity is stopped. Signed-off-by: Ishan Bansalis...@seeta.in, Anubhav Aggarwalanub...@seeta.in --- Area.py | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) v1-v2: Patch updated diff --git a/Area.py b/Area.py index 2dca7da..a2db51b 100644 --- a/Area.py +++ b/Area.py @@ -113,6 +113,8 @@ class Area(gtk.DrawingArea): self.connect(leave_notify_event, self.mouseleave) self.connect(enter_notify_event, self.mouseenter) +self.text_status = -1 + target = [('text/uri-list', 0, TARGET_URI)] self.drag_dest_set(gtk.DEST_DEFAULT_ALL, target, gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE) @@ -303,6 +305,7 @@ class Area(gtk.DrawingArea): # text if self.tool['name'] == 'text': self.d.text(widget,event) +self.text_status = 0 # This fixes a bug that made the text viewer get stuck in the canvas elif self.estadoTexto is 1: @@ -473,6 +476,10 @@ class Area(gtk.DrawingArea): self.configure_line(self.line_size) self.d.polygon(widget,coords,True,self.tool['fill'],moving) +if self.tool['name'] == 'text': + if self.text_status == 0: + self.text_status = 1 + gtk.gdk.event_request_motions (event) def mouseup(self,widget,event): @@ -571,6 +578,10 @@ class Area(gtk.DrawingArea): size = self.tool['line size'] widget.queue_draw_area(self.x_cursor-size, self.y_cursor-size, size*2, size*2) +if self.tool['name'] == 'text': + if self.text_status == 1: + self.d.text(widget,event) + def mouseenter(self, widget, event): if self.tool['name'] in ['pencil','eraser','brush','rainbow']: self.drawing = False -- 1.7.0.4 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH sugar] Journal list view: don't choke on invalid or incomplete metadata (SL#1408)
Metadata can get corrupted by crashes or malformed by buggy activities. We should do our best to display the parts that are usable and certainly never mess up the entire Journal. Signed-off-by: Sascha Silbe sascha-...@silbe.org --- src/jarabe/journal/listmodel.py | 49 -- 1 files changed, 36 insertions(+), 13 deletions(-) diff --git a/src/jarabe/journal/listmodel.py b/src/jarabe/journal/listmodel.py index 55f83f4..6b9518e 100644 --- a/src/jarabe/journal/listmodel.py +++ b/src/jarabe/journal/listmodel.py @@ -140,11 +140,16 @@ class ListModel(gtk.GenericTreeModel, gtk.TreeDragSource): xo_color = misc.get_icon_color(metadata) self._cached_row.append(xo_color) -title = gobject.markup_escape_text(metadata.get('title', None)) -self._cached_row.append('b%s/b' % title) +title = gobject.markup_escape_text(metadata.get('title', +_('Untitled'))) +self._cached_row.append('b%s/b' % (title, )) -timestamp = int(metadata.get('timestamp', 0)) -self._cached_row.append(util.timestamp_to_elapsed_string(timestamp)) +try: +timestamp = float(metadata.get('timestamp', 0)) +except (TypeError, ValueError): +self._cached_row.append(_('Unknown')) +else: + self._cached_row.append(util.timestamp_to_elapsed_string(timestamp)) try: creation_time = float(metadata.get('creation_time')) @@ -161,19 +166,37 @@ class ListModel(gtk.GenericTreeModel, gtk.TreeDragSource): else: self._cached_row.append(util.format_size(size)) -self._cached_row.append(int(metadata.get('progress', 100))) - -if metadata.get('buddies', ''): -buddies = simplejson.loads(metadata['buddies']).values() -else: +try: +progress = int(float(metadata.get('progress', 100))) +except (TypeError, ValueError): +progress = 100 +self._cached_row.append(progress) + +buddies = [] +if metadata.get('buddies'): +try: +buddies = simplejson.loads(metadata['buddies']).values() +except simplejson.decoder.JSONDecodeError, exception: +logging.warning('Cannot decode buddies for %r: %s', +metadata['uid'], exception) + +if not isinstance(buddies, list): +logging.warning('Content of buddies for %r is not a list: %r', +metadata['uid'], buddies) buddies = [] for n_ in xrange(0, 3): if buddies: -nick, color = buddies.pop(0) -self._cached_row.append((nick, XoColor(color))) -else: -self._cached_row.append(None) +try: +nick, color = buddies.pop(0) +except (AttributeError, ValueError), exception: +logging.warning('Malformed buddies for %r: %s', +metadata['uid'], exception) +else: +self._cached_row.append((nick, XoColor(color))) +continue + +self._cached_row.append(None) return self._cached_row[column] -- 1.7.1 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH sugar] Journal details view: don't choke on invalid timestamp (SL#1590, SL#2208)
Metadata can get corrupted by crashes or malformed by buggy activities. We should do our best to display the parts that are usable. Signed-off-by: Sascha Silbe sascha-...@silbe.org --- src/jarabe/journal/expandedentry.py | 12 src/jarabe/journal/misc.py | 16 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/jarabe/journal/expandedentry.py b/src/jarabe/journal/expandedentry.py index 0c60600..0abf8ab 100644 --- a/src/jarabe/journal/expandedentry.py +++ b/src/jarabe/journal/expandedentry.py @@ -281,10 +281,14 @@ class ExpandedEntry(hippo.CanvasBox): def _format_date(self): if 'timestamp' in self._metadata: -timestamp = float(self._metadata['timestamp']) -return time.strftime('%x', time.localtime(timestamp)) -else: -return _('No date') +try: +timestamp = float(self._metadata['timestamp']) +except (ValueError, TypeError): +logging.warning('Invalid timestamp for %r: %r', +self._metadata['uid'], self._metadata['timestamp']) +else: +return time.strftime('%x', time.localtime(timestamp)) +return _('No date') def _create_buddy_list(self): diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py index 619fe43..4fcfc60 100644 --- a/src/jarabe/journal/misc.py +++ b/src/jarabe/journal/misc.py @@ -87,12 +87,20 @@ def get_icon_name(metadata): def get_date(metadata): Convert from a string in iso format to a more human-like format. if 'timestamp' in metadata: -timestamp = float(metadata['timestamp']) -return util.timestamp_to_elapsed_string(timestamp) +try: +timestamp = float(metadata['timestamp']) +except (TypeError, ValueError): +logging.warning('Invalid timestamp: %r', metadata['timestamp']) +else: +return util.timestamp_to_elapsed_string(timestamp) if 'mtime' in metadata: -ti = time.strptime(metadata['mtime'], '%Y-%m-%dT%H:%M:%S') -return util.timestamp_to_elapsed_string(time.mktime(ti)) +try: +ti = time.strptime(metadata['mtime'], '%Y-%m-%dT%H:%M:%S') +except (TypeError, ValueError): +logging.warning('Invalid mtime: %r', metadata['mtime']) +else: +return util.timestamp_to_elapsed_string(time.mktime(ti)) return _('No date') -- 1.7.1 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH sugar-toolkit] XoColor: don't choke if passed the wrong type (SL#1408)
Color data is stored in the Journal as a JSON dump, so we can get back arbitrary types. XoColor already checks the color string for validity and handles invalid strings gracefully, so it makes sense to enhance this to invalid types as well. Signed-off-by: Sascha Silbe sascha-...@silbe.org --- src/sugar/graphics/xocolor.py |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/sugar/graphics/xocolor.py b/src/sugar/graphics/xocolor.py index df60917..395e345 100644 --- a/src/sugar/graphics/xocolor.py +++ b/src/sugar/graphics/xocolor.py @@ -209,6 +209,10 @@ colors = [ def _parse_string(color_string): +if not isinstance(color_string, (str, unicode)): +logging.error('Invalid color string: %r', color_string) +return None + if color_string == 'white': return ['#ff', '#414141'] elif color_string == 'insensitive': -- 1.7.1 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] How to copy something from the Journal to a pendrive? FotoToon export?
Excerpts from tom.staub...@fhtw-berlin.de's message of Sun Oct 17 09:02:42 +0200 2010: I've been trying for while now to copy journal entries to a usb stick. This works fine as long as files are concerned, e.g. Pics or Audio recordings taken with Record. It does not work if I try to copy an activity from the journal to the usb stick. I was able to reproduce [1] and fix this issue. Patch is on the way. Sascha [1] https://bugs.sugarlabs.org/ticket/2456 -- 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] don't delete bundles on storage media (SL #2456)
model.get_file() already wraps data store checkouts in TempFilePath. Because misc.get_bundle() unconditionally wrapped the path returned by model.get_file() in TempFilePath as well, bundles located on storage media (which are referenced by their actual location, not copied or linked) were deleted after misc.get_bundle() finished. Signed-off-by: Sascha Silbe sascha-...@silbe.org --- src/jarabe/journal/misc.py |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py index 4fcfc60..1817df3 100644 --- a/src/jarabe/journal/misc.py +++ b/src/jarabe/journal/misc.py @@ -108,21 +108,21 @@ def get_date(metadata): def get_bundle(metadata): try: if is_activity_bundle(metadata): -file_path = util.TempFilePath(model.get_file(metadata['uid'])) +file_path = model.get_file(metadata['uid']) if not os.path.exists(file_path): logging.warning('Invalid path: %r', file_path) return None return ActivityBundle(file_path) elif is_content_bundle(metadata): -file_path = util.TempFilePath(model.get_file(metadata['uid'])) +file_path = model.get_file(metadata['uid']) if not os.path.exists(file_path): logging.warning('Invalid path: %r', file_path) return None return ContentBundle(file_path) elif is_journal_bundle(metadata): -file_path = util.TempFilePath(model.get_file(metadata['uid'])) +file_path = model.get_file(metadata['uid']) if not os.path.exists(file_path): logging.warning('Invalid path: %r', file_path) return None -- 1.7.1 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] How to copy something from the Journal to a pendrive? FotoToon export?
Excerpts from tom.staub...@fhtw-berlin.de's message of Sun Oct 17 09:02:42 +0200 2010: Imagine two or more children. Half of them are in country1, the others are in country2. They would like to collaborate on an activity, e.g. FotoToon. One of the groups starts and adds a picture and some bubbles. Now they want to send their work to the other group so that they can add a picture and a couple of bubbles. This goes back and forth a couple of times. Re-reading your post again, it seems what you actually wanted to do was to save an activity _session_ (the content you worked on), not the activity itself (the program). This is still a bit of a sour spot. In order for the system to know what activity it needs to know either the activity it has been previously opened with or the MIME type (so it can select activities that are able to handle this type - that's what the Start with submenu shows). The Sugar data store can store metadata as arbitrary key=value pairs. Activities use this to set the activity id and the MIME type of the entry, so the Journal can resume an entry fine as long as it's in the data store and the metadata is preserved. External storage media (USB sticks, SD cards) are intended as a means to interchange data with non-Sugar systems, so we store entries as plain files instead of putting a data store on them (that no non-Sugar system would be able to read). And here we enter the messy world of traditional desktop systems: there is no place (*) to store metadata, especially not non-standard properties like the activity that wrote the entry. Not even the MIME type can be preserved properly; we need to rely on mappings between file extensions and MIME type. There's no single, central mapping (except for a few standard types) but rather each application ships a small part of the database with the MIME types and file extensions it cares about. If you don't have an application installed that recognises the file extension, you won't know the MIME type. The same technology is used in Sugar for reading files on external media. So if an activity wants to handle files of a certain MIME type, it needs to tell Sugar how to recognise the files (by shipping a suitable mimetypes.xml [1]). This is what some of the activities use to make the data store - USB stick - data store roundtrip work: They choose a custom MIME type and file extension. When copying files to the USB stick, the Journal will set the file extension based on the MIME type. When copying the entry back from the USB stick, the Journal will map the file extension back to the MIME type (if the activity is installed, i.e. if the mimetypes.xml is present). If the activity tells Sugar it can handle entries of this type (by setting mime_types in activity.info [2]), it will be used for opening (resuming) the entries. There is a way to transfer a data store entry including all of its metadata: Journal Entry Bundles [3]. Unfortunately the only way (that I know of) to _create_ such a bundle is my Backup activity [4] and it stores the entire data store instead of a single entry. It also uses a different MIME type and file extension (to make sure that these bundles are handled by the Restore activity [5] which can cope with JEBs containing multiple entries, unlike the Journal) but that would be easy enough to work around (by renaming the file). Thanks for following me through to the end. ;) Sascha (*) There are extended attributes [6], but they are only supported on some file systems (in particular not on VFAT, which is what all the USB sticks and SD cards come pre-formatted as) and need to be enabled explicitly (in /etc/fstab; no idea if it's possible to tell the Gnome auto mount magic to do it). Except for OS/2, Mac OS and a few special applications I don't know of anything that actually uses them for metadata (i.e. MIME type co). [1] https://wiki.sugarlabs.org/go/Development_Team/Almanac/Activity_Bundles#Bundle_structure [2] https://wiki.sugarlabs.org/go/Development_Team/Almanac/Activity_Bundles#.info_file_format [3] http://wiki.laptop.org/go/Journal_entry_bundles [4] http://activities.sugarlabs.org/en-US/sugar/addon/4326 [5] http://activities.sugarlabs.org/en-US/sugar/addon/4327 [6] http://en.wikipedia.org/wiki/Extended_attributes -- 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] multiple instances of activities
Hi, I think I encountered a bug in Sugar. Looks like it might be related to this one: http://dev.laptop.org/ticket/10153 The behavior was not connected to a single activity as I encountered it in Record, TamTamJam and Etoys. It was not intentionally reproducible but it happened quite often. Most of the time none of the instances got started properly. Record for example looked quite ok, but did not display a camera image. One of the icons in the frame kept pulsing and the instances could not be stopped. The XO had to be restarted. This happened on at least three different XO-1s all running Build 852, Sugar 0.84.16. I was able to take screenshots of the context menus of the doubled instances frame icons. They look quite interesting, you can find them here: http://www.flatlandfarm.de/blog/?p=36 I hope it helps, Cheers, Tom ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [ANNOUCE] Patches topic category was: [Systems] http[s]://lists.sugarlabs.org down
On Sun, Oct 17, 2010 at 3:46 AM, Sascha Silbe sascha-ml-reply-to-201...@silbe.org wrote: Excerpts from Bernie Innocenti's message of Sun Oct 17 01:50:15 +0200 2010: {...} I wanted to add a PATCH topic to sugar-devel so people like JT4Sugar can filter out the review traffic. Very nice idea. Done. How can I check whether it worked (other than subscribing from a second address)? I don't see anything regarding topics in /var/log/mailman/... Announcing this to the mailing list so those with existing topics set will not miss PATCH traffic. (The default seems to have set this to off. So anyone who has set topics to avoid, for example the buildbot notices, may adjust their settings.) From the settings page: (http://lists.sugarlabs.org/options/sugar-devel) Which topic categories would you like to subscribe to? By selecting one or more topics, you can filter the traffic on the mailing list, so as to receive only a subset of the messages. If a message matches one of your selected topics, then you will get the message, otherwise you will not. If a message does not match any topic, the delivery rule depends on the setting of the option below. If you do not select any topics of interest, you will get all the messages sent to the mailing list. Releases (Details)http://lists.sugarlabs.org/options/sugar-devel/fgr...@gmail.com/?VARHELP=Releases Announcements(Details)http://lists.sugarlabs.org/options/sugar-devel/fgr...@gmail.com/?VARHELP=Announcements Sugar on a Stick(Details)http://lists.sugarlabs.org/options/sugar-devel/fgr...@gmail.com/?VARHELP=Sugar+on+a+Stick Patches and patch reviews (Details)http://lists.sugarlabs.org/options/sugar-devel/fgr...@gmail.com/?VARHELP=Patches+and+patch+reviews Buildbot notices(Details)http://lists.sugarlabs.org/options/sugar-devel/fgr...@gmail.com/?VARHELP=Buildbot+notices Can you also add a topic for !PATCH? Some people may like it. I'm not sure that's a good idea. For one thing it doesn't play nice with how topic filters work. If someone wants to filter out patches (instead of receiving only patches), the way to achieve that is to check all other topics and the Do you want to receive messages that do not match any topic filter? option. The other question that comes up is whether mailman assigns messages to all matching topics or just the first one. I haven't found any answer to this when I searched for it some time ago. Since the admin interface let's you choose the insertion point for new topics, mailman probably matches just the first topic, so a !PATCH filter wouldn't work anyway. Sascha P.S.: The regular expression for ANNOUNCE has a misspelling. Name: Announcements Pattern (as regexp): \[ANNOUCE\] Description: Announcements important for developers and packagers, including: a new sucrose release, feature freeze, development cycle feature process, services outage, upcoming trac activities after a release, API changes. P.P.S.: The other expressions should be reviewed. Name: Patches and patch reviews Pattern (as regexp): \[[^]]*PATCH[^]]*\] Description: Name: Buildbot notices Pattern (as regexp): The Buildbot$ Description: Name: Sugar on a Stick Pattern (as regexp): \[SoaS\] Description: Any and all topics related to the Sugar on a Stick topic. Name: Releases Pattern (as regexp): \[RELEASE\] Description: Announcements of a release of a Sucrose component. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] How to copy something from the Journal to a pendrive? FotoToon export?
On Oct 17, 2010, at 1:54 PM, Sascha Silbe wrote: Excerpts from tom.staub...@fhtw-berlin.de's message of Sun Oct 17 09:02:42 +0200 2010: Imagine two or more children. Half of them are in country1, the others are in country2. They would like to collaborate on an activity, e.g. FotoToon. One of the groups starts and adds a picture and some bubbles. Now they want to send their work to the other group so that they can add a picture and a couple of bubbles. This goes back and forth a couple of times. Re-reading your post again, it seems what you actually wanted to do was to save an activity _session_ (the content you worked on), not the activity itself (the program). Exactly. This is still a bit of a sour spot. In order for the system to know what activity it needs to know either the activity it has been previously opened with or the MIME type (so it can select activities that are able to handle this type - that's what the Start with submenu shows). The Sugar data store can store metadata as arbitrary key=value pairs. Activities use this to set the activity id and the MIME type of the entry, so the Journal can resume an entry fine as long as it's in the data store and the metadata is preserved. External storage media (USB sticks, SD cards) are intended as a means to interchange data with non-Sugar systems, so we store entries as plain files instead of putting a data store on them (that no non-Sugar system would be able to read). And here we enter the messy world of traditional desktop systems: there is no place (*) to store metadata, especially not non-standard properties like the activity that wrote the entry. Not even the MIME type can be preserved properly; we need to rely on mappings between file extensions and MIME type. There's no single, central mapping (except for a few standard types) but rather each application ships a small part of the database with the MIME types and file extensions it cares about. If you don't have an application installed that recognises the file extension, you won't know the MIME type. So what would be the right medium to interchange data between Sugar systems? The same technology is used in Sugar for reading files on external media. So if an activity wants to handle files of a certain MIME type, it needs to tell Sugar how to recognise the files (by shipping a suitable mimetypes.xml [1]). This is what some of the activities use to make the data store - USB stick - data store roundtrip work: They choose a custom MIME type and file extension. When copying files to the USB stick, the Journal will set the file extension based on the MIME type. When copying the entry back from the USB stick, the Journal will map the file extension back to the MIME type (if the activity is installed, i.e. if the mimetypes.xml is present). If the activity tells Sugar it can handle entries of this type (by setting mime_types in activity.info [2]), it will be used for opening (resuming) the entries. Does this mean that in the FotoToon example I could manually add a mimetypes.xml to the .zip file, remove the zip extension and FotoToon should be able to recognize this again? There is a way to transfer a data store entry including all of its metadata: Journal Entry Bundles [3]. Unfortunately the only way (that I know of) to _create_ such a bundle is my Backup activity [4] and it stores the entire data store instead of a single entry. Would the copy-from-journal / copy-to-journal scripts do the trick? It also uses a different MIME type and file extension (to make sure that these bundles are handled by the Restore activity [5] which can cope with JEBs containing multiple entries, unlike the Journal) but that would be easy enough to work around (by renaming the file). But it would mean that if I'm doing a Backup on User1's XO and doing a Restore on User2's XO, User2's data is lost and she's got all the stuff from User1 in her journal, right? Thanks for following me through to the end. ;) Thanks for the detailed information. Sascha (*) There are extended attributes [6], but they are only supported on some file systems (in particular not on VFAT, which is what all the USB sticks and SD cards come pre-formatted as) and need to be enabled explicitly (in /etc/fstab; no idea if it's possible to tell the Gnome auto mount magic to do it). Except for OS/2, Mac OS and a few special applications I don't know of anything that actually uses them for metadata (i.e. MIME type co). [1] https://wiki.sugarlabs.org/go/Development_Team/Almanac/Activity_Bundles#Bundle_structure [2] https://wiki.sugarlabs.org/go/Development_Team/Almanac/Activity_Bundles#.info_file_format [3] http://wiki.laptop.org/go/Journal_entry_bundles [4] http://activities.sugarlabs.org/en-US/sugar/addon/4326 [5] http://activities.sugarlabs.org/en-US/sugar/addon/4327 [6] http://en.wikipedia.org/wiki/Extended_attributes --
Re: [Sugar-devel] [ANNOUCE] Patches topic category was: [Systems] http[s]://lists.sugarlabs.org down
Excerpts from Frederick Grose's message of Sun Oct 17 16:25:49 +0200 2010: P.S.: The regular expression for ANNOUNCE has a misspelling. Thanks for the reminder. I fixed it now. 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 v4 sugar] Disable Start menu item for entries that can't be opened(Bug#328)
The patch disables the Start and Start With menu items for files which can't be opened by any installed activity and instead replace it with a hover dropdown with a menu item 'No activity installed to start entry' --- src/jarabe/journal/palettes.py | 38 +++--- 1 files changed, 23 insertions(+), 15 deletions(-) v1-v2:Patch remade as per pep8 standards v2-v3:Revised English wording and optimised behaviour for bundles v3-v4:Revised English wordings diff --git a/src/jarabe/journal/palettes.py b/src/jarabe/journal/palettes.py index 7c3e5ff..5005655 100644 --- a/src/jarabe/journal/palettes.py +++ b/src/jarabe/journal/palettes.py @@ -62,22 +62,30 @@ class ObjectPalette(Palette): Palette.__init__(self, primary_text=title, icon=activity_icon) -if metadata.get('activity_id', ''): -resume_label = _('Resume') -resume_with_label = _('Resume with') -else: -resume_label = _('Start') -resume_with_label = _('Start with') -menu_item = MenuItem(resume_label, 'activity-start') -menu_item.connect('activate', self.__start_activate_cb) -self.menu.append(menu_item) -menu_item.show() +if misc.get_activities(metadata) or misc.is_bundle(metadata): +if metadata.get('activity_id', ''): +resume_label = _('Resume') +resume_with_label = _('Resume with') +else: +resume_label = _('Start') +resume_with_label = _('Start with') +menu_item = MenuItem(resume_label, 'activity-start') +menu_item.connect('activate', self.__start_activate_cb) +self.menu.append(menu_item) +menu_item.show() -menu_item = MenuItem(resume_with_label, 'activity-start') -self.menu.append(menu_item) -menu_item.show() -start_with_menu = StartWithMenu(self._metadata) -menu_item.set_submenu(start_with_menu) +menu_item = MenuItem(resume_with_label, 'activity-start') +self.menu.append(menu_item) +menu_item.show() +start_with_menu = StartWithMenu(self._metadata) +menu_item.set_submenu(start_with_menu) + +else: +resume_label = _('No activity to start entry') +menu_item = MenuItem(resume_label) +menu_item.set_sensitive(False) +self.menu.append(menu_item) +menu_item.show() client = gconf.client_get_default() color = XoColor(client.get_string('/desktop/sugar/user/color')) -- 1.7.0.4 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH v4 sugar] Disable Start menu item for entries that can't be opened(Bug#328)
The patch disables the Start and Start With menu items for files which can't be opened by any installed activity and instead replace it with a hover dropdown with a menu item 'No activity installed to start entry' --- src/jarabe/journal/palettes.py | 38 +++--- 1 files changed, 23 insertions(+), 15 deletions(-) v1-v2:Patch remade as per pep8 standards v2-v3:Revised English wording and optimised behaviour for bundles v3-v4:Revised English wordings diff --git a/src/jarabe/journal/palettes.py b/src/jarabe/journal/palettes.py index 7c3e5ff..5005655 100644 --- a/src/jarabe/journal/palettes.py +++ b/src/jarabe/journal/palettes.py @@ -62,22 +62,30 @@ class ObjectPalette(Palette): Palette.__init__(self, primary_text=title, icon=activity_icon) -if metadata.get('activity_id', ''): -resume_label = _('Resume') -resume_with_label = _('Resume with') -else: -resume_label = _('Start') -resume_with_label = _('Start with') -menu_item = MenuItem(resume_label, 'activity-start') -menu_item.connect('activate', self.__start_activate_cb) -self.menu.append(menu_item) -menu_item.show() +if misc.get_activities(metadata) or misc.is_bundle(metadata): +if metadata.get('activity_id', ''): +resume_label = _('Resume') +resume_with_label = _('Resume with') +else: +resume_label = _('Start') +resume_with_label = _('Start with') +menu_item = MenuItem(resume_label, 'activity-start') +menu_item.connect('activate', self.__start_activate_cb) +self.menu.append(menu_item) +menu_item.show() -menu_item = MenuItem(resume_with_label, 'activity-start') -self.menu.append(menu_item) -menu_item.show() -start_with_menu = StartWithMenu(self._metadata) -menu_item.set_submenu(start_with_menu) +menu_item = MenuItem(resume_with_label, 'activity-start') +self.menu.append(menu_item) +menu_item.show() +start_with_menu = StartWithMenu(self._metadata) +menu_item.set_submenu(start_with_menu) + +else: +resume_label = _('No activity to start entry') +menu_item = MenuItem(resume_label) +menu_item.set_sensitive(False) +self.menu.append(menu_item) +menu_item.show() client = gconf.client_get_default() color = XoColor(client.get_string('/desktop/sugar/user/color')) -- 1.7.0.4 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH v2] Free space displayed for Journal Button in Volumes Toolbar. (Ticket #2318)
Pallete added to calculate and display free journal space when we write click. --- src/jarabe/journal/volumestoolbar.py | 36 +- 1 files changed, 35 insertions(+), 1 deletions(-) v1-v2: pep8 errors corrected diff --git a/src/jarabe/journal/volumestoolbar.py b/src/jarabe/journal/volumestoolbar.py index 4208c17..76bf607 100644 --- a/src/jarabe/journal/volumestoolbar.py +++ b/src/jarabe/journal/volumestoolbar.py @@ -17,6 +17,7 @@ import logging import os from gettext import gettext as _ +import statvfs import gobject import gio @@ -26,6 +27,7 @@ import gconf from sugar.graphics.radiotoolbutton import RadioToolButton from sugar.graphics.palette import Palette from sugar.graphics.xocolor import XoColor +from sugar import env from jarabe.journal import model from jarabe.view.palettes import VolumePalette @@ -48,7 +50,6 @@ class VolumesToolbar(gtk.Toolbar): self._mount_removed_hid = None button = JournalButton() -button.set_palette(Palette(_('Journal'))) button.connect('toggled', self._button_toggled_cb) self.insert(button, 0) button.show() @@ -207,3 +208,36 @@ class JournalButton(BaseButton): color = XoColor(client.get_string('/desktop/sugar/user/color')) self.props.xo_color = color +def create_palette(self): +palette = JournalButtonPalette(self) +return palette + +class JournalButtonPalette(Palette): +def __init__(self, mount): +label = _('Journal') +Palette.__init__(self, label) + +vbox = gtk.VBox() +self.set_content(vbox) +vbox.show() + +self._progress_bar = gtk.ProgressBar() +vbox.add(self._progress_bar) +self._progress_bar.show() + +self._free_space_label = gtk.Label() +self._free_space_label.set_alignment(0.5, 0.5) +vbox.add(self._free_space_label) +self._free_space_label.show() + +self.connect('popup', self.__popup_cb) + +def __popup_cb(self, palette): +stat = os.statvfs(env.get_profile_path()) +free_space = stat[statvfs.F_BSIZE] * stat[statvfs.F_BAVAIL] +total_space = stat[statvfs.F_BSIZE] * stat[statvfs.F_BLOCKS] + +fraction = (total_space - free_space) / float(total_space) +self._progress_bar.props.fraction = fraction +self._free_space_label.props.label = _('%(free_space)d MB Free') % \ +{'free_space': free_space / (1024 * 1024)} -- 1.7.0.4 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [Dextrose] [PATCH v5 sugar] Pulsing icon delayed by 5 seconds or so SL#2080
Team I had submitted the patch for the http://bugs.sugarlabs.org/ticket/2080 You can check the patch at http://lists.sugarlabs.org/archive/sugar-devel/2010-October/027748.html Wish if you could review it and provide me feedback on any improvement required. Regards Anurag ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH v4 sugar] Shutdown (and Logout) menuitems should activate
We changed the cursor in home window to a busy cursor when the shutdown menu is activated and used glib.idle_add( ) to call the shut funtion when pygtk is idle to shutdown or logout the sugar session properly , hence letting the user know the validity of the shutdown process going on in the backend. --- src/jarabe/view/buddymenu.py | 26 -- 1 files changed, 20 insertions(+), 6 deletions(-) v1-v2 : Corrected the window of operation v2-v3 : Added the busycursor in the desktop window v3-v4 : Removed redundant function calls like glib.timeout_add() and gtk.main() diff --git a/src/jarabe/view/buddymenu.py b/src/jarabe/view/buddymenu.py index 0ba6cc1..78cdeb4 100644 --- a/src/jarabe/view/buddymenu.py +++ b/src/jarabe/view/buddymenu.py @@ -21,6 +21,8 @@ from gettext import gettext as _ import gtk import gconf import dbus +import glib +import jarabe from sugar.graphics.palette import Palette from sugar.graphics.menuitem import MenuItem @@ -98,16 +100,28 @@ class BuddyMenu(Palette): item.show() def __logout_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.logout() +def shut(self, menu_item): +session_manager = get_session_manager() +session_manager.logout() +window = jarabe.desktop.homewindow.get_instance() +window.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +glib.idle_add(shut,self,menu_item) def __reboot_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.reboot() +def shut(self, menu_item): +session_manager = get_session_manager() +session_manager.reboot() +window = jarabe.desktop.homewindow.get_instance() +window.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +glib.idle_add(shut,self,menu_item) def __shutdown_activate_cb(self, menu_item): -session_manager = get_session_manager() -session_manager.shutdown() +def shut(self, menu_item): +session_manager = get_session_manager() +session_manager.reboot() +window = jarabe.desktop.homewindow.get_instance() +window.get_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) +glib.idle_add(shut,self,menu_item) def __controlpanel_activate_cb(self, menu_item): panel = ControlPanel() -- 1.7.2.3 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v4 sugar] Shutdown (and Logout) menuitems should activate
Team I had submitted the patch for the http://bugs.sugarlabs.org/ticket/2151 You can check the patch at http://lists.sugarlabs.org/archive/sugar-devel/2010-October/027992.html Wish if you could review it and provide me feedback on any improvement required. Regards Anurag ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v4 sugar] Shutdown (and Logout) menuitems should activate
On Mon, 2010-10-18 at 01:11 +0530, Anurag Chowdhury wrote: I had submitted the patch for the http://bugs.sugarlabs.org/ticket/2151 You can check the patch at http://lists.sugarlabs.org/archive/sugar-devel/2010-October/027992.html Wish if you could review it and provide me feedback on any improvement required. There's no need to post a separate message asking for a review. All the people on cc are also subscribed to sugar-devel. When posting a patch, it is customary to send it to the maintainer(s) of the affected module and cc the mailing list. This can be done easily with git send-email with the --cc option. The cc list can also be augmented by adding a Cc: Name Lastname em...@domain line in the patch comment. -- // 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] Mailman's admin and archive interfaces are horrible - suggest GroupServer.org
I'm assuming the infrastructure team are part of this list. I would like to recommend that Sugar Labs considers migrating from mailman to GroupServer as its mailing list system[1]. I've been using GroupServer as a participant for over a year for lots of open government New Zealand activities [1]. I find the system is far superior to mailman and Google Groups lists. The archives are easily searchable, attached files are converted to links to the server so that people's inboxes are not flooded. The middleware seems to deal well with filtering out replied content. The best feature for me is that threaded conversations are together in a single page[3]. I welcome any feedback. I think that a migration like this will make the mailing lists far more accessible as a knowledge archive. I've been assured that there is a migration path from mailman[4]. From what I know of Dan, its lead developer, it should be fairly easy reliable. Tim [1] http://groupserver.org/groupserver/features/ [2] http://groups.open.org.nz/groups/ninja-talk/messages/topics.html [3] http://groups.open.org.nz/groups/ninja-talk/messages/topic/7ppGhESvF5ow9VeMlK1eZy [4] http://twitter.com/danrandow/status/27676366090 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] Record activity. Adjusting the input level.
Hi Tom, On 4 Oct 2010, at 12:28, tom.staub...@fhtw-berlin.de tom.staub...@fhtw-berlin.de wrote: Hi, is there a way to adjust the input level of audio recordings in Record, according to the volume of the sound source? I read every piece of documentation I found[1][2]. It does not look as if this is supported? I just read your blog post on hooking up two XOs with a mic lead so that one can play and the other record. You mentioned needing to adjust the output volume by trial and error to not distortion — have you tried running the Measure activity? I think you should see the line-in input waveform so you can check for clipping (sorry can't test, only have one XO with me here at the moment). Regards, --Gary Thanks for your help, Tom Staubitz [1] http://activities.sugarlabs.org/en-US/sugar/addon/4081 [2] http://wiki.laptop.org/go/Record ___ 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] How to copy something from the Journal to a pendrive? FotoToon export?
Hi Tom. I am working in a functionality to save the work in the Fototoon activity like a image. I didn't know the information about the custom mime types. (Thanks Sascha!) . I will try to add that info in the next version. Thanks for the detailed report. Gonzalo On Sun, Oct 17, 2010 at 3:02 AM, tom.staub...@fhtw-berlin.de tom.staub...@fhtw-berlin.de wrote: Hi, I've been trying for while now to copy journal entries to a usb stick. This works fine as long as files are concerned, e.g. Pics or Audio recordings taken with Record. It does not work if I try to copy an activity from the journal to the usb stick. No matter if I'm using the menu in the details view or drag and drop. The behavior is always the same: it appears to work, the little copy icon appears etc. but in the end the copied file is not on the stick. I've tried two different sticks, both have been recently formatted. Why would I want to copy an activity to a usb stick? Imagine two or more children. Half of them are in country1, the others are in country2. They would like to collaborate on an activity, e.g. FotoToon. One of the groups starts and adds a picture and some bubbles. Now they want to send their work to the other group so that they can add a picture and a couple of bubbles. This goes back and forth a couple of times. I actually managed somehow to store the FotoToon activity as a zip file. This zip contains the images and a .json file describing the bubbles. Unfortunately FotoToon does not seem to be able to open this zip file. More or less the same happens when I attach the activity to an email. If I rename the file to xxx.zip I can open it and there are the images and the json file. I cannot open it with FotoToon. If I do not rename the activity and try to start it it will open Etoys. Another problem is how to save the final story into a format that e.g. can be published on a website? FotoToon is just one example that the results that have been achieved while working with one activity cannot be used to be edited in another activity. I have the same problem with, amongst others, TamTamJam or Paint. Is it really not possible or am I missing something? Thanks a lot for your help, Tom On Aug 3, 2010, at 1:55 PM, Bernie Innocenti wrote: On Tue, 2010-08-03 at 09:11 +0200, Tomeu Vizoso wrote: How much effort would it be to add such an copy-to-USB option to the Journal hover palette? Is this something I could do with the help of my knowledgable flatmate Mr. Innocenti? Yep, shouldn't be hard nor a lot of code. As we're there, we might want to add a progress display for long copy operations. Currently, if you drop a large file on the journal icon, the UI freezes for a long time with no indication of progress, tempting the user to perform a hard reboot (and thus corrupting the datastore :-). If nobody has time to implement a nice progress bar, at least we could put on the busy cursor (which is animated in our cursor theme, iirc). The copy could probably be made fully asynchronous, but with no progress indication, there's a potential for users to extract USB sticks before the operation is finished. -- // 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 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] multiple instances of activities
On Sun, Oct 17, 2010 at 02:15:47PM +0200, tom.staub...@fhtw-berlin.de wrote: The behavior was not connected to a single activity as I encountered it in Record, TamTamJam and Etoys. It was not intentionally reproducible but it happened quite often. Most of the time none of the instances got started properly. Record for example looked quite ok, but did not display a camera image. One of the icons in the frame kept pulsing and the instances could not be stopped. The XO had to be restarted. This happened on at least three different XO-1s all running Build 852, Sugar 0.84.16. This sounds like http://dev.laptop.org/ticket/10016 also recorded as http://bugs.sugarlabs.org/ticket/1719 for which a patch is available. Could you please try the patch? You can find it in #10016. -- 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 00/21 sugar-toolkit] style cleanup series
Reviewed-by: James Cameron qu...@laptop.org -- 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 sugar-base 00/17] style cleanup series
Reviewed-by: James Cameron qu...@laptop.org -- 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 sugar 09/21] style cleanup: prefer ' for strings
On Sun, Oct 17, 2010 at 12:20:11AM +0200, Sascha Silbe wrote: diff --git a/src/jarabe/util/emulator.py b/src/jarabe/util/emulator.py index 4c9ca8e..12277df 100644 --- a/src/jarabe/util/emulator.py +++ b/src/jarabe/util/emulator.py @@ -129,7 +129,7 @@ def _setup_env(display, scaling, emulator_pid): env.get_profile_path(), 'logs', 'mission-control.log') os.environ['STREAM_ENGINE_LOGFILE'] = os.path.join( env.get_profile_path(), 'logs', 'telepathy-stream-engine.log') -os.environ['DISPLAY'] = :%d % (display) +os.environ['DISPLAY'] = ':%d' % (display, ) os.environ['SUGAR_EMULATOR_PID'] = emulator_pid os.environ['MC_ACCOUNT_DIR'] = os.path.join( env.get_profile_path(), 'accounts') /me raises eyebrow ... wasn't done in extensions/deviceicon/network.py GsmPalette.update_stats(). -- 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 v2 Paint] Changes made to save the last added text item. (OLPC #5917)
On Sun, Oct 17, 2010 at 02:17:17PM +0530, Ishan Bansal wrote: New variable text_status defined which could keep the track of the status of text being entered and save it when activity is stopped. What you do not say in this commit comment is how you have implemented the change. Having reviewed your code change, I see you are forcing the text entry to complete if the mouse leaves the drawing area while a text entry is in progress. In detail: 1. when the instance of the drawing area is created, you set your state variable to -1, 2. when a mouse down event occurs with the text tool selected, you set your state variable to 0, representing text entry in progress, 3. when the mouse moves with the text entry in progress, you set your state variable to 1, representing a mouse movement in progress during text entry, 4. when the mouse leaves the drawing area with the state variable set to 1, you attempt to complete the drawing of the text. Problems with this design: a. the text entry will be prematurely terminated if the user moves the mouse outside the drawing entry, which will be unexpected and annoying, b. the mouse does not move if the Ctrl/Q shortcut is used, therefore this code will not trigger, c. when system load is high, it is possible for a mouse leave event to arrive before a mouse move event, and so this code may not trigger. Signed-off-by: Ishan Bansalis...@seeta.in, Anubhav Aggarwalanub...@seeta.in There should be a space before --- Area.py | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) v1-v2: Patch updated diff --git a/Area.py b/Area.py index 2dca7da..a2db51b 100644 --- a/Area.py +++ b/Area.py @@ -113,6 +113,8 @@ class Area(gtk.DrawingArea): self.connect(leave_notify_event, self.mouseleave) self.connect(enter_notify_event, self.mouseenter) +self.text_status = -1 + Given my comments at the top of this message, you may not need to use the following comments if you abandon the design ... Please use a more appropriate variable name. text_status doesn't tell me anything about what it is for. pending_text_state may be more useful. You are using -1 to mean initialised, 0 to mean disarmed, and 1 to mean armed. These constants are used throughout your patch without further explanation. If you still need a state variable, please define constants, such as: PENDING_TEXT_STATE_RESET = -1 PENDING_TEXT_STATE_DISARMED = 0 PENDING_TEXT_STATE_ARMED = 1 The -1 state does not seem to be needed. target = [('text/uri-list', 0, TARGET_URI)] self.drag_dest_set(gtk.DEST_DEFAULT_ALL, target, gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE) @@ -303,6 +305,7 @@ class Area(gtk.DrawingArea): # text if self.tool['name'] == 'text': self.d.text(widget,event) +self.text_status = 0 # This fixes a bug that made the text viewer get stuck in the canvas elif self.estadoTexto is 1: (the above is in the mouse down event handler) @@ -473,6 +476,10 @@ class Area(gtk.DrawingArea): self.configure_line(self.line_size) self.d.polygon(widget,coords,True,self.tool['fill'],moving) +if self.tool['name'] == 'text': + if self.text_status == 0: + self.text_status = 1 + gtk.gdk.event_request_motions (event) def mouseup(self,widget,event): (the above is in the mouse move event handler) @@ -571,6 +578,10 @@ class Area(gtk.DrawingArea): size = self.tool['line size'] widget.queue_draw_area(self.x_cursor-size, self.y_cursor-size, size*2, size*2) +if self.tool['name'] == 'text': + if self.text_status == 1: +self.d.text(widget,event) + def mouseenter(self, widget, event): if self.tool['name'] in ['pencil','eraser','brush','rainbow']: self.drawing = False (the above is in the mouse leave event handler) -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel