Implemented renamed debug function
This commit is contained in:
parent
b09e97c93f
commit
4c2c049c4b
1 changed files with 11 additions and 11 deletions
|
@ -25,7 +25,7 @@ import IcalEvents
|
||||||
try:
|
try:
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
debug.print("Something didn't work right, maybe you're offline?" + e.reason)
|
debug.print_line("Something didn't work right, maybe you're offline?" + e.reason)
|
||||||
|
|
||||||
output_adapters = []
|
output_adapters = []
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ def main ():
|
||||||
year = int(time.now().strftime('%Y'))
|
year = int(time.now().strftime('%Y'))
|
||||||
|
|
||||||
for i in range(1):
|
for i in range(1):
|
||||||
debug.print('_________Starting new loop___________' + '\n')
|
debug.print_line('_________Starting new loop___________' + '\n')
|
||||||
"""At the following hours (midnight, midday and 6 pm), perform
|
"""At the following hours (midnight, midday and 6 pm), perform
|
||||||
a calibration of the display's colours"""
|
a calibration of the display's colours"""
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ def main ():
|
||||||
for output in output_adapters:
|
for output in output_adapters:
|
||||||
output.calibrate()
|
output.calibrate()
|
||||||
|
|
||||||
debug.print('Date:'+ time.strftime('%a %d %b %y') + ', time: ' + time.strftime('%H:%M') + '\n')
|
debug.print_line('Date:'+ time.strftime('%a %d %b %y') + ', time: ' + time.strftime('%H:%M') + '\n')
|
||||||
|
|
||||||
"""Create a blank white page, for debugging, change mode to
|
"""Create a blank white page, for debugging, change mode to
|
||||||
to 'RGB' and and save the image by uncommenting the image.save
|
to 'RGB' and and save the image by uncommenting the image.save
|
||||||
|
@ -96,7 +96,7 @@ def main ():
|
||||||
"""Using the built-in calendar function, draw icons for each
|
"""Using the built-in calendar function, draw icons for each
|
||||||
number of the month (1,2,3,...28,29,30)"""
|
number of the month (1,2,3,...28,29,30)"""
|
||||||
cal = calendar.monthcalendar(time.year, time.month)
|
cal = calendar.monthcalendar(time.year, time.month)
|
||||||
#debug.print(cal) #-uncomment for debugging with incorrect dates
|
#debug.print_line(cal) #-uncomment for debugging with incorrect dates
|
||||||
|
|
||||||
for numbers in cal[0]:
|
for numbers in cal[0]:
|
||||||
image.paste(im_open(dpath + str(numbers) + '.jpeg'), positions['a' + str(cal[0].index(numbers) + 1)])
|
image.paste(im_open(dpath + str(numbers) + '.jpeg'), positions['a' + str(cal[0].index(numbers) + 1)])
|
||||||
|
@ -129,7 +129,7 @@ def main ():
|
||||||
image.paste(space, tuple)
|
image.paste(space, tuple)
|
||||||
|
|
||||||
""" Handling Openweathermap API"""
|
""" Handling Openweathermap API"""
|
||||||
debug.print("Connecting to Openweathermap API servers...")
|
debug.print_line("Connecting to Openweathermap API servers...")
|
||||||
owm = OwmForecasts.OwmForecasts(api_key, units=units)
|
owm = OwmForecasts.OwmForecasts(api_key, units=units)
|
||||||
if owm.is_available() is True:
|
if owm.is_available() is True:
|
||||||
forecast = owm.get_today_forecast(location)
|
forecast = owm.get_today_forecast(location)
|
||||||
|
@ -179,7 +179,7 @@ def main ():
|
||||||
image.paste(no_response, wiconplace)
|
image.paste(no_response, wiconplace)
|
||||||
|
|
||||||
"""Filter upcoming events from your iCalendar/s"""
|
"""Filter upcoming events from your iCalendar/s"""
|
||||||
debug.print('Fetching events from your calendar' + '\n')
|
debug.print_line('Fetching events from your calendar' + '\n')
|
||||||
|
|
||||||
events_cal = IcalEvents.IcalEvents(ical_urls)
|
events_cal = IcalEvents.IcalEvents(ical_urls)
|
||||||
|
|
||||||
|
@ -198,10 +198,10 @@ def main ():
|
||||||
del upcoming[4:]
|
del upcoming[4:]
|
||||||
# uncomment the following 2 lines to display the fetched events
|
# uncomment the following 2 lines to display the fetched events
|
||||||
# from your iCalendar
|
# from your iCalendar
|
||||||
debug.print('Upcoming events:')
|
debug.print_line('Upcoming events:')
|
||||||
debug.print(upcoming)
|
debug.print_line(upcoming)
|
||||||
debug.print('Month events:')
|
debug.print_line('Month events:')
|
||||||
debug.print(events_this_month)
|
debug.print_line(events_this_month)
|
||||||
|
|
||||||
#Credit to Hubert for suggesting truncating event names
|
#Credit to Hubert for suggesting truncating event names
|
||||||
def write_text_left (box_width, box_height, text, tuple):
|
def write_text_left (box_width, box_height, text, tuple):
|
||||||
|
@ -260,7 +260,7 @@ def main ():
|
||||||
for output in output_adapters:
|
for output in output_adapters:
|
||||||
output.render(image)
|
output.render(image)
|
||||||
|
|
||||||
debug.print("Finished rendering")
|
debug.print_line("Finished rendering")
|
||||||
|
|
||||||
for i in range(1):
|
for i in range(1):
|
||||||
nexthour = ((60 - int(time.strftime("%M"))) * 60) - (int(time.strftime("%S")))
|
nexthour = ((60 - int(time.strftime("%M"))) * 60) - (int(time.strftime("%S")))
|
||||||
|
|
Loading…
Reference in a new issue