Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar
This commit is contained in:
commit
acca55e861
@ -60,15 +60,27 @@ class DSMetadata(gobject.GObject):
|
|||||||
def __delitem__(self, key):
|
def __delitem__(self, key):
|
||||||
del self._props[key]
|
del self._props[key]
|
||||||
|
|
||||||
|
def __contains__(self, key):
|
||||||
|
return self._props.__contains__(key)
|
||||||
|
|
||||||
def has_key(self, key):
|
def has_key(self, key):
|
||||||
return self._props.has_key(key)
|
return self._props.has_key(key)
|
||||||
|
|
||||||
|
def keys(self):
|
||||||
|
return self._props.keys()
|
||||||
|
|
||||||
def get_dictionary(self):
|
def get_dictionary(self):
|
||||||
return self._props
|
return self._props
|
||||||
|
|
||||||
def copy(self):
|
def copy(self):
|
||||||
return DSMetadata(self._props.copy())
|
return DSMetadata(self._props.copy())
|
||||||
|
|
||||||
|
def get(self, key, default=None):
|
||||||
|
if self._props.has_key(key):
|
||||||
|
return self._props[key]
|
||||||
|
else:
|
||||||
|
return default
|
||||||
|
|
||||||
class DSObject(object):
|
class DSObject(object):
|
||||||
def __init__(self, object_id, metadata=None, file_path=None):
|
def __init__(self, object_id, metadata=None, file_path=None):
|
||||||
self.object_id = object_id
|
self.object_id = object_id
|
||||||
|
@ -75,7 +75,7 @@ def get_filename(uid):
|
|||||||
return filename
|
return filename
|
||||||
|
|
||||||
def find(query, properties, reply_handler, error_handler):
|
def find(query, properties, reply_handler, error_handler):
|
||||||
logging.debug('dbus_helpers.find: %r' % query)
|
logging.debug('dbus_helpers.find: %r %r' % (query, properties))
|
||||||
if reply_handler and error_handler:
|
if reply_handler and error_handler:
|
||||||
return _get_data_store().find(query, properties,
|
return _get_data_store().find(query, properties,
|
||||||
reply_handler=reply_handler, error_handler=error_handler)
|
reply_handler=reply_handler, error_handler=error_handler)
|
||||||
|
Loading…
Reference in New Issue
Block a user