diff --git a/Calendar/icon_positions_locations.py b/Calendar/icon_positions_locations.py index 8328f13..512d670 100644 --- a/Calendar/icon_positions_locations.py +++ b/Calendar/icon_positions_locations.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- from PIL import Image, ImageFont from settings import * -open = Image.open +im_open = Image.open path = '/home/pi/E-Paper-Master/Calendar/' wpath = path+'weather-icons/' @@ -11,18 +11,18 @@ dpath = path+'days/' opath = path+'other/'+language+'/' font = ImageFont.truetype(path+'Assistant-Bold.ttf', 18) -weekday = open(opath+'weekday.bmp') -eventicon = open(opath+'event.bmp') -dateicon = open(opath+'today.bmp') -tempicon = open(opath+'temp-icon.bmp') -humicon = open(opath+'hum-icon.bmp') -weekmon = open(opath+'week-mon.bmp') -weeksun = open(opath+'week-sun.bmp') -seperator = open(opath+'seperator.bmp') -no_response= open(opath+'cloud-no-response.bmp').convert('L') -sunriseicon = open(wpath+'wi-sunrise.bmp').convert('L') -sunseticon = open(wpath+'wi-sunset.bmp').convert('1') -windicon = open(wpath+'wi-strong-wind.bmp').convert('L') +weekday = im_open(opath+'weekday.bmp') +eventicon = im_open(opath+'event.bmp') +dateicon = im_open(opath+'today.bmp') +tempicon = im_open(opath+'temp-icon.bmp') +humicon = im_open(opath+'hum-icon.bmp') +weekmon = im_open(opath+'week-mon.bmp') +weeksun = im_open(opath+'week-sun.bmp') +separator = im_open(opath+'separator.bmp') +no_response= im_open(opath+'cloud-no-response.bmp').convert('L') +sunriseicon = im_open(wpath+'wi-sunrise.bmp').convert('L') +sunseticon = im_open(wpath+'wi-sunset.bmp').convert('1') +windicon = im_open(wpath+'wi-strong-wind.bmp').convert('L') wiconplace = (570, 0) tempplace = (605, 310) @@ -34,17 +34,58 @@ windiconspace = (605, 100) sunriseplace = (605,210) sunsetplace = (570,210) -weekdaysmon = {'Mon': (416,3), 'Tue': (416,57), 'Wed': (416,111), 'Thu': (416,165), 'Fri': (416,219), 'Sat': (416,273), 'Sun':(416,327)} -weekdayssun = {'Sun': (416,3), 'Mon': (416,57), 'Tue': (416,111), 'Wed': (416,165), 'Thu': (416,219), 'Fri': (416,273), 'Sat':(416,327)} +week_row = 416 -positions = {'a1': (351, 3), 'a2': (351, 57), 'a3': (351, 111), 'a4': (351, 165), 'a5': (351, 219), 'a6': (351, 273), 'a7': (351, 327), -'b1': (284, 3), 'b2': (284, 57), 'b3': (284, 111), 'b4': (284, 165), 'b5': (284, 219), 'b6': (284, 273), 'b7': (284, 327), -'c1': (217, 3), 'c2': (217, 57), 'c3': (217, 111), 'c4': (217, 165), 'c5': (217, 219), 'c6': (217, 273), 'c7': (217, 327), -'d1': (150, 3), 'd2': (150, 57), 'd3': (150, 111), 'd4': (150, 165), 'd5': (150, 219), 'd6': (150, 273), 'd7': (150, 327), -'e1': (83, 3), 'e2': (83, 57), 'e3': (83, 111), 'e4': (83, 165), 'e5': (83, 219), 'e6': (83, 273), 'e7': (83, 327), -'f1': (16, 3), 'f2': (16, 57), 'f3': (16, 111), 'f4': (16, 165), 'f5': (16, 219), 'f6': (16, 273), 'f7': (16, 327)} +row1 = 351 +row2 = 284 +row3 = 217 +row4 = 150 +row5 = 83 +row6 = 16 -weathericons = {'01d': 'wi-day-sunny', '02d':'wi-day-cloudy', '03d': 'wi-cloudy', +col1 = 3 +col2 = 57 +col3 = 111 +col4 = 165 +col5 = 219 +col6 = 273 +col7 = 327 + + +weekdaysmon = { +'Mon': (week_row,col1), 'Tue': (week_row,col2), 'Wed': (week_row,col3), +'Thu': (week_row,col4), 'Fri': (week_row,col5), 'Sat': (week_row,col6), +'Sun': (week_row,col7) +} + +weekdayssun = { +'Sun': (week_row,col1), 'Mon': (week_row,col2), 'Tue': (week_row,col3), +'Wed': (week_row,col4), 'Thu': (week_row,col5), 'Fri': (week_row,col6), +'Sat':(week_row,col7) +} + +positions = { +'a1': (row1, col1), 'a2': (row1, col2), 'a3': (row1, col3), 'a4': (row1, col4), +'a5': (row1, col5), 'a6': (row1, col6), 'a7': (row1, col7), + +'b1': (row2, col1), 'b2': (row2, col2), 'b3': (row2, col3), 'b4': (row2, col4), +'b5': (row2, col5), 'b6': (row2, col6), 'b7': (row2, col7), + +'c1': (row3, col1), 'c2': (row3, col2), 'c3': (row3, col3), 'c4': (row3, col4), +'c5': (row3, col5), 'c6': (row3, col6), 'c7': (row3, col7), + +'d1': (row4, col1), 'd2': (row4, col2), 'd3': (row4, col3), 'd4': (row4, col4), +'d5': (row4, col5), 'd6': (row4, col6), 'd7': (row4, col7), + +'e1': (row5, col1), 'e2': (row5, col2), 'e3': (row5, col3), 'e4': (row5, col4), +'e5': (row5, col5), 'e6': (row5, col6), 'e7': (row5, col7), + +'f1': (row6, col1), 'f2': (row6, col2), 'f3': (row6, col3), 'f4': (row6, col4), +'f5': (row6, col5), 'f6': (row6, col6), 'f7': (row6, col7) +} + +weathericons = { +'01d': 'wi-day-sunny', '02d':'wi-day-cloudy', '03d': 'wi-cloudy', '04d': 'wi-cloudy-windy', '09d': 'wi-showers', '10d':'wi-rain', '11d':'wi-thunderstorm', '13d':'wi-snow', '50d': 'wi-fog', '01n': 'wi-night-clear', '02n':'wi-night-cloudy',