[hamster-applet] when end_date in GetFacts is not specified, presume it's none, not today. (so get_facts(start_date)



commit bca45df2313cf26cc6d084fd4d209c7a93fbf176
Author: Toms Bauģis <toms baugis gmail com>
Date:   Sat Apr 24 09:52:08 2010 +0100

    when end_date in GetFacts is not specified, presume it's none, not today.
    (so get_facts(start_date) would return just one day). this restores previous functionality.

 src/hamster/storage.py |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/hamster/storage.py b/src/hamster/storage.py
index 0ef1fbb..f342085 100644
--- a/src/hamster/storage.py
+++ b/src/hamster/storage.py
@@ -180,15 +180,13 @@ class Storage(dbus.service.Object):
             i  delta
         """
         #TODO: Assert start > end ?
+        start = dt.date.today()
         if start_date:
             start = dt.datetime.utcfromtimestamp(start_date).date()
-        else:
-            start = dt.date.today()
 
+        end = None
         if end_date:
             end = dt.datetime.utcfromtimestamp(end_date).date()
-        else:
-            end = dt.date.today()
 
         return [to_dbus_fact(fact) for fact in self.__get_facts(start, end, search_terms)]
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]