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