From ec59f279bdb6b51c53464e4fd9c0553bd9f4f571 Mon Sep 17 00:00:00 2001 From: Ace Date: Wed, 1 May 2019 23:48:48 +0200 Subject: [PATCH] Some improvements Added dictionary containing the positions of the rows for the Agenda-View. Added a second seperator (seperator2) which is used by the Agenda View. Added support for relative path instead of explicit path (Credit to Max. G.) --- Calendar/icon_positions_locations.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Calendar/icon_positions_locations.py b/Calendar/icon_positions_locations.py index 324a423..b1450fc 100644 --- a/Calendar/icon_positions_locations.py +++ b/Calendar/icon_positions_locations.py @@ -8,8 +8,12 @@ It also contains the positions of these icons on the E-Paper display from PIL import Image from settings import language im_open = Image.open +import os + +path = os.path.dirname(os.path.abspath(__file__)).replace("\\", "/") +if path != "" and path[-1] != "/": + path += "/" -path = '/home/pi/Inky-Calendar/Calendar/' wpath = path+'weather-icons/' mpath = path+'translations/'+language+'/months/' weekpath = path+'translations/'+language+'/week/' @@ -20,6 +24,7 @@ weekday = im_open(opath+'weekday.png') eventicon = im_open(opath+'event.png') dateicon = im_open(opath+'today.png') seperator = im_open(opath+'seperator.jpeg') +seperator2 = im_open(opath+'seperator2.jpeg') tempicon = im_open(opath+'temperature.jpeg') humicon = im_open(opath+'humidity.jpeg') weekmon = im_open(weekpath+'week-mon.jpeg') @@ -42,6 +47,21 @@ windiconspace = (79, 0) sunriseplace = (214, 0) sunsetplace = (214, 35) +col = 0 +agenda_view_lines = { + 'line1': (col, 75), 'line2': (col, 100), + 'line3': (col, 125), 'line4': (col, 150), + 'line5': (col, 175), 'line6': (col, 200), + 'line7': (col, 225), 'line8': (col, 250), + 'line9': (col, 275), 'line10': (col, 300), + 'line11': (col, 325), 'line12': (col, 350), + 'line13': (col, 375), 'line14': (col, 400), + 'line15': (col, 425), 'line16': (col, 450), + 'line17': (col, 475), 'line18': (col, 500), + 'line19': (col, 525), 'line20': (col, 550), + 'line21': (col, 575), 'line22': (col, 600), + } + rss_places = { 'line_1' : (0, 490), 'line_2' : (0, 515), 'line_3' : (0, 540), 'line_4' : (0, 565), 'line_5' : (0, 590), 'line_6' : (0, 615)