From 060b740983ed36757df91eb20553540acf6067a2 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 5 Jul 2007 11:34:59 +0200 Subject: [PATCH 1/3] API change in the datastore. --- sugar/datastore/dbus_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sugar/datastore/dbus_helpers.py b/sugar/datastore/dbus_helpers.py index 0f1b6900..18c20ea7 100644 --- a/sugar/datastore/dbus_helpers.py +++ b/sugar/datastore/dbus_helpers.py @@ -51,7 +51,7 @@ def delete(uid): def get_properties(uid): logging.debug('dbus_helpers.get_properties: %s' % uid) - return _data_store.get_properties(uid) + return _data_store.get_properties(uid, []) def get_filename(uid): filename = _data_store.get_filename(uid) From 408b601c0ef7b4bdbdb4fc5667900f08731c6817 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 5 Jul 2007 11:35:36 +0200 Subject: [PATCH 2/3] Set ObjectType.mime_types. --- sugar/objects/objecttype.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sugar/objects/objecttype.py b/sugar/objects/objecttype.py index c0ece9be..dd2da548 100644 --- a/sugar/objects/objecttype.py +++ b/sugar/objects/objecttype.py @@ -25,16 +25,17 @@ def _object_type_from_dict(info_dict): if info_dict: return ObjectType(info_dict['type_id'], info_dict['name'], - info_dict['icon']) + info_dict['icon'], + info_dict['mime_types']) else: return None class ObjectType(object): - def __init__(self, type_id, name, icon): + def __init__(self, type_id, name, icon, mime_types): self.type_id = type_id self.name = name self.icon = icon - self.mime_types = [] + self.mime_types = mime_types class ObjectTypeRegistry(object): def __init__(self): From eab0e41d080d8987adfc7a95adb02bf433312616 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 5 Jul 2007 11:36:04 +0200 Subject: [PATCH 3/3] Add application/vnd.oasis.opendocument.text mime to the Text type. --- services/clipboard/objecttypeservice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/clipboard/objecttypeservice.py b/services/clipboard/objecttypeservice.py index 97f7d906..e12398ec 100644 --- a/services/clipboard/objecttypeservice.py +++ b/services/clipboard/objecttypeservice.py @@ -31,7 +31,8 @@ class ObjectTypeRegistry(dbus.service.Object): from gettext import gettext as _ self._add_primitive('Text', _('Text'), 'theme:object-text', [ 'text/plain', 'text/rtf', 'application/pdf', - 'application/x-pdf', 'text/html' ]) + 'application/x-pdf', 'text/html', + 'application/vnd.oasis.opendocument.text' ]) self._add_primitive('Image', _('Image'), 'theme:object-image', [ 'image/png', 'image/gif', 'image/jpeg' ])