hamster-applet r417 - trunk/hamster
- From: tbaugis svn gnome org
- To: svn-commits-list gnome org
- Subject: hamster-applet r417 - trunk/hamster
- Date: Tue, 19 Aug 2008 18:59:10 +0000 (UTC)
Author: tbaugis
Date: Tue Aug 19 18:59:10 2008
New Revision: 417
URL: http://svn.gnome.org/viewvc/hamster-applet?rev=417&view=rev
Log:
for today's facts set end time to current (that's the most probable scenario)
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 Tue Aug 19 18:59:10 2008
@@ -139,7 +139,16 @@
if selected == 1:
# selected to enter end date and time
- self.get_widget("end_time").set_text(self.get_widget('start_time').get_text())
+ start_date = datetime.datetime.fromtimestamp(self.get_widget('start_date').get_time())
+ if start_date.date() == datetime.date.today(): #in case of today let's add the end time as right now
+ end_time = time.strftime("%H:%M")
+ else: #otherwise settle to the one we have in start time
+ end_time = self.get_widget('start_time').get_text()
+
+ # and set end_time only if it has not been specified before
+ if self.get_widget('end_time').get_text() == '':
+ self.get_widget('end_time').set_text(end_time)
+
self.get_widget("fact_end_until").show()
elif selected == 2:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]