Added support for 'last-update' feature
This commit is contained in:
		| @@ -62,6 +62,7 @@ with open('/etc/timezone','r') as file: | |||||||
|     system_tz = lines[0].rstrip() |     system_tz = lines[0].rstrip() | ||||||
|     local_tz = timezone(system_tz) |     local_tz = timezone(system_tz) | ||||||
|  |  | ||||||
|  | print('Initialising weather') | ||||||
| owm = pyowm.OWM(api_key, language=language) | owm = pyowm.OWM(api_key, language=language) | ||||||
|  |  | ||||||
| """Main loop starts from here""" | """Main loop starts from here""" | ||||||
| @@ -450,6 +451,13 @@ def main(): | |||||||
|                     for events in range(len(upcoming)): |                     for events in range(len(upcoming)): | ||||||
|                         write_text(314, 25, upcoming[events].name, event_positions['e'+str(events+3)], alignment = 'left') |                         write_text(314, 25, upcoming[events].name, event_positions['e'+str(events+3)], alignment = 'left') | ||||||
|  |  | ||||||
|  |             'Show the time of the last update if set in the settings file' | ||||||
|  |             if show_last_update_time is 'True': | ||||||
|  |                 if hours is "24": | ||||||
|  |                     write_text(384, 25, 'Image created at '+now.format('H:mm'), (0, 615)) | ||||||
|  |                 if hours is "12": | ||||||
|  |                     write_text(384, 25, 'Image created at '+now.format('h:mm a'), (0, 615)) | ||||||
|  |  | ||||||
|  |  | ||||||
|             """ |             """ | ||||||
|             Map all pixels of the generated image to red, white and black |             Map all pixels of the generated image to red, white and black | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user