Update wnow.py

quick fixes for windows
This commit is contained in:
Christopher Handy 2023-08-04 12:03:27 +02:00 committed by GitHub
parent 2181698817
commit a756db2223
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

15
wnow.py
View File

@ -9,7 +9,7 @@ import sys
import os import os
from zoneinfo import ZoneInfo from zoneinfo import ZoneInfo
from pytz import reference #from pytz import reference
# zonelist is a user editable list of time zones to display # zonelist is a user editable list of time zones to display
# comment / uncomment # comment / uncomment
@ -82,15 +82,16 @@ def schermo(scr, *args):
#curses.use_default_colors() #curses.use_default_colors()
curses.use_default_colors() curses.use_default_colors()
for i in range(1, curses.COLORS): #for i in range(1, curses.COLORS):
for i in range(1, curses.COLORPAIRS):
curses.init_pair(i, i, -1); curses.init_pair(i, i, -1);
curses.init_pair(1, curses.COLOR_YELLOW, -1) curses.init_pair(1, curses.COLOR_GREEN, -1)
curses.init_pair(2, curses.COLOR_CYAN, -1) curses.init_pair(2, curses.COLOR_YELLOW, -1)
curses.init_pair(3, curses.COLOR_GREEN, -1) curses.init_pair(3, curses.COLOR_CYAN, -1)
curses.init_pair(4, curses.COLOR_BLUE, -1) curses.init_pair(4, curses.COLOR_BLUE, -1)
curses.init_pair(5, curses.COLOR_YELLOW, -1) curses.init_pair(5, curses.COLOR_RED, -1)
#curses.init_pair(6, curses.COLOR_RED, -1) #curses.init_pair(6, curses.COLOR_RED, -1)
#curses.init_pair(7, curses.COLOR_RED, -1) #curses.init_pair(7, curses.COLOR_RED, -1)
@ -100,7 +101,7 @@ def schermo(scr, *args):
while ch != ord('q'): while ch != ord('q'):
for x in range(0,(len(zone))): for x in range(0,(len(zone))):
os.environ["TZ"] = zone[x][0] os.environ["TZ"] = zone[x][0]
localtime = reference.LocalTimezone() #localtime = reference.LocalTimezone()
if x in clocklight.values(): if x in clocklight.values():
#vx = clocklight.values().index(x) #vx = clocklight.values().index(x)