Commits

clach04  committed f967705

Moved date/day display into event system as standalone event.
Event scheduler list now uses *args.

  • Participants
  • Parent commits 137891e

Comments (0)

Files changed (1)

             except KeyError:
                 pos_x += missing_width  # or some other width
 
-        display_day_text(3)
-
         # Work out when to wake up for the next round/whole (non-fractional) time
         update_display_period = 1
         start_time = time.time()
         clock_str = '%s %s' % (short_day_name_str, day_str)
         d.display_text_on_line(line_num, clock_str, False, None, fg)
         # TODO consider doing date stuff else where (less frequently)
+        return True
 
     def display_datetime_text():
-        display_day_text()
-
         line_num = 3
         clock_str = str(datetime.datetime.now()).split('.')[0]
         d.display_text_on_line(line_num, clock_str, False, None, fg)
 
     if conf.get('clock.time', 'text') == 'text':
         display_datetime = display_datetime_text
+        date_line_num = 2
     else:
         display_datetime = display_datetime_icon
+        date_line_num = 3
 
     events = [
-        (1, display_datetime),  # call every 1 second
-        (5 * 60, display_hdspace),  # call every 5 mins
-        (10, display_temps),  # call every 10 secs
+        (1, display_datetime, []),  # call every 1 second
+        (1, display_day_text, [date_line_num]),  # call every 1 second  # DEBUG
+        (5 * 60, display_hdspace, []),  # call every 5 mins
+        (10, display_temps, []),  # call every 10 secs
     ]
 
     def paint_everything():
         # paint screen once with everything
-        for dummy, func in events:
-            func()
+        for dummy, func, args in events:
+            func(*args)
 
     s = MySchedule()
     
                 debug_temps=debug_temps,
             )
 
-    for time_period, func in events:
-        s.add(time_period, func)
+    for time_period, func, args in events:
+        s.add(time_period, func, *args)
     s.dispatch()