Improved code logic for better support with web-ui
Fixed some minor bugs too
This commit is contained in:
		| @@ -66,13 +66,18 @@ class Agenda(inkycal_module): | |||||||
|     self.date_format = config['date_format'] |     self.date_format = config['date_format'] | ||||||
|     self.time_format = config['time_format'] |     self.time_format = config['time_format'] | ||||||
|     self.language = config['language'] |     self.language = config['language'] | ||||||
|     self.ical_urls = config['ical_urls'].split(',') |  | ||||||
|  |  | ||||||
|     # Check if ical_files is an empty string |     # Check if ical_files is an empty string | ||||||
|     if config['ical_files'] != "": |     if config['ical_urls']: | ||||||
|  |       self.ical_urls = config['ical_urls'].split(',') | ||||||
|  |     else: | ||||||
|  |       self.ical_urls = config['ical_urls'] | ||||||
|  |  | ||||||
|  |     # Check if ical_files is an empty string | ||||||
|  |     if config['ical_files']: | ||||||
|       self.ical_files = config['ical_files'].split(',') |       self.ical_files = config['ical_files'].split(',') | ||||||
|     else: |     else: | ||||||
|       self.ical_files = [] |       self.ical_files = config['ical_files'] | ||||||
|  |  | ||||||
|     # Additional config |     # Additional config | ||||||
|     self.timezone = get_system_tz() |     self.timezone = get_system_tz() | ||||||
|   | |||||||
| @@ -65,20 +65,20 @@ class Calendar(inkycal_module): | |||||||
|  |  | ||||||
|     # optional parameters |     # optional parameters | ||||||
|     self.weekstart = config['week_starts_on'] |     self.weekstart = config['week_starts_on'] | ||||||
|     self.show_events = bool(config['show_events']) |     self.show_events = config['show_events'] | ||||||
|     self.date_format = config["date_format"] |     self.date_format = config["date_format"] | ||||||
|     self.time_format = config['time_format'] |     self.time_format = config['time_format'] | ||||||
|     self.language = config['language'] |     self.language = config['language'] | ||||||
|  |  | ||||||
|     if config['ical_urls'] != "": |     if config['ical_urls']: | ||||||
|       self.ical_urls = config['ical_urls'].split(',') |       self.ical_urls = config['ical_urls'].split(',') | ||||||
|     else: |     else: | ||||||
|       self.ical_urls = [] |       self.ical_urls = config['ical_urls'] | ||||||
|  |  | ||||||
|     if config['ical_files'] != "": |     if config['ical_files']: | ||||||
|       self.ical_files = config['ical_files'].split(',') |       self.ical_files = config['ical_files'].split(',') | ||||||
|     else: |     else: | ||||||
|       self.ical_files = [] |       self.ical_files = config['ical_files'] | ||||||
|  |  | ||||||
|     # additional configuration |     # additional configuration | ||||||
|     self.timezone = get_system_tz() |     self.timezone = get_system_tz() | ||||||
| @@ -117,7 +117,7 @@ class Calendar(inkycal_module): | |||||||
|       logger.debug(f'events-section size: {im_width} x {events_height} px') |       logger.debug(f'events-section size: {im_width} x {events_height} px') | ||||||
|     else: |     else: | ||||||
|       logger.debug("Not allocating space for events") |       logger.debug("Not allocating space for events") | ||||||
|       calendar_height = im_height - month_name_height - weekday_height |       calendar_height = im_height - month_name_height - weekdays_height | ||||||
|       logger.debug(f'calendar-section size: {im_width} x {calendar_height} px') |       logger.debug(f'calendar-section size: {im_width} x {calendar_height} px') | ||||||
|  |  | ||||||
|     # Create a 7x6 grid and calculate icon sizes |     # Create a 7x6 grid and calculate icon sizes | ||||||
|   | |||||||
| @@ -60,7 +60,7 @@ class Feeds(inkycal_module): | |||||||
|     self.feed_urls = self.config["feed_urls"].split(",") |     self.feed_urls = self.config["feed_urls"].split(",") | ||||||
|  |  | ||||||
|     # optional parameters |     # optional parameters | ||||||
|     self.shuffle_feeds = bool(self.config["shuffle_feeds"]) |     self.shuffle_feeds = self.config["shuffle_feeds"] | ||||||
|  |  | ||||||
|     # give an OK message |     # give an OK message | ||||||
|     print('{0} loaded'.format(filename)) |     print('{0} loaded'.format(filename)) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user