Add DSMetadata.get() method.
This commit is contained in:
parent
03e6db4393
commit
fab9ac8972
@ -75,6 +75,12 @@ class DSMetadata(gobject.GObject):
|
|||||||
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