Permalink
Browse files

Remove vestigial lines and move magic number to constant.

  • Loading branch information...
1 parent 0c8b984 commit ffde7e306bec230b8920fafa6c221c05bbd9aa15 Stephan Sokolow committed Oct 3, 2009
Showing with 2 additions and 3 deletions.
  1. +2 −3 timeclock.py
View
@@ -67,6 +67,7 @@
raise SystemExit("Aborting: %s exists but is not a directory!"
% DATA_DIR)
SAVE_FILE = os.path.join(DATA_DIR, "timeclock.sav")
+SAVE_INTERVAL = 60 * 5 # 5 Minutes
file_exists = os.path.isfile
logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s')
@@ -188,7 +189,6 @@ def _init_widgets(self):
self.selectedBtn = self.wTree.get_widget('btn_%sMode' % self.default_mode)
self.selectedBtn.set_active(True)
- self.save_timeout = None
# Because PyGTK isn't reliably obeying Glade
self.update_progressBars()
@@ -215,7 +215,6 @@ def mode_changed(self, widget):
self.selectedBtn = widget
if self.selectedBtn.mode == SLEEP:
- gobject.source_remove(self.save_timeout)
self.doSave()
def reset_clicked(self, widget):
@@ -275,7 +274,7 @@ def tick(self):
if self.used[mode] >= self.total[mode] and self.notify:
notify_exhaustion(mode)
- if now >= (self.last_save + (5 * 60)):
+ if now >= (self.last_save + SAVE_INTERVAL):
self.doSave()
self.last_tick = now

0 comments on commit ffde7e3

Please sign in to comment.