This commit is contained in:
Morgan Collett 2007-07-26 12:35:55 +01:00
commit ec1af196c6
5 changed files with 15 additions and 8 deletions

2
NEWS
View File

@ -1,3 +1,5 @@
* Activity launching now timeout after 120 seconds. (marco)
* Add timeout arg to sugar.datastore.Datastore. (tomeu)
* Presence Service monitor in dev console (smcv)
* Turn off logging by default. Logs may be re-enabled on a per-module basis
by adding environment variables like SHELL_DEBUG and RECORD_DEBUG to

View File

@ -113,6 +113,7 @@ class ActivityCreationHandler(gobject.GObject):
error_handler=self._notify_launch_error_handler)
self._factory.create(self._activity_handle.get_dict(),
timeout=120 * 1000,
reply_handler=self._no_reply_handler,
error_handler=self._create_error_handler)

View File

@ -67,13 +67,15 @@ class ActivityHandle(object):
def get_dict(self):
"""Retrieve our settings as a dictionary"""
result = { 'activity_id' : self.activity_id }
result = { }
if self.activity_id:
result['activity_id'] = str(self.activity_id)
if self.pservice_id:
result['pservice_id'] = self.pservice_id
result['pservice_id'] = str(self.pservice_id)
if self.object_id:
result['object_id'] = self.object_id
result['object_id'] = str(self.object_id)
if self.uri:
result['uri'] = self.uri
result['uri'] = str(self.uri)
return result

View File

@ -172,7 +172,7 @@ def create():
metadata['mtime'] = metadata['ctime']
return DSObject(object_id=None, metadata=metadata, file_path=None)
def write(ds_object, update_mtime=True, reply_handler=None, error_handler=None):
def write(ds_object, update_mtime=True, reply_handler=None, error_handler=None, timeout=-1):
logging.debug('datastore.write')
properties = ds_object.metadata.get_dictionary().copy()
@ -185,7 +185,8 @@ def write(ds_object, update_mtime=True, reply_handler=None, error_handler=None):
properties,
ds_object.file_path,
reply_handler=reply_handler,
error_handler=error_handler)
error_handler=error_handler,
timeout=timeout)
else:
ds_object.object_id = dbus_helpers.create(properties,
ds_object.file_path)

View File

@ -37,12 +37,13 @@ def create(properties, filename):
logging.debug('dbus_helpers.create: ' + object_id)
return object_id
def update(uid, properties, filename, reply_handler=None, error_handler=None):
def update(uid, properties, filename, reply_handler=None, error_handler=None, timeout=-1):
logging.debug('dbus_helpers.update: %s, %s, %s' % (uid, filename, properties))
if reply_handler and error_handler:
_data_store.update(uid, dbus.Dictionary(properties), filename,
reply_handler=reply_handler,
error_handler=error_handler)
error_handler=error_handler,
timeout=timeout)
else:
_data_store.update(uid, dbus.Dictionary(properties), filename)