From 1bd404af976e8fe292a1792fc6455e4c83f0f1ec Mon Sep 17 00:00:00 2001 From: Ace Date: Thu, 12 Nov 2020 21:19:51 +0100 Subject: [PATCH] Code cleanup --- inkycal/modules/ical_parser.py | 6 +++--- inkycal/modules/inkycal_feeds.py | 6 +++--- inkycal/modules/inkycal_image.py | 7 ------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/inkycal/modules/ical_parser.py b/inkycal/modules/ical_parser.py index cb437b0..143e6fe 100644 --- a/inkycal/modules/ical_parser.py +++ b/inkycal/modules/ical_parser.py @@ -128,11 +128,11 @@ class iCalendar: events = ( { 'title': events.get('SUMMARY').lstrip(), - + 'begin': arrow.get(events.get('DTSTART').dt).to(timezone) if ( arrow.get(events.get('dtstart').dt).format('HH:mm') != '00:00') else arrow.get(events.get('DTSTART').dt).replace(tzinfo=timezone), - + 'end':arrow.get(events.get("DTEND").dt).to(timezone) if ( arrow.get(events.get('dtstart').dt).format('HH:mm') != '00:00') else arrow.get(events.get('DTEND').dt).replace(tzinfo=timezone) @@ -211,4 +211,4 @@ class iCalendar: if __name__ == '__main__': - print('running {0} in standalone mode'.format(filename)) \ No newline at end of file + print('running {0} in standalone mode'.format(filename)) diff --git a/inkycal/modules/inkycal_feeds.py b/inkycal/modules/inkycal_feeds.py index ae97fc0..5be0a91 100644 --- a/inkycal/modules/inkycal_feeds.py +++ b/inkycal/modules/inkycal_feeds.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """ -RSS module for inkyCal Project +RSS module for InkyCal Project Copyright by aceisace """ @@ -57,10 +57,10 @@ class Feeds(inkycal_module): raise Exception('config is missing {}'.format(param)) # required parameters - self.feed_urls = self.config["feed_urls"].split(",") + self.feed_urls = config["feed_urls"].split(",") # optional parameters - self.shuffle_feeds = self.config["shuffle_feeds"] + self.shuffle_feeds = config["shuffle_feeds"] # give an OK message print('{0} loaded'.format(filename)) diff --git a/inkycal/modules/inkycal_image.py b/inkycal/modules/inkycal_image.py index fddb915..448b2b7 100644 --- a/inkycal/modules/inkycal_image.py +++ b/inkycal/modules/inkycal_image.py @@ -300,10 +300,3 @@ class Inkyimage(inkycal_module): if __name__ == '__main__': print('running {0} in standalone/debug mode'.format(filename)) - - #a = Inkyimage((480,800), {'path': "https://raw.githubusercontent.com/aceisace/Inky-Calendar/dev_ver2_0/Gallery/logo.png"}) - #a = Inkyimage((480,800), {'path': "https://raw.githubusercontent.com/aceisace/Inky-Calendar/dev_ver2_0/Gallery/logo.png"}) - a = Inkyimage((480, 800), {'path': "/home/pi/Desktop/im/IMG_0475.JPG"}) - a.generate_image() - -