added 3 more cities
This commit is contained in:
parent
18baea2a7e
commit
de078a1ef3
@ -116,6 +116,9 @@ la_timezone = pytz.timezone('America/Los_Angeles')
|
||||
cn_timezone = pytz.timezone('Asia/Shanghai')
|
||||
paris_timezone = pytz.timezone('Europe/Paris')
|
||||
in_timezone = pytz.timezone('Asia/Kolkata')
|
||||
auck_timezone = pytz.timezone('Pacific/Auckland')
|
||||
bang_timezone = pytz.timezone('Asia/Bangkok')
|
||||
istan_timezone = pytz.timezone('Europe/Istanbul')
|
||||
|
||||
counter = 0
|
||||
|
||||
@ -221,7 +224,37 @@ while True:
|
||||
|
||||
counter += 1
|
||||
# print("CN:", cn_time,"PARIS:", paris_time,"MUMBAI:", in_time)
|
||||
if counter == 18:
|
||||
elif 18 <= counter <= 23:
|
||||
canvas.Clear()
|
||||
#SHANGHAI
|
||||
auck_time = getTimes(auck_timezone)
|
||||
#PARIS
|
||||
bang_time = getTimes(bang_timezone)
|
||||
#MUMBAI
|
||||
istan_time = getTimes(istan_timezone)
|
||||
|
||||
auck_color = time_colors['day'] if isDaytime(auck_time) else time_colors['night']
|
||||
bang_color = time_colors['day'] if isDaytime(bang_time) else time_colors['night']
|
||||
istan_color = time_colors['day'] if isDaytime(istan_time) else time_colors['night']
|
||||
|
||||
if not settings['display_pm']:
|
||||
auck_time = auck_time.replace("PM", "").replace("AM", "")
|
||||
bang_time = bang_time.replace("PM", "").replace("AM", "")
|
||||
istan_time = istan_time.replace("PM", "").replace("AM", "")
|
||||
|
||||
graphics.DrawText(canvas, font, x_offset, 8, auck_color, auck_time)
|
||||
graphics.DrawText(canvas, font, 2, 8, color, 'AUCKLAND')
|
||||
graphics.DrawText(canvas, font, x_offset, 19, bang_color, bang_time)
|
||||
graphics.DrawLine(canvas, 0, 10, 128, 10, line_c)
|
||||
graphics.DrawText(canvas, font, 2, 19, color, 'BANGKOK')
|
||||
graphics.DrawText(canvas, font, x_offset, 30, istan_color, istan_time)
|
||||
graphics.DrawLine(canvas, 0, 21, 128, 21, line_c)
|
||||
graphics.DrawText(canvas, font, 2, 30, color, 'ISTANBUL')
|
||||
canvas = matrix.SwapOnVSync(canvas)
|
||||
|
||||
counter += 1
|
||||
# print("CN:", cn_time,"PARIS:", paris_time,"MUMBAI:", in_time)
|
||||
if counter == 24:
|
||||
counter = 0
|
||||
|
||||
time.sleep(1)
|
||||
|
Loading…
Reference in New Issue
Block a user