diff --git a/world_clock2.py b/world_clock2.py index a577a91..b1df283 100644 --- a/world_clock2.py +++ b/world_clock2.py @@ -137,15 +137,16 @@ while True: london_time = getTimes(london_timezone) #TOKYO TIME tokyo_time = getTimes(tokyo_timezone) - if not settings['display_pm']: - ny_time = ny_time.replace("PM", "").replace("AM", "") - london_time = london_time.replace("PM", "").replace("AM", "") - tokyo_time = tokyo_time.replace("PM", "").replace("AM", "") ny_color = time_colors['day'] if isDaytime(ny_time) else time_colors['night'] london_color = time_colors['day'] if isDaytime(london_time) else time_colors['night'] tokyo_color = time_colors['day'] if isDaytime(tokyo_time) else time_colors['night'] + if not settings['display_pm']: + ny_time = ny_time.replace("PM", "").replace("AM", "") + london_time = london_time.replace("PM", "").replace("AM", "") + tokyo_time = tokyo_time.replace("PM", "").replace("AM", "") + graphics.DrawText(canvas, font, 2, 8, color, 'NEW YORK') graphics.DrawText(canvas, font, x_offset, 8, ny_color, ny_time) graphics.DrawLine(canvas, 0, 10, 128, 10, line_c) @@ -167,15 +168,16 @@ while True: dubai_time = getTimes(dubai_timezone) #LOS ANGELES la_time = getTimes(la_timezone) - if not settings['display_pm']: - au_time = au_time.replace("PM", "").replace("AM", "") - dubai_time = dubai_time.replace("PM", "").replace("AM", "") - la_time = la_time.replace("PM", "").replace("AM", "") au_color = time_colors['day'] if isDaytime(au_time) else time_colors['night'] dubai_color = time_colors['day'] if isDaytime(dubai_time) else time_colors['night'] la_color = time_colors['day'] if isDaytime(la_time) else time_colors['night'] + if not settings['display_pm']: + au_time = au_time.replace("PM", "").replace("AM", "") + dubai_time = dubai_time.replace("PM", "").replace("AM", "") + la_time = la_time.replace("PM", "").replace("AM", "") + graphics.DrawText(canvas, font, x_offset, 8, au_color, au_time) graphics.DrawText(canvas, font, 2, 8, color, 'SYDNEY') graphics.DrawLine(canvas, 0, 10, 128, 10, line_c) @@ -197,15 +199,16 @@ while True: paris_time = getTimes(paris_timezone) #MUMBAI in_time = getTimes(in_timezone) - if not settings['display_pm']: - cn_time = cn_time.replace("PM", "").replace("AM", "") - paris_time = paris_time.replace("PM", "").replace("AM", "") - in_time = in_time.replace("PM", "").replace("AM", "") cn_color = time_colors['day'] if isDaytime(cn_time) else time_colors['night'] paris_color = time_colors['day'] if isDaytime(paris_time) else time_colors['night'] in_color = time_colors['day'] if isDaytime(in_time) else time_colors['night'] + if not settings['display_pm']: + cn_time = cn_time.replace("PM", "").replace("AM", "") + paris_time = paris_time.replace("PM", "").replace("AM", "") + in_time = in_time.replace("PM", "").replace("AM", "") + graphics.DrawText(canvas, font, x_offset, 8, cn_color, cn_time) graphics.DrawText(canvas, font, 2, 8, color, 'SHANGHAI') graphics.DrawText(canvas, font, x_offset, 19, paris_color, paris_time)