hamster-applet r745 - trunk/hamster



Author: tbaugis
Date: Thu Feb 19 00:24:58 2009
New Revision: 745
URL: http://svn.gnome.org/viewvc/hamster-applet?rev=745&view=rev

Log:
fixed case when trying add a fact in a date and there is 
end time of last activity

Modified:
   trunk/hamster/add_custom_fact.py

Modified: trunk/hamster/add_custom_fact.py
==============================================================================
--- trunk/hamster/add_custom_fact.py	(original)
+++ trunk/hamster/add_custom_fact.py	Thu Feb 19 00:24:58 2009
@@ -48,6 +48,7 @@
         self.refresh_menu()
 
         self.get_widget("in_progress").set_active(False)
+        end_date = None
 
         if fact_id:
             fact = storage.get_fact(fact_id)
@@ -75,14 +76,14 @@
             # then we start from 8am (pretty default)
             last_activity = storage.get_facts(fact_date)
             if last_activity and last_activity[len(last_activity)-1]["end_time"]:
-                fact_date = last_activity[len(last_activity)-1]["end_time"]
+                start_date = last_activity[len(last_activity)-1]["end_time"]
             else:
                 if fact_date == datetime.date.today():
                     # for today time is now
-                    fact_date = datetime.datetime.now()
+                    start_date = datetime.datetime.now()
                 else:
                     # for other days it is 8am
-                    fact_date = datetime.datetime(fact_date.year,
+                    start_date = datetime.datetime(fact_date.year,
                                                   fact_date.month,
                                                   fact_date.day,
                                                   8)



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