Skip to content

Commit

Permalink
Unbreaking the clock
Browse files Browse the repository at this point in the history
  • Loading branch information
CRImier committed Mar 10, 2018
1 parent 235087d commit 3da1dc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/clock/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ def draw_analog_clock(self, c, time, radius="min(*c.size) / 3", clock_x = "cente
self.draw_needle(c, 24 - time.hour / 24, eval(h_len), clock_x, clock_y, 1)

def draw_text(self, c, time, text_x="10", text_y="center_y-5", time_format = "%H:%M:%S", **kwargs):
"""Draws the digital clock, with parameters configurable through config.txt."""
"""Draws the digital clock, with parameters configurable through config.json."""
time_str = time.strftime(time_format)
center_x, center_y = c.get_center()
bounds = self.get_centered_text_bounds(c, time_str)
x = eval(text_x)
y = eval(text_y)
c.text((x, y), time_str, fill="white")
c.text(time_str, (x, y))

def on_refresh(self):
current_time = datetime.now()
Expand Down

0 comments on commit 3da1dc5

Please sign in to comment.