new and improved
This commit is contained in:
@@ -143,17 +143,10 @@ def drawsplitstr(win, y, x, st):
|
||||
return
|
||||
|
||||
|
||||
def drawdigital(win, y, x, t, ascii=False):
|
||||
if options.seconds:
|
||||
if t.tm_sec & 1:
|
||||
hrs = list("%02d:%02d:%02d" % (t.tm_hour, t.tm_min, t.tm_sec))
|
||||
else:
|
||||
hrs = list("%02d %02d %02d" % (t.tm_hour, t.tm_min, t.tm_sec))
|
||||
else:
|
||||
if t.tm_sec & 1:
|
||||
hrs = list("%02d:%02d" % (t.tm_hour, t.tm_min))
|
||||
else:
|
||||
hrs = list("%02d %02d" % (t.tm_hour, t.tm_min))
|
||||
def drawdigital(win, y, x, t, ascii=False, tick_tock=False):
|
||||
c = ":" if tick_tock else " "
|
||||
sec = "{:}{:02d}".format(c, t.tm_sec) if options.seconds else ""
|
||||
hrs = list("{:02d}{:}{:02d}{:}".format(t.tm_hour, c, t.tm_min, sec))
|
||||
for c in range(len(hrs)):
|
||||
drawdigit(win, y, x + 4 * c, hrs[c], ascii=ascii)
|
||||
|
||||
@@ -283,10 +276,10 @@ def main():
|
||||
for h in range(12):
|
||||
drawline(stdscr, cy, cx, math.pi * h / 6.0, r, 1 + r / 2, "◆", curses.color_pair(4))
|
||||
if options.timer:
|
||||
drawdigital(stdscr, 1, 1, timer_struct(t_h, t_m, t_s), options.ascii)
|
||||
drawdigital(stdscr, 7, 1, t, options.ascii)
|
||||
drawdigital(stdscr, 1, 1, timer_struct(t_h, t_m, t_s), options.ascii, tick_tock)
|
||||
drawdigital(stdscr, 7, 1, t, options.ascii, tick_tock)
|
||||
else:
|
||||
drawdigital(stdscr, 1, 1, t, options.ascii)
|
||||
drawdigital(stdscr, 1, 1, t, options.ascii, tick_tock)
|
||||
is_alarm = drawalarms(stdscr, 1, 35, t, alarms, tick_tock)
|
||||
stdscr.refresh()
|
||||
userinput = readinput(stdscr, options.refresh)
|
||||
|
||||
Reference in New Issue
Block a user