Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cjoshmartin committed Feb 2, 2020
1 parent e312801 commit 0930957
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/Display.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ def __init__(self, width: int, height: int, type_of_display: str):
self.image_black = None
self.draw_black = None

self.image_red = None
self.draw_red = None
self.image_red = None
self.draw_red = None
self.update_moment = time.strftime("%I") + ':' + time.strftime("%M") + ' ' + time.strftime("%p")

self.fonts = Fonts()

self.reset_screen()

def header_title(self, title: str) -> None:
self.draw_red.rectangle((245,0, 640, 55), fill = 0) # Task area banner
self.draw_red.text((250,10), title, font = self.fonts.tasks_list_title, fill = 255) # Task text
self.draw_red.rectangle((245, 0, 640, 55), fill=0) # Task area banner
self.draw_red.text((250, 10), title, font=self.fonts.tasks_list_title, fill=255) # Task text

def reset_screen(self):
images_size = (self.width, self.height)
Expand All @@ -34,11 +36,15 @@ def reset_screen(self):
self.image_red = Image.new('1', images_size, (1))
self.draw_red = ImageDraw.Draw(self.image_red)

self.draw_black.rectangle((0,0,240, 384), fill = 0) # Calender area rectangle
self.draw_black.line((10,320,230,320), fill = 255) # Weather line
self.draw_black.line((250,320,640,320), fill = 0) # Footer for additional items
self.draw_red.rectangle((245,0, 640, 55), fill = 0) # Task area banner
#self.draw_black.text((585,370),update_moment,font = font_update_moment, fill = 255) # The update moment in Pooch
self.draw_black.rectangle((0, 0, 240, 384), fill=0) # Calender area rectangle
self.draw_black.line((10, 320, 230, 320), fill=255) # Weather line
self.draw_black.line((250, 320, 640, 320), fill=0) # Footer for additional items
self.draw_red.rectangle((245, 0, 640, 55), fill=0) # Task area banner

self.update_moment = time.strftime("%I") + ':' + time.strftime("%M") + ' ' + time.strftime("%p")
self.draw_black.text((585, 370), self.update_moment, font=self.fonts.update_moment,
fill=255) # The update moment in Pooch

def refresh(self):
logging.info("Display: Refreshing on A {} Display".format(self.type_of_display))
self.show()
Expand Down

0 comments on commit 0930957

Please sign in to comment.