Ticket #1202: 0001-compatible-changes-to-prepare-for-version-support.patch

File 0001-compatible-changes-to-prepare-for-version-support.patch, 4.9 KB (added by sascha_silbe, 15 years ago)

small changes for version support that don't change behaviour in plain 0.86

  • src/sugar/activity/activity.py

    From d2bac711f96ff10cd40201bdfe7810f0fe0f872e Mon Sep 17 00:00:00 2001
    From: Sascha Silbe <sascha@silbe.org>
    Date: Tue, 18 Aug 2009 15:25:13 +0200
    Subject: [PATCH] compatible changes to prepare for version support
    
    ---
     src/sugar/activity/activity.py        |    6 +++---
     src/sugar/activity/activityfactory.py |    2 +-
     src/sugar/activity/activityhandle.py  |    2 --
     src/sugar/datastore/__init__.py       |   29 +++++++++++++++++++++++++++++
     src/sugar/graphics/objectchooser.py   |    2 +-
     5 files changed, 34 insertions(+), 7 deletions(-)
    
    diff --git a/src/sugar/activity/activity.py b/src/sugar/activity/activity.py
    index f20d402..1c2e06a 100644
    a b class Activity(Window, gtk.Container): 
    470470        """
    471471        raise NotImplementedError
    472472
    473     def __save_cb(self):
     473    def __save_cb(self, object_id=None):
    474474        logging.debug('Activity.__save_cb')
    475475        self._updating_jobject = False
    476476        if self._quit_requested:
    class Activity(Window, gtk.Container): 
    550550            logging.debug('Cannot save, no journal object.')
    551551            return
    552552
    553         logging.debug('Activity.save: %r' % self._jobject.object_id)
     553        logging.debug('Activity.save: %r', self._jobject.object_id)
    554554
    555555        if self._updating_jobject:
    556556            logging.info('Activity.save: still processing a previous request.')
    class Activity(Window, gtk.Container): 
    594594        Activities should not override this method. Instead, like save() do any
    595595        copy work that needs to be done in write_file()
    596596        """
    597         logging.debug('Activity.copy: %r' % self._jobject.object_id)
     597        logging.debug('Activity.copy: %r', self._jobject.object_id)
    598598        self.save()
    599599        self._jobject.object_id = None
    600600
  • src/sugar/activity/activityfactory.py

    diff --git a/src/sugar/activity/activityfactory.py b/src/sugar/activity/activityfactory.py
    index 462a0f9..3d790c7 100644
    a b class ActivityCreationHandler(gobject.GObject): 
    319319    def _find_object_reply_handler(self, jobjects, count):
    320320        if count > 0:
    321321            if count > 1:
    322                 logging.debug("Multiple objects has the same activity_id.")
     322                logging.debug("Multiple objects have the same activity_id.")
    323323            self._handle.object_id = jobjects[0]['uid']
    324324        self._launch_activity()
    325325
  • src/sugar/activity/activityhandle.py

    diff --git a/src/sugar/activity/activityhandle.py b/src/sugar/activity/activityhandle.py
    index f255fd5..c4e16a8 100644
    a b class ActivityHandle(object): 
    3838            since new activities does not have an
    3939            associated object (yet).
    4040           
    41             XXX Not clear how this relates to the activity
    42             id yet, i.e. not sure we really need both. TBF
    4341        uri -- URI associated with the activity. Used when
    4442            opening an external file or resource in the
    4543            activity, rather than a journal object
  • src/sugar/datastore/__init__.py

    diff --git a/src/sugar/datastore/__init__.py b/src/sugar/datastore/__init__.py
    index bdb658b..ece8f20 100644
    a b  
    1414# License along with this library; if not, write to the
    1515# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    1616# Boston, MA 02111-1307, USA.
     17
     18
     19class NoSpaceLeftError(Exception):
     20    """There is not enough space left on disk to safely store data and/or
     21    metadata.
     22
     23    Operation aborted, everything still at the previous state.
     24    """
     25
     26class InvalidArgumentError(Exception):
     27    """One or several of the passed parameters were invalid.
     28
     29    See formatted string for details. This should only happen if the caller
     30    is doing something wrong, not during normal operation.
     31    """
     32
     33class CorruptionError(Exception):
     34    """The internal data structures of the data store or one of its backends
     35    are corrupted.
     36
     37    Should only happen in case of hardware defects or OS bugs.
     38    """
     39
     40class BusyError(Exception):
     41    """Data store is busy recovering from a crash.
     42
     43    Please wait for Ready() before starting to issue any API call (except
     44    check_ready()).
     45    """
  • src/sugar/graphics/objectchooser.py

    diff --git a/src/sugar/graphics/objectchooser.py b/src/sugar/graphics/objectchooser.py
    index fb3703d..ef4e728 100644
    a b class ObjectChooser(object): 
    110110    def __chooser_response_cb(self, chooser_id, object_id):
    111111        if chooser_id != self._chooser_id:
    112112            return
    113         logging.debug('ObjectChooser.__chooser_response_cb: %r' % object_id)
     113        logging.debug('ObjectChooser.__chooser_response_cb: %r', object_id)
    114114        self._response_code = gtk.RESPONSE_ACCEPT
    115115        self._object_id = object_id
    116116        self._cleanup()