Merge pull request #73 from aceisace/no-fresh-images-fix
Bugfix: No fresh images generated
This commit is contained in:
		| @@ -19,6 +19,10 @@ calibration_countdown = 'initial' | |||||||
| skip_calibration = False | skip_calibration = False | ||||||
| image_cleanup() | image_cleanup() | ||||||
|  |  | ||||||
|  | top_section_module = importlib.import_module(top_section) | ||||||
|  | middle_section_module = importlib.import_module(middle_section) | ||||||
|  | bottom_section_module = importlib.import_module(bottom_section) | ||||||
|  |  | ||||||
| """Check time and calibrate display if time """ | """Check time and calibrate display if time """ | ||||||
| while True: | while True: | ||||||
|   now = arrow.now(tz=get_tz()) |   now = arrow.now(tz=get_tz()) | ||||||
| @@ -51,24 +55,30 @@ while True: | |||||||
|  |  | ||||||
|     """----------------Generating and assembling images------""" |     """----------------Generating and assembling images------""" | ||||||
|     try: |     try: | ||||||
|       top_section_module = importlib.import_module(top_section) |       top_section_module.main() | ||||||
|       top_section_image = Image.open(image_path + top_section+'.png') |       top_section_image = Image.open(image_path + top_section+'.png') | ||||||
|       image.paste(top_section_image, (0, 0)) |       image.paste(top_section_image, (0, 0)) | ||||||
|     except: |       print('Done') | ||||||
|  |     except Exception as error: | ||||||
|  |       print(error) | ||||||
|       pass |       pass | ||||||
|  |  | ||||||
|     try: |     try: | ||||||
|       middle_section_module = importlib.import_module(middle_section) |       middle_section_module.main() | ||||||
|       middle_section_image = Image.open(image_path + middle_section+'.png') |       middle_section_image = Image.open(image_path + middle_section+'.png') | ||||||
|       image.paste(middle_section_image, (0, middle_section_offset)) |       image.paste(middle_section_image, (0, middle_section_offset)) | ||||||
|     except: |       print('Done') | ||||||
|  |     except Exception as error: | ||||||
|  |       print(error) | ||||||
|       pass |       pass | ||||||
|  |  | ||||||
|     try: |     try: | ||||||
|       bottom_section_module = importlib.import_module(bottom_section) |       bottom_section_module.main() | ||||||
|       bottom_section_image = Image.open(image_path + bottom_section+'.png') |       bottom_section_image = Image.open(image_path + bottom_section+'.png') | ||||||
|       image.paste(bottom_section_image, (0, bottom_section_offset)) |       image.paste(bottom_section_image, (0, bottom_section_offset)) | ||||||
|     except: |       print('Done') | ||||||
|  |     except Exception as error: | ||||||
|  |       print(error) | ||||||
|       pass |       pass | ||||||
|  |  | ||||||
|     image.save(image_path + 'canvas.png') |     image.save(image_path + 'canvas.png') | ||||||
| @@ -116,4 +126,5 @@ while True: | |||||||
|       print('{0} Minutes left until next refresh'.format(minutes)) |       print('{0} Minutes left until next refresh'.format(minutes)) | ||||||
|  |  | ||||||
|       del update_timings, minutes, image |       del update_timings, minutes, image | ||||||
|  |       image_cleanup() | ||||||
|       sleep(refresh_countdown) |       sleep(refresh_countdown) | ||||||
|   | |||||||
| @@ -178,10 +178,10 @@ def generate_image(): | |||||||
|         hour_gap = 3 |         hour_gap = 3 | ||||||
|  |  | ||||||
|       """Prepare timings for forecasts""" |       """Prepare timings for forecasts""" | ||||||
|       fc1 = now.replace(hours = + hour_gap) |       fc1 = now.replace(hours = + hour_gap).floor('hour') | ||||||
|       fc2 = now.replace(hours = + hour_gap + 3) |       fc2 = now.replace(hours = + hour_gap + 3).floor('hour') | ||||||
|       fc3 = now.replace(hours = + hour_gap + 6) |       fc3 = now.replace(hours = + hour_gap + 6).floor('hour') | ||||||
|       fc4 = now.replace(hours = + hour_gap + 9) |       fc4 = now.replace(hours = + hour_gap + 9).floor('hour') | ||||||
|  |  | ||||||
|       """Prepare forecast objects for the specified timings""" |       """Prepare forecast objects for the specified timings""" | ||||||
|       forecast_fc1 = forecast.get_weather_at(fc1.datetime) |       forecast_fc1 = forecast.get_weather_at(fc1.datetime) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user