Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnish Mangal <anish@sugarlabs.org>2011-01-11 23:49:34 (GMT)
committer Anish Mangal <anish@sugarlabs.org>2011-01-11 23:49:34 (GMT)
commit5c3b58279011b320186d0ad03b22404119785821 (patch)
tree6fdd076b0ec070f0ee83b14ec4789ba650cb5fb3
parent0c4e7938b3e63db44452c940918fee1a78c4a839 (diff)
Additions and changes to 'sugar' 0.88.1-5.43
* Update microformat compatible activity updater patch * #2164 downgrading activities not allowed * Optional NamingAlert while closing activities (gconf key) * Globalkey for touchpad device icon (alt+m) * Update sugar.spec to include above changes
-rw-r--r--rpms/sugar/add__show_naming_alert__gconf_key.patch36
-rw-r--r--rpms/sugar/downgrading_activities_not_allowed_2164.patch218
-rw-r--r--rpms/sugar/globalkey_for_touchpad_device_icon.patch196
-rw-r--r--rpms/sugar/microformat-updater.patch623
-rw-r--r--rpms/sugar/sugar.spec26
5 files changed, 999 insertions, 100 deletions
diff --git a/rpms/sugar/add__show_naming_alert__gconf_key.patch b/rpms/sugar/add__show_naming_alert__gconf_key.patch
new file mode 100644
index 0000000..26c024b
--- /dev/null
+++ b/rpms/sugar/add__show_naming_alert__gconf_key.patch
@@ -0,0 +1,36 @@
+From 531872ade1768b3e0afda6b8d14daf7a11df38e9 Mon Sep 17 00:00:00 2001
+From: Martin Abente <martin.abente.lahaye@gmail.org>
+Date: Tue, 2 Nov 2010 18:54:16 -0300
+Subject: [PATCH] S non-intrusive NamingAlert
+
+Add a new gconf value to the scheme to determine when
+or not to show NamingAlert when an activities close.
+---
+ data/sugar.schemas.in | 12 ++++++++++++
+ 1 files changed, 12 insertions(+), 0 deletions(-)
+
+diff --git a/data/sugar.schemas.in b/data/sugar.schemas.in
+index a0104e7..0deedc2 100644
+--- a/data/sugar.schemas.in
++++ b/data/sugar.schemas.in
+@@ -364,5 +364,17 @@
+ it starts, it does autoconnect to an Ad-hoc network.</long>
+ </locale>
+ </schema>
++ <schema>
++ <key>/schemas/desktop/sugar/show_naming_alert</key>
++ <applyto>/desktop/sugar/show_naming_alert</applyto>
++ <owner>sugar</owner>
++ <type>bool</type>
++ <default>false</default>
++ <locale name="C">
++ <short>Show NamingAlert</short>
++ <long>If TRUE, NamingAlert will popup when
++ the activity closes.</long>
++ </locale>
++ </schema>
+ </schemalist>
+ </gconfschemafile>
+--
+1.7.1
+
diff --git a/rpms/sugar/downgrading_activities_not_allowed_2164.patch b/rpms/sugar/downgrading_activities_not_allowed_2164.patch
new file mode 100644
index 0000000..f47392c
--- /dev/null
+++ b/rpms/sugar/downgrading_activities_not_allowed_2164.patch
@@ -0,0 +1,218 @@
+From patchwork Tue Dec 14 12:29:14 2010
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: Downgrading activities not allowed. (SL #2164)
+Date: Tue, 14 Dec 2010 17:29:14 -0000
+From: Martin Abente <martin.abente.lahaye@gmail.com>
+X-Patchwork-Id: 525
+Message-Id: <1292329754-21827-1-git-send-email-martin.abente.lahaye@gmail.com>
+To: dextrose@lists.sugarlabs.org,
+ smparrish@gmail.com
+
+From: shanjit@seeta.in <shanjit@seeta.in>
+
+Activity can be downgraded on the availability of an older .xo version of an
+activity. An alert pops up when trying to install an older .xo file of an
+activity, which asks the user to make a selection on whether to move to an
+older activity version or not.
+
+Co-authored-by: Shanjit Singh Jajmann <shanjit@seeta.in>
+Co-authored-by: Anubhav Aggarwal <anubhav@seeta.in>
+Dextrose backport by: Martin Abente <tch@activitycentral.com>
+
+---
+src/jarabe/journal/Makefile.am | 1 +
+ src/jarabe/journal/journalactivity.py | 5 ++-
+ src/jarabe/journal/journalwindow.py | 34 +++++++++++++++++++++++
+ src/jarabe/journal/misc.py | 47 ++++++++++++++++++++++++++------
+ src/jarabe/model/bundleregistry.py | 7 +++-
+ 5 files changed, 81 insertions(+), 13 deletions(-)
+ create mode 100644 src/jarabe/journal/journalwindow.py
+
+diff --git a/src/jarabe/journal/Makefile.am b/src/jarabe/journal/Makefile.am
+index a760869..f24dcfe 100644
+--- a/src/jarabe/journal/Makefile.am
++++ b/src/jarabe/journal/Makefile.am
+@@ -6,6 +6,7 @@ sugar_PYTHON = \
+ journalactivity.py \
+ journalentrybundle.py \
+ journaltoolbox.py \
++ journalwindow.py \
+ keepicon.py \
+ listmodel.py \
+ listview.py \
+diff --git a/src/jarabe/journal/journalactivity.py b/src/jarabe/journal/journalactivity.py
+index eab292b..52a677e 100644
+--- a/src/jarabe/journal/journalactivity.py
++++ b/src/jarabe/journal/journalactivity.py
+@@ -45,6 +45,7 @@ from jarabe.journal.journalentrybundle import JournalEntryBundle
+ from jarabe.journal.objectchooser import ObjectChooser
+ from jarabe.journal.modalalert import ModalAlert
+ from jarabe.journal import model
++from jarabe.journal.journalwindow import JournalWindow
+
+ J_DBUS_SERVICE = 'org.laptop.Journal'
+ J_DBUS_INTERFACE = 'org.laptop.Journal'
+@@ -103,10 +104,10 @@ class JournalActivityDBusService(dbus.service.Object):
+ def ObjectChooserCancelled(self, chooser_id):
+ pass
+
+-class JournalActivity(Window):
++class JournalActivity(JournalWindow):
+ def __init__(self):
+ logging.debug("STARTUP: Loading the journal")
+- Window.__init__(self)
++ JournalWindow.__init__(self)
+
+ self.set_title(_('Journal'))
+
+diff --git a/src/jarabe/journal/journalwindow.py b/src/jarabe/journal/journalwindow.py
+new file mode 100644
+index 0000000..3c718c2
+--- /dev/null
++++ b/src/jarabe/journal/journalwindow.py
+@@ -0,0 +1,34 @@
++#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 sugar.graphics.window import Window
++
++_journal_window = None
++
++
++class JournalWindow(Window):
++
++ def __init__(self):
++
++ global _journal_window
++ Window.__init__(self)
++ _journal_window = self
++
++
++def get_journal_window():
++ return _journal_window
+diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py
+index 6e3cb95..ec1f53d 100644
+--- a/src/jarabe/journal/misc.py
++++ b/src/jarabe/journal/misc.py
+@@ -28,8 +28,10 @@ from sugar.activity import activityfactory
+ from sugar.activity.activityhandle import ActivityHandle
+ from sugar.graphics.icon import get_icon_file_name
+ from sugar.graphics.xocolor import XoColor
++from sugar.graphics.alert import ConfirmationAlert
+ from sugar import mime
+ from sugar.bundle.activitybundle import ActivityBundle
++from sugar.bundle.bundle import AlreadyInstalledException
+ from sugar.bundle.contentbundle import ContentBundle
+ from sugar import util
+
+@@ -37,6 +39,7 @@ 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 import journalwindow
+
+ def _get_icon_for_mime(mime_type):
+ generic_types = mime.get_all_generic_types()
+@@ -160,19 +163,16 @@ 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:
++ _downgrade_option_alert(bundle)
++ return
+ 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:
+- activityfactory.create(installed_bundle)
+- else:
+- logging.error('Bundle %r is not installed.',
+- bundle.get_bundle_id())
++ _launch_bundle(bundle)
+
+ elif is_content_bundle(metadata) and bundle_id is None:
+
+@@ -229,6 +229,35 @@ def resume(metadata, bundle_id=None):
+ else:
+ activityfactory.create_with_object_id(bundle, object_id)
+
++def _launch_bundle(bundle):
++ registry = bundleregistry.get_registry()
++ logging.debug('activityfactory.creating bundle with id %r',
++ bundle.get_bundle_id())
++ installed_bundle = registry.get_bundle(bundle.get_bundle_id())
++ if installed_bundle:
++ activityfactory.create(installed_bundle)
++ else:
++ logging.error('Bundle %r is not installed.',
++ bundle.get_bundle_id())
++
++def _downgrade_option_alert(bundle):
++ alert = ConfirmationAlert()
++ alert.props.title = _('Older Version Of %s Activity') % (bundle.get_name())
++ alert.props.msg = _('Do you want to downgrade to version %s') % \
++ bundle.get_activity_version()
++ alert.connect('response', _downgrade_alert_response_cb, bundle)
++ journalwindow.get_journal_window().add_alert(alert)
++ alert.show()
++
++def _downgrade_alert_response_cb(alert, response_id, bundle):
++ if response_id is gtk.RESPONSE_OK:
++ journalwindow.get_journal_window().remove_alert(alert)
++ registry = bundleregistry.get_registry()
++ registry.install(bundle, force_downgrade=True)
++ _launch_bundle(bundle)
++ elif response_id is gtk.RESPONSE_CANCEL:
++ journalwindow.get_journal_window().remove_alert(alert)
++
+ def is_activity_bundle(metadata):
+ mime_type = metadata.get('mime_type', '')
+ return mime_type == ActivityBundle.MIME_TYPE or \
+diff --git a/src/jarabe/model/bundleregistry.py b/src/jarabe/model/bundleregistry.py
+index 090dddc..f2c2a52 100644
+--- a/src/jarabe/model/bundleregistry.py
++++ b/src/jarabe/model/bundleregistry.py
+@@ -376,14 +376,17 @@ class BundleRegistry(gobject.GObject):
+ return True
+ return False
+
+- def install(self, bundle, uid=None):
++ def install(self, bundle, uid=None, force_downgrade=False):
+ activities_path = env.get_user_activities_path()
+
+ for installed_bundle in self._bundles:
+ if bundle.get_bundle_id() == installed_bundle.get_bundle_id() and \
+ bundle.get_activity_version() <= \
+ installed_bundle.get_activity_version():
+- raise AlreadyInstalledException
++ if not force_downgrade:
++ raise AlreadyInstalledException
++ else:
++ self.uninstall(installed_bundle, force=True)
+ elif bundle.get_bundle_id() == installed_bundle.get_bundle_id():
+ self.uninstall(installed_bundle, force=True)
+
diff --git a/rpms/sugar/globalkey_for_touchpad_device_icon.patch b/rpms/sugar/globalkey_for_touchpad_device_icon.patch
new file mode 100644
index 0000000..c589f4a
--- /dev/null
+++ b/rpms/sugar/globalkey_for_touchpad_device_icon.patch
@@ -0,0 +1,196 @@
+From dextrose-bounces@lists.sugarlabs.org Wed Nov 3 14:27:55 2010
+Delivered-To: anishmangal2002@gmail.com
+Received: by 10.216.168.205 with SMTP id k55cs46758wel; Wed, 3 Nov 2010
+ 14:27:55 -0700 (PDT)
+Received: by 10.224.191.65 with SMTP id dl1mr11450667qab.174.1288819675105;
+ Wed, 03 Nov 2010 14:27:55 -0700 (PDT)
+Return-Path: <dextrose-bounces@lists.sugarlabs.org>
+Received: from sunjammer.sugarlabs.org (sunjammer.sugarlabs.org
+ [140.186.70.53]) by mx.google.com with ESMTP id
+ t30si15645984qcs.3.2010.11.03.14.27.54; Wed, 03 Nov 2010 14:27:55 -0700
+ (PDT)
+Received-SPF: pass (google.com: domain of
+ dextrose-bounces@lists.sugarlabs.org designates 140.186.70.53 as permitted
+ sender) client-ip=140.186.70.53;
+Authentication-Results: mx.google.com; spf=pass (google.com: domain of
+ dextrose-bounces@lists.sugarlabs.org designates 140.186.70.53 as permitted
+ sender) smtp.mail=dextrose-bounces@lists.sugarlabs.org; dkim=neutral (body
+ hash did not verify) header.i=@gmail.com
+Received: by sunjammer.sugarlabs.org (Postfix) id 4ABA21205AF; Wed, 3 Nov
+ 2010 17:27:54 -0400 (EDT)
+Delivered-To: anish@sugarlabs.org
+Received: from sunjammer.sugarlabs.org (localhost [127.0.0.1]) by
+ sunjammer.sugarlabs.org (Postfix) with ESMTP id 1E83712043C; Wed, 3 Nov
+ 2010 17:27:54 -0400 (EDT)
+Authentication-Results: sunjammer.sugarlabs.org; dkim=neutral (verification
+ failed; insecure key) header.i=@gmail.com; dkim-adsp=none (insecure policy)
+Received: from mail-gw0-f42.google.com (mail-gw0-f42.google.com
+ [74.125.83.42]) by sunjammer.sugarlabs.org (Postfix) with ESMTP id
+ 94CA712043C for <dextrose@lists.sugarlabs.org>; Wed, 3 Nov 2010 17:27:52
+ -0400 (EDT)
+Received: by gwb17 with SMTP id 17so931486gwb.29 for
+ <dextrose@lists.sugarlabs.org>; Wed, 03 Nov 2010 14:27:52 -0700 (PDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
+ h=domainkey-signature:received:received:from:to:cc:subject:date
+ :message-id:x-mailer; bh=BV00qN+MDDt7Bs2LHIwmw9rRaMdJU061L01ICw50Qew=;
+ b=tfDvlbqucCZCCQK0taNoH4Gz8CTU5SkW4KNPUN22IY7jssBYZ4d83K1ntmuXzLDjdG
+ zrlqAGRNPyAXUmAD/lY7AATjdq5JBrehgP9haVPZ2tpiQFUgurpqQT29cjiUi0E/j96Y
+ noNDTsKDa/XqYr+UT30NY5Hv1Vad2Hia+Foa8=
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
+ h=from:to:cc:subject:date:message-id:x-mailer;
+ b=J+5puHN7hjjACcp22I8JVl+EyYh2rpQvrsrEozaXvBRkANx3LrauWjyYe7ecAj5wsc
+ n0JUafLK7JnfzV+vCPxgYkiAfKmcuQjZjNkZM8P35xagUojmv+5QPuFOur9kSPmm7UG5
+ SGPUL8OEkb/HZsyAhKViY+IKibFVQnanzlPvQ=
+Received: by 10.90.8.24 with SMTP id 24mr97947agh.76.1288819671086; Wed, 03
+ Nov 2010 14:27:51 -0700 (PDT)
+Received: from localhost.localdomain ([186.17.48.78]) by mx.google.com with
+ ESMTPS id x45sm7518045yhc.45.2010.11.03.14.27.42 (version=TLSv1/SSLv3
+ cipher=RC4-MD5); Wed, 03 Nov 2010 14:27:50 -0700 (PDT)
+From: Martin Abente <martin.abente.lahaye@gmail.com>
+To: dextrose@lists.sugarlabs.org, bernie@codewiz.org, smparrish@gmail.com
+Date: Wed, 3 Nov 2010 18:27:30 -0300
+Message-Id: <1288819650-4955-1-git-send-email-martin.abente.lahaye@gmail.org>
+X-Mailer: git-send-email 1.7.1
+X-Spam-Status: No, score=0.0 required=3.5 tests=FREEMAIL_FROM,
+ RCVD_IN_DNSWL_NONE,SPF_PASS,T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL
+ autolearn=unavailable version=3.3.1
+X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
+ sunjammer.sugarlabs.org
+Cc: Martin Abente <martin.abente.lahaye@gmail.org>
+Subject: [Dextrose] [PATCH] Globalkey for touchpad device icon
+X-BeenThere: dextrose@lists.sugarlabs.org
+X-Mailman-Version: 2.1.13
+Precedence: list
+List-Id: Development list for the Dextrose OLPC OS
+ <dextrose.lists.sugarlabs.org>
+List-Unsubscribe: <http://lists.sugarlabs.org/options/dextrose>,
+ <mailto:dextrose-request@lists.sugarlabs.org?subject=unsubscribe>
+List-Archive: <http://lists.sugarlabs.org/archive/dextrose>
+List-Post: <mailto:dextrose@lists.sugarlabs.org>
+List-Help: <mailto:dextrose-request@lists.sugarlabs.org?subject=help>
+List-Subscribe: <http://lists.sugarlabs.org/listinfo/dextrose>,
+ <mailto:dextrose-request@lists.sugarlabs.org?subject=subscribe>
+MIME-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
+Sender: dextrose-bounces@lists.sugarlabs.org
+Errors-To: dextrose-bounces@lists.sugarlabs.org
+X-Evolution-Source: imap://anishmangal2002@imap.gmail.com/
+Content-Transfer-Encoding: 8bit
+
+Add a new keyboard shortcut as a globalkey, this will
+toggle the touchpad mode when <Alt + m> is pressed.
+
+Also change DeviceView.palette indentifier for
+DeviceView._palette. Palette was not showing
+because of that.
+
+Dextrose version
+
+---
+ extensions/deviceicon/touchpad.py | 14 +++++++++-----
+ extensions/globalkey/Makefile.am | 1 +
+ extensions/globalkey/touchpad.py | 33 +++++++++++++++++++++++++++++++++
+ 3 files changed, 43 insertions(+), 5 deletions(-)
+ create mode 100644 extensions/globalkey/touchpad.py
+
+diff --git a/extensions/deviceicon/touchpad.py b/extensions/deviceicon/touchpad.py
+index 7f3ecb5..357bdd6 100644
+--- a/extensions/deviceicon/touchpad.py
++++ b/extensions/deviceicon/touchpad.py
+@@ -37,6 +37,8 @@ FLAG_PATH = '/home/olpc/.olpc-pentablet-mode'
+ # NODE_PATH is used to communicate with the touchpad device.
+ NODE_PATH = '/sys/devices/platform/i8042/serio1/ptmode'
+
++_view = None
++
+ class DeviceView(TrayIcon):
+ """ Manage the touchpad mode from the device palette on the Frame. """
+
+@@ -55,13 +57,13 @@ class DeviceView(TrayIcon):
+
+ def create_palette(self):
+ """ On create, set the current mode. """
+- self.palette = ResourcePalette(_('My touchpad'), self.icon)
+- self.palette.set_group_id('frame')
+- return self.palette
++ self._palette = ResourcePalette(_('My touchpad'), self.icon)
++ self._palette.set_group_id('frame')
++ return self._palette
+
+ def __button_release_event_cb(self, widget, event):
+ """ On button release, switch modes. """
+- self.palette.toggle_mode()
++ self._palette.toggle_mode()
+ return True
+
+
+@@ -100,8 +102,10 @@ class ResourcePalette(Palette):
+
+ def setup(tray):
+ """ Touchpad palette only appears when the device exisits. """
++ global _view
+ if os.path.exists(NODE_PATH):
+- tray.add_device(DeviceView())
++ _view = DeviceView()
++ tray.add_device(_view)
+
+
+ def read_touchpad_mode():
+diff --git a/extensions/globalkey/Makefile.am b/extensions/globalkey/Makefile.am
+index b44626e..e3aaa8a 100644
+--- a/extensions/globalkey/Makefile.am
++++ b/extensions/globalkey/Makefile.am
+@@ -4,5 +4,6 @@ sugar_PYTHON = \
+ __init__.py \
+ magnifier.py \
+ screenshot.py \
++ touchpad.py \
+ viewsource.py \
+ virtualkeyboard.py
+diff --git a/extensions/globalkey/touchpad.py b/extensions/globalkey/touchpad.py
+new file mode 100644
+index 0000000..e36cf80
+--- /dev/null
++++ b/extensions/globalkey/touchpad.py
+@@ -0,0 +1,33 @@
++# Copyright (C) 2010, Martin Abente
++#
++# 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 logging
++
++BOUND_KEYS = ['<alt>m']
++touchpad = None
++
++def handle_key_press(key):
++ global touchpad
++ if touchpad is None:
++ try:
++ touchpad = __import__('deviceicon.touchpad', globals(),
++ locals(), ['touchpad'])
++ except Exception:
++ logging.error('Could not import touchpad module.')
++ return
++
++ if touchpad._view is not None:
++ touchpad._view._palette.toggle_mode()
+--
+1.7.1
+
+_______________________________________________
+Dextrose mailing list
+Dextrose@lists.sugarlabs.org
+http://lists.sugarlabs.org/listinfo/dextrose
+
diff --git a/rpms/sugar/microformat-updater.patch b/rpms/sugar/microformat-updater.patch
index a97d747..c7b64b3 100644
--- a/rpms/sugar/microformat-updater.patch
+++ b/rpms/sugar/microformat-updater.patch
@@ -1,26 +1,258 @@
-From: anishmangal2002 <anishmangal2002@gmail.com>
-To: Bernie Innocenti <bernie@codewiz.org>, tch@sugarlabs.org
-Date: Mon, 9 Aug 2010 21:48:03 +0530
-Cc: anishmangal2002 <anishmangal2002@gmail.com>,
- dextrose@lists.sugarlabs.org
-Subject: [Dextrose] [PATCH] Add microformat support to updater.
+From 73ba610100318bec85c6ca992f6f9cb071c129e0 Mon Sep 17 00:00:00 2001
+From: Anish Mangal <anish@sugarlabs.org>
+Date: Mon, 10 Jan 2011 22:36:03 -0300
+Subject: [PATCH] Replace activity updater with microformat compatible one
+Organization: Sugar Labs Foundation
+This patch replaces the Sugar activity updater with one, that supports
+activity microformats.
-Signed-off-by: anishmangal2002 <anishmangal2002@gmail.com>
++ The updater now allows installation of new activities which were not
+previously installed.
+
++ The updater uses the optional olpc-activity-name and
+olpc-activity-size
+tags.
+
+ - If olpc-activity-name is not present, the activity name is derived
+ from the bundle id. For example, org.Sugarlabs.RecordActivity
+ will be listed as Record.
+
+ - If olpc-activity-size is not present, an additional
+ http request is made to ascertain the size of the
+ bundle.
+
++ If the size returned as zero, the bundle is removed from the list of
+ those which may be updated.
+
++ To install new bundles, a metabundle class has been created, which
+acts as an empty structure.
+
+Co-Authored by Anish Mangal <anish@sugarlabs.org>
+Co-Authored by Akash Gangil <akashg1611@gmail.com>
+
+Signed-off-by: Anish Mangal <anish@sugarlabs.org>
---
- .../cpsection/updater/backends/microformat.py | 125 ++++++++++++++++++++
- extensions/cpsection/updater/model.py | 13 +-
- 2 files changed, 131 insertions(+), 7 deletions(-)
+ data/sugar.schemas.in | 12 ++
+ extensions/cpsection/updater/backends/Makefile.am | 2 +-
+ extensions/cpsection/updater/backends/aslo.py | 161 ----------------
+ .../cpsection/updater/backends/microformat.py | 203 ++++++++++++++++++++
+ extensions/cpsection/updater/model.py | 83 ++++++---
+ extensions/cpsection/updater/view.py | 18 ++-
+ 6 files changed, 285 insertions(+), 194 deletions(-)
+ delete mode 100644 extensions/cpsection/updater/backends/aslo.py
create mode 100644 extensions/cpsection/updater/backends/microformat.py
+diff --git a/data/sugar.schemas.in b/data/sugar.schemas.in
+index b9606ba..834fe2f 100644
+--- a/data/sugar.schemas.in
++++ b/data/sugar.schemas.in
+@@ -62,6 +62,18 @@
+ </schema>
+
+ <schema>
++ <key>/schemas/desktop/sugar/updater_url</key>
++ <applyto>/desktop/sugar/updater_url</applyto>
++ <owner>sugar</owner>
++ <type>string</type>
++ <default>http://activities-testing.sugarlabs.org/services/micro-format.php?collection_nickname=fructose</default>
++ <locale name="C">
++ <short>Activity updater URL.</short>
++ <long>This key contains the url which the microformat compatible activity updater will search for activity updates.</long>
++ </locale>
++ </schema>
++
++ <schema>
+ <key>/schemas/desktop/sugar/backup_url</key>
+ <applyto>/desktop/sugar/backup_url</applyto>
+ <owner>sugar</owner>
+diff --git a/extensions/cpsection/updater/backends/Makefile.am b/extensions/cpsection/updater/backends/Makefile.am
+index e280a07..e9c1284 100644
+--- a/extensions/cpsection/updater/backends/Makefile.am
++++ b/extensions/cpsection/updater/backends/Makefile.am
+@@ -1,5 +1,5 @@
+ sugardir = $(pkgdatadir)/extensions/cpsection/updater/backends
+
+ sugar_PYTHON = \
+- aslo.py \
++ microformat.py \
+ __init__.py
+diff --git a/extensions/cpsection/updater/backends/aslo.py b/extensions/cpsection/updater/backends/aslo.py
+deleted file mode 100644
+index 5f257f9..0000000
+--- a/extensions/cpsection/updater/backends/aslo.py
++++ /dev/null
+@@ -1,161 +0,0 @@
+-#!/usr/bin/python
+-# Copyright (C) 2009, Sugar Labs
+-#
+-# 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
+-
+-'''Activity information microformat parser.
+-
+-Activity information is embedded in HTML/XHTML/XML pages using a
+-Resource Description Framework (RDF) http://www.w3.org/RDF/ .
+-
+-An example::
+-
+-<?xml version="1.0" encoding="UTF-8"?>
+-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+-<RDF:Description about="urn:mozilla:extension:bounce">
+- <em:updates>
+- <RDF:Seq>
+- <RDF:li resource="urn:mozilla:extension:bounce:7"/>
+- </RDF:Seq>
+- </em:updates>
+-</RDF:Description>
+-
+-<RDF:Description about="urn:mozilla:extension:bounce:7">
+- <em:version>7</em:version>
+- <em:targetApplication>
+- <RDF:Description>
+- <em:id>{3ca105e0-2280-4897-99a0-c277d1b733d2}</em:id>
+- <em:minVersion>0.82</em:minVersion>
+- <em:maxVersion>0.84</em:maxVersion>
+- <em:updateLink>http://foo.xo</em:updateLink>
+- <em:updateSize>7</em:updateSize>
+- <em:updateHash>sha256:816a7c43b4f1ea4769c61c03ea4..</em:updateHash>
+- </RDF:Description>
+- </em:targetApplication>
+-</RDF:Description></RDF:RDF>
+-'''
+-
+-import logging
+-from xml.etree.ElementTree import XML
+-import traceback
+-
+-import gio
+-
+-from jarabe import config
+-
+-_FIND_DESCRIPTION = \
+- './/{http://www.w3.org/1999/02/22-rdf-syntax-ns#}Description'
+-_FIND_VERSION = './/{http://www.mozilla.org/2004/em-rdf#}version'
+-_FIND_LINK = './/{http://www.mozilla.org/2004/em-rdf#}updateLink'
+-_FIND_SIZE = './/{http://www.mozilla.org/2004/em-rdf#}updateSize'
+-
+-_UPDATE_PATH = 'http://activities.sugarlabs.org/services/update-aslo.php'
+-
+-_fetcher = None
+-
+-
+-class _UpdateFetcher(object):
+-
+- _CHUNK_SIZE = 10240
+-
+- def __init__(self, bundle, completion_cb):
+- # ASLO knows only about stable SP releases
+- major, minor = config.version.split('.')[0:2]
+- sp_version = '%s.%s' % (major, int(minor) + int(minor) % 2)
+-
+- url = '%s?id=%s&appVersion=%s' % \
+- (_UPDATE_PATH, bundle.get_bundle_id(), sp_version)
+-
+- logging.debug('Fetch %s', url)
+-
+- self._completion_cb = completion_cb
+- self._file = gio.File(url)
+- self._stream = None
+- self._xml_data = ''
+- self._bundle = bundle
+-
+- self._file.read_async(self.__file_read_async_cb)
+-
+- def __file_read_async_cb(self, gfile, result):
+- try:
+- self._stream = self._file.read_finish(result)
+- except:
+- global _fetcher
+- _fetcher = None
+- self._completion_cb(None, None, None, None, traceback.format_exc())
+- return
+-
+- self._stream.read_async(self._CHUNK_SIZE, self.__stream_read_async_cb)
+-
+- def __stream_read_async_cb(self, stream, result):
+- xml_data = self._stream.read_finish(result)
+- if xml_data is None:
+- global _fetcher
+- _fetcher = None
+- self._completion_cb(self._bundle, None, None, None,
+- 'Error reading update information for %s from '
+- 'server.' % self._bundle.get_bundle_id())
+- return
+- elif not xml_data:
+- self._process_result()
+- else:
+- self._xml_data += xml_data
+- self._stream.read_async(self._CHUNK_SIZE,
+- self.__stream_read_async_cb)
+-
+- def _process_result(self):
+- document = XML(self._xml_data)
+-
+- if document.find(_FIND_DESCRIPTION) is None:
+- logging.debug('Bundle %s not available in the server for the '
+- 'version %s', self._bundle.get_bundle_id(), config.version)
+- version = None
+- link = None
+- size = None
+- else:
+- try:
+- version = int(document.find(_FIND_VERSION).text)
+- except ValueError:
+- logging.error(traceback.format_exc())
+- version = 0
+-
+- link = document.find(_FIND_LINK).text
+-
+- try:
+- size = long(document.find(_FIND_SIZE).text) * 1024
+- except ValueError:
+- logging.error(traceback.format_exc())
+- size = 0
+-
+- global _fetcher
+- _fetcher = None
+- self._completion_cb(self._bundle, version, link, size, None)
+-
+-
+-def fetch_update_info(bundle, completion_cb):
+- '''Queries the server for a newer version of the ActivityBundle.
+-
+- completion_cb receives bundle, version, link, size and possibly an error
+- message:
+-
+- def completion_cb(bundle, version, link, size, error_message):
+- '''
+- global _fetcher
+-
+- if _fetcher is not None:
+- raise RuntimeError('Multiple simultaneous requests are not supported')
+-
+- _fetcher = _UpdateFetcher(bundle, completion_cb)
diff --git a/extensions/cpsection/updater/backends/microformat.py b/extensions/cpsection/updater/backends/microformat.py
new file mode 100644
-index 0000000..ea7dda1
+index 0000000..028dfd2
--- /dev/null
+++ b/extensions/cpsection/updater/backends/microformat.py
-@@ -0,0 +1,125 @@
+@@ -0,0 +1,203 @@
+#!/usr/bin/python
-+# Copyright (C) 2009, Sugar Labs
++#
++# Copyright (C) 2011, Anish Mangal <anish@sugarlabs.org>
+#
+# 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
@@ -38,157 +270,350 @@ index 0000000..ea7dda1
+
+import logging
+from HTMLParser import HTMLParser
++import urllib
++import re
+
+import gio
++import gobject
++import gconf
+
+from jarabe import config
+
-+#_UPDATE_PATH = 'http://activities.sugarlabs.org/services/update-aslo.php'
-+_UPDATE_PATH = 'http://wiki.paraguayeduca.org/index.php/Actividades_Dextrose_1'
-+
-+_fetcher = None
-+# flag indicating whether we've parsed the url once or not
-+_activity_list_populated = False
-+
++client = gconf.client_get_default()
++_UPDATE_PATH = client.get_string('/desktop/sugar/updater_url')
+_ACTIVITIES_LIST = {}
++ACTION_CHECKING = 0
++ACTION_UPDATING = 1
++ACTION_DOWNLOADING = 2
+
-+class _UpdateFetcher(HTMLParser):
++class MicroformatParser(HTMLParser):
+
-+ def __init__(self, bundle, completion_cb):
-+ # ASLO knows only about stable SP releases
-+ major, minor = config.version.split('.')[0:2]
-+ sp_version = '%s.%s' % (major, int(minor) + int(minor) % 2)
-+ # Reset the HTMLParser.
-+ # FIXME: Check why it does not get reset on its own.
++ def __init__(self, data, completion_cb):
++ HTMLParser.__init__(self)
+ self.reset()
++ self._data_to_parse = data
+ self._activity_id = ''
+ self._activity_url = ''
+ self._activity_version = ''
++ self._activity_size = 1
++ self._activity_name = ''
++ self._inside_activity_block = False
+ self._inside_activity_version = False
+ self._inside_activity_id = False
+ self._inside_activity_url = False
-+
-+ url = _UPDATE_PATH
-+
++ self._inside_activity_size = False
++ self._inside_activity_name = False
++ self._activity_block_tag = ''
+ self._completion_cb = completion_cb
-+ self._file = gio.File(url)
-+ self._bundle = bundle
-+ logging.debug('Fetch %s', url)
-+ self._file.load_contents_async(self.__download_file_complete_cb)
+
-+ def __download_file_complete_cb(self, gdaemonfile, result):
-+ content = self._file.load_contents_finish(result)[0]
-+ self.feed(content)
++ def parse(self):
++ self.feed(self._data_to_parse)
+
+ def handle_endtag(self, tag):
-+ if tag == 'body':
-+ self._completion_cb(None, None, None, None, None)
++ if tag == self._activity_block_tag and self._inside_activity_block:
++ self._inside_activity_block = False
++
++ _ACTIVITIES_LIST[self._activity_id] = \
++ {'version':self._activity_version,
++ 'url':self._activity_url,
++ 'size':self._activity_size,
++ 'name':self._activity_name}
++
++ elif tag == 'a':
++ if self._inside_activity_url:
++ self._inside_activity_url = False
++
++ elif tag == 'body':
++ num_bundles = len(_ACTIVITIES_LIST)
++ progress = num_bundles
++ for bundle, info in _ACTIVITIES_LIST.items():
++ progress = progress + 1
++ if _ACTIVITIES_LIST[bundle]['size'] == 1:
++ try:
++ _ACTIVITIES_LIST[bundle]['size'] = \
++ gio.File(_ACTIVITIES_LIST[bundle]['url']).\
++ query_info('*').get_size()
++
++ except Exception, e:
++ logging.exception(e)
++
++ if _ACTIVITIES_LIST[bundle]['size'] == 0:
++ logging.error('Size of activity %s reported as '
++ '0 bytes. Excluding from update list' % bundle)
++ del _ACTIVITIES_LIST[bundle]
++
++ elif _ACTIVITIES_LIST[bundle]['name'] == '':
++ # Do some regex magic to get the 'probable'
++ # activity name.
++ activity_name = re.split('\.',
++ bundle)[-1]
++ activity_name = re.sub('^[\s|\t]*', '',
++ activity_name)
++ activity_name = re.sub('[\s|\t]*$', '',
++ activity_name)
++ activity_name = re.sub('[A|a]ctivity$', '',
++ activity_name)
++ _ACTIVITIES_LIST[bundle]['name'] = \
++ activity_name
++
++ self._completion_cb(_ACTIVITIES_LIST, None)
+
+ def handle_starttag(self, tag, attrs):
++ for attribute, value in attrs:
++ if value == 'olpc-activity-info':
++ self._inside_activity_block = True
++ self._activity_block_tag = tag
++
+ if tag == 'span':
-+ for attribute,value in attrs:
++ for attribute, value in attrs:
+ if value == 'olpc-activity-id':
+ self._inside_activity_id = True
+ elif value == 'olpc-activity-version':
+ self._inside_activity_version = True
++ elif value == 'olpc-activity-name':
++ self._inside_activity_name = True
++ elif value == 'olpc-activity-size':
++ self._inside_activity_size = True
+ elif value == 'olpc-activity-url':
+ self._inside_activity_url = True
+
+ elif tag == 'a':
+ if self._inside_activity_url:
-+ for attribute,value in attrs:
++ for attribute, value in attrs:
+ if attribute == 'href':
+ self._activity_url = value
-+ self._inside_activity_url = False
+
+ def handle_data(self, data):
+ if self._inside_activity_version:
+ self._activity_version = int(data)
+ self._inside_activity_version = False
-+ _ACTIVITIES_LIST[self._activity_id] = \
-+ {'version':self._activity_version,
-+ 'url':self._activity_url,
-+ 'size':1}
-+ global _activity_list_populated
-+ _activity_list_populated = True
-+ if self._bundle._bundle_id == self._activity_id:
-+ self._completion_cb(self._bundle, self._activity_version,
-+ self._activity_url, 0, None)
++
+ elif self._inside_activity_id:
+ self._activity_id = data
+ self._inside_activity_id = False
+
-+def fetch_update_info(bundle, completion_cb):
-+ '''Queries the server for a newer version of the ActivityBundle.
++ elif self._inside_activity_name:
++ self._activity_name = data
++ self._inside_activity_name = False
++
++ elif self._inside_activity_size:
++ self._activity_size = int(data)
++ self._inside_activity_size = False
++
++class _UpdateFetcher(gobject.GObject):
++
++ __gsignals__ = {
++ 'progress': (gobject.SIGNAL_RUN_FIRST,
++ gobject.TYPE_NONE,
++ ([int, str, float, int])),
++ }
++
++ def __init__(self, completion_cb):
++ gobject.GObject.__init__(self)
++ # ASLO knows only about stable SP releases
++ major, minor = config.version.split('.')[0:2]
++ sp_version = '%s.%s' % (major, int(minor) + int(minor) % 2)
++ self._data = ''
++ self._completion_cb = completion_cb
+
-+ completion_cb receives bundle, version, link, size and possibly an error
-+ message:
++ def download_bundle_updates(self):
++ self.emit('progress', ACTION_CHECKING, 'Fetching update '
++ 'information', 1, 3)
++ self._url = _UPDATE_PATH
++ self._file = gio.File(self._url)
++ logging.debug('Fetch %s', self._url)
++ self._file.read_async(self.__read_async_cb)
+
-+ def completion_cb(bundle, version, link, size, error_message):
-+ '''
-+ global _fetcher
++ def __read_async_cb(self, gfile, result):
++ try:
++ stream = gfile.read_finish(result)
++ except gio.Error, e:
++ self.stop()
++ logging.exception('Error while fetching content from %s' %
++ self._url)
++ return
++ stream.read_async(4096, self.__stream_read_cb)
+
-+ if bundle._bundle_id in _ACTIVITIES_LIST:
-+ _fetcher = None
-+ completion_cb(bundle,
-+ _ACTIVITIES_LIST[bundle._bundle_id]['version'],
-+ _ACTIVITIES_LIST[bundle._bundle_id]['url'],
-+ _ACTIVITIES_LIST[bundle._bundle_id]['size'], None)
-+ return
++ def __stream_read_cb(self, stream, result):
++ data = stream.read_finish(result)
++ if not data:
++ self._data_finished()
++ return
++ self._data_read(data)
++ stream.read_async(4096, self.__stream_read_cb)
+
-+ global _activity_list_populated
-+ if _activity_list_populated == True:
-+ completion_cb(bundle, None, None, None, None)
-+ else:
-+ if _fetcher is not None:
-+ raise RuntimeError('Multiple simultaneous requests are not supported')
++ def _data_read(self, data):
++ self._data += data
+
-+ _fetcher = _UpdateFetcher(bundle, completion_cb)
++ def read_finish(self):
++ pass
++
++ def _data_finished(self):
++ self.emit('progress', ACTION_CHECKING, 'Fetching update '
++ 'information', 2, 3)
++ parser = MicroformatParser(self._data, self._completion_cb)
++ gobject.idle_add(parser.parse)
diff --git a/extensions/cpsection/updater/model.py b/extensions/cpsection/updater/model.py
-index 9845371..3ec6888 100755
+index 482a3fe..059d112 100755
--- a/extensions/cpsection/updater/model.py
+++ b/extensions/cpsection/updater/model.py
-@@ -36,8 +36,7 @@ from sugar.bundle.activitybundle import ActivityBundle
+@@ -36,8 +36,26 @@ from sugar.bundle.activitybundle import ActivityBundle
from jarabe.model import bundleregistry
-from backends import aslo
--
+from backends import microformat
++class MetaBundle():
++
++ def __init__(self, bundle_id, version, name):
++ self._bundle_id = bundle_id
++ self._version = version
++ self._name = name
++
++ def get_name(self):
++ return self._name
++
++ def get_bundle_id(self):
++ return self._bundle_id
++
++ def get_icon(self):
++ pass
++
++ def get_activity_version(self):
++ return self._version
+
class UpdateModel(gobject.GObject):
__gtype_name__ = 'SugarUpdateModel'
-@@ -70,11 +69,11 @@ class UpdateModel(gobject.GObject):
- total = len(bundleregistry.get_registry())
- current = total - len(self._bundles_to_check)
+@@ -62,41 +80,51 @@ class UpdateModel(gobject.GObject):
+ self._downloader = None
+ self._cancelling = False
+
++ def __progress_cb(self, model, action, description, current, total):
++ self.emit('progress', action, description, current, total)
++
+ def check_updates(self):
+ self.updates = []
++ self._current_bundles = {}
++ for bundle in bundleregistry.get_registry():
++ self._current_bundles[bundle.get_bundle_id()] =\
++ {'version':bundle.get_activity_version(),
++ 'bundle': bundle}
+ self._bundles_to_check = list(bundleregistry.get_registry())
+- self._check_next_update()
++ self._fetcher = microformat._UpdateFetcher(self.__bundle_info_fetched_cb)
++ self._fetcher.connect('progress', self.__progress_cb)
++ gobject.idle_add(self._fetcher.download_bundle_updates)
+- def _check_next_update(self):
+- total = len(bundleregistry.get_registry())
+- current = total - len(self._bundles_to_check)
+-
- bundle = self._bundles_to_check.pop()
- self.emit('progress', UpdateModel.ACTION_CHECKING, bundle.get_name(),
- current, total)
-
- aslo.fetch_update_info(bundle, self.__check_completed_cb)
-+ if len(self._bundles_to_check):
-+ bundle = self._bundles_to_check.pop()
-+ self.emit('progress', UpdateModel.ACTION_CHECKING, bundle.get_name(),
-+ current, total)
-+ microformat.fetch_update_info(bundle, self.__check_completed_cb)
-
- def __check_completed_cb(self, bundle, version, link, size, error_message):
+-
+- def __check_completed_cb(self, bundle, version, link, size, error_message):
++ def __bundle_info_fetched_cb(self, new_bundles, error_message):
if error_message is not None:
---- sugar-0.88.1/extensions/cpsection/updater/backends/Makefile.am.orig 2010-08-13 14:18:36.000000000 -0400
-+++ sugar-0.88.1/extensions/cpsection/updater/backends/Makefile.am 2010-08-13 14:21:12.000000000 -0400
-@@ -2,4 +2,6 @@ sugardir = $(pkgdatadir)/extensions/cpse
+ logging.error('Error getting update information from server:\n'
+ '%s' % error_message)
- sugar_PYTHON = \
- aslo.py \
-- __init__.py
-+ microformat.py \
-+ __init__.py \
-+ #
+- if version is not None and version > bundle.get_activity_version():
+- self.updates.append(BundleUpdate(bundle, version, link, size))
+-
+ if self._cancelling:
+ self._cancel_checking()
+- elif self._bundles_to_check:
+- gobject.idle_add(self._check_next_update)
+ else:
+- total = len(bundleregistry.get_registry())
+- if bundle is None:
+- name = ''
+- else:
+- name = bundle.get_name()
+- self.emit('progress', UpdateModel.ACTION_CHECKING, name, total,
+- total)
++ for bundle_id, info in new_bundles.items():
++ if bundle_id in self._current_bundles:
++ if new_bundles[bundle_id]['version'] >\
++ self._current_bundles[bundle_id]['version']:
++ self.updates.append(BundleUpdate(
++ self._current_bundles[bundle_id]['bundle'],
++ new_bundles[bundle_id]['version'],
++ new_bundles[bundle_id]['url'],
++ new_bundles[bundle_id]['size'],
++ 'update'))
++ else:
++ bundle = MetaBundle(bundle_id,
++ new_bundles[bundle_id]['version'],
++ new_bundles[bundle_id]['name'])
++ self.updates.append(BundleUpdate(bundle,
++ new_bundles[bundle_id]['version'],
++ new_bundles[bundle_id]['url'],
++ new_bundles[bundle_id]['size'],
++ 'new'))
++
++ self.emit('progress', UpdateModel.ACTION_CHECKING, 'Fetching update '
++ 'information', 3, 3)
+
+ def update(self, bundle_ids):
+ self._bundles_to_update = []
+@@ -217,12 +245,15 @@ class UpdateModel(gobject.GObject):
+
+ class BundleUpdate(object):
+
+- def __init__(self, bundle, version, link, size):
++ def __init__(self, bundle, version, link, size, package_type = None):
+ self.bundle = bundle
+ self.version = version
+ self.link = link
+ self.size = size
+
++ # Specify whether installing a new bundle or updating an
++ # existing one
++ self.package_type = package_type
+
+ class _Downloader(gobject.GObject):
+ _CHUNK_SIZE = 10240 # 10K
+diff --git a/extensions/cpsection/updater/view.py b/extensions/cpsection/updater/view.py
+index 2164c0b..d8afea5 100644
+--- a/extensions/cpsection/updater/view.py
++++ b/extensions/cpsection/updater/view.py
+@@ -122,7 +122,7 @@ class ActivityUpdater(SectionView):
+ return
+
+ if action == UpdateModel.ACTION_CHECKING:
+- message = _('Checking %s...') % bundle_name
++ message = _('%s...') % bundle_name
+ elif action == UpdateModel.ACTION_DOWNLOADING:
+ message = _('Downloading %s...') % bundle_name
+ elif action == UpdateModel.ACTION_UPDATING:
+@@ -359,11 +359,17 @@ class UpdateListModel(gtk.ListStore):
+ row[self.SELECTED] = True
+ row[self.ICON_FILE_NAME] = bundle_update.bundle.get_icon()
+
+- details = _('From version %(current)d to %(new)s (Size: %(size)s)')
+- details = details % \
+- {'current': bundle_update.bundle.get_activity_version(),
+- 'new': bundle_update.version,
+- 'size': _format_size(bundle_update.size)}
++ if bundle_update.package_type == 'update':
++ details = _('From version %(current)d to %(new)s (Size: %(size)s)')
++ details = details % \
++ {'current': bundle_update.bundle.get_activity_version(),
++ 'new': bundle_update.version,
++ 'size': _format_size(bundle_update.size)}
++ elif bundle_update.package_type == 'new':
++ details = _('Install new activity version %(new)s (Size: %(size)s)')
++ details = details % \
++ {'new': bundle_update.version,
++ 'size': _format_size(bundle_update.size)}
+
+ row[self.DESCRIPTION] = '<b>%s</b>\n%s' % \
+ (bundle_update.bundle.get_name(), details)
--
-1.7.2.1
+1.7.3.4
-_______________________________________________
-Dextrose mailing list
-Dextrose@lists.sugarlabs.org
-http://lists.sugarlabs.org/listinfo/dextrose
diff --git a/rpms/sugar/sugar.spec b/rpms/sugar/sugar.spec
index 4b9df0b..0dd8168 100644
--- a/rpms/sugar/sugar.spec
+++ b/rpms/sugar/sugar.spec
@@ -3,7 +3,7 @@
Summary: Constructionist learning platform
Name: sugar
Version: 0.88.1
-Release: 5.42dxo%{?dist}
+Release: 5.43dxo%{?dist}
URL: http://sugarlabs.org/
Source0: http://download.sugarlabs.org/sources/sucrose/glucose/%{name}/%{name}-%{version}.tar.bz2
@@ -97,6 +97,15 @@ Patch1001: 0001-Simple-messages-notification-extension.patch
Patch1002: 0002-Improve-message-notification-behaviour.patch
Patch1003: 0003-Yum-updater-notifications-integration.patch
+#NamingAlert being optional
+Patch1101: add__show_naming_alert__gconf_key.patch
+
+#Downgrading activities not allowed (#2164)
+Patch1201: downgrading_activities_not_allowed_2164.patch
+
+#Globalkey for touchpad device icon
+Patch1301: globalkey_for_touchpad_device_icon.patch
+
License: GPLv2+
Group: User Interface/Desktops
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -244,6 +253,12 @@ multiple instances of sugar.
%patch1002 -p1
%patch1003 -p1
+%patch1101 -p1
+
+%patch1201 -p1
+
+%patch1301 -p1
+
%build
autoreconf
%configure
@@ -320,6 +335,15 @@ rm -rf %{buildroot}
%{_datadir}/icons/hicolor/scalable/apps/sugar-xo.svg
%changelog
+* Mon Jan 10 2011 Anish Mangal <anish@sugarlabs.org> - 0.88.1-5.43
+- Add 'NamingAlert being optional' (patch1101)
+- Add 'Downgrading activities not allowed' (Patch1201)
+- Add 'Globalkey for touchpad device icon' (patch1301)
+- Replace updater with OLPC Microformat compatible one (Patch508)
+
+* Sun Jan 9 2011 Bernie Innocenti <bernie@codewiz.org> - 0.88.1-5.42
+- Add yum updater, and notification system.
+
* Wed Nov 3 2010 Steven M. Parrish <smparrish@gmail.com? - 0.88.1-5.39
- Add 3g connection sharing