[hamster-applet] make sure we return an integer as otherwise dbus will be really really angry and eat your lunch
- From: Toms Baugis <tbaugis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hamster-applet] make sure we return an integer as otherwise dbus will be really really angry and eat your lunch
- Date: Thu, 19 Aug 2010 11:48:24 +0000 (UTC)
commit 6d84c9adade60cb50606d0382201482ef534331c
Author: Toms Bauģis <toms baugis gmail com>
Date: Thu Aug 19 12:48:01 2010 +0100
make sure we return an integer as otherwise dbus will be really really angry and eat your lunch
src/hamster/storage.py | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/hamster/storage.py b/src/hamster/storage.py
index 26b4399..91baf6f 100644
--- a/src/hamster/storage.py
+++ b/src/hamster/storage.py
@@ -108,15 +108,13 @@ class Storage(dbus.service.Object):
def AddFact(self, activity_name, tags, start_time, end_time,
category_name = None, description = None, temporary = False):
+ start_time = start_time or None
if start_time:
start_time = dt.datetime.utcfromtimestamp(start_time)
- else:
- start_time = None
+ end_time = end_time or None
if end_time:
end_time = dt.datetime.utcfromtimestamp(end_time)
- else:
- end_time = None
self.start_transaction()
result = self.__add_fact(activity_name, tags, start_time, end_time, category_name, description, temporary)
@@ -124,7 +122,8 @@ class Storage(dbus.service.Object):
if result:
self.FactsChanged()
- return result
+
+ return result or 0
@dbus.service.method("org.gnome.Hamster", in_signature='i', out_signature='(iiissisasii)')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]