Removed unnecessary comments and imports
This commit is contained in:
parent
3ce63dd74d
commit
7043911cb8
1 changed files with 5 additions and 25 deletions
|
@ -7,7 +7,6 @@ If you have any questions, feel free to open an issue at Github.
|
|||
|
||||
Copyright by aceisace
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from datetime import datetime
|
||||
from time import sleep
|
||||
from Assets import datetime_locals
|
||||
|
@ -15,7 +14,6 @@ import locale
|
|||
from DebugConsole import DebugConsole
|
||||
from settings import *
|
||||
from MonthOvPanel import MonthOvPanel
|
||||
from WeatherHeaderDesign import WeatherHeaderDesign
|
||||
import OwmForecasts
|
||||
import IcalEvents
|
||||
|
||||
|
@ -48,8 +46,8 @@ def main ():
|
|||
year = int(time.now().strftime('%Y'))
|
||||
|
||||
for i in range(1):
|
||||
debug.print_line('_________Starting new loop___________' + '\n')
|
||||
debug.print_line('Date:'+ time.strftime('%a %d %b %y') + ', time: ' + time.strftime('%H:%M') + '\n')
|
||||
debug.print_line('_________Starting new loop___________')
|
||||
debug.print_line('Date: '+ time.strftime('%a %d %b %y') + ', time: ' + time.strftime('%H:%M') + '\n')
|
||||
|
||||
if hour in calibrate_hours:
|
||||
for output in output_adapters:
|
||||
|
@ -57,36 +55,18 @@ def main ():
|
|||
|
||||
design = MonthOvPanel((epd.width, epd.height))
|
||||
|
||||
debug.print_line("Connecting to Openweathermap API servers...")
|
||||
debug.print_line("Fetching weather information from open weather map'")
|
||||
owm = OwmForecasts.OwmForecasts(api_key)
|
||||
design.add_weather(OwmForecasts.OwmForecasts(api_key))
|
||||
|
||||
debug.print_line('Fetching events from your calendar' + '\n')
|
||||
debug.print_line('Fetching events from your calendar')
|
||||
events_cal = IcalEvents.IcalEvents(ical_urls)
|
||||
design.add_calendar(events_cal)
|
||||
|
||||
##Credit to Hubert for suggesting truncating event names
|
||||
#def write_text_left (box_width, box_height, text, tuple):
|
||||
# text_width, text_height = font.getsize(text)
|
||||
# while (text_width, text_height) > (box_width, box_height):
|
||||
# text=text[0:-1]
|
||||
# text_width, text_height = font.getsize(text)
|
||||
# y = int((box_height / 2) - (text_height / 2))
|
||||
# space = Image.new('L', (box_width, box_height), color=255)
|
||||
# ImageDraw.Draw(space).text((0, y), text, fill=0, font=font)
|
||||
# image.paste(space, tuple)
|
||||
|
||||
#"""Write event dates and names on the E-Paper"""
|
||||
#for dates in range(len(upcoming)):
|
||||
# write_text(70, 25, (upcoming[dates].begin_datetime.strftime('%d %b')), date_positions['d' + str(dates + 1)])
|
||||
|
||||
#for events in range(len(upcoming)):
|
||||
# write_text_left(314, 25, (upcoming[events].title), event_positions['e' + str(events + 1)])
|
||||
|
||||
for output in output_adapters:
|
||||
output.render(design)
|
||||
|
||||
debug.print_line("Finished rendering")
|
||||
debug.print_line("=> Finished rendering" + "\n")
|
||||
|
||||
for i in range(1):
|
||||
nexthour = ((60 - int(time.strftime("%M"))) * 60) - (int(time.strftime("%S")))
|
||||
|
|
Loading…
Reference in a new issue