diff --git a/Calendar/AgendaListDesign.py b/Calendar/AgendaListDesign.py index 5662b81..6569b80 100644 --- a/Calendar/AgendaListDesign.py +++ b/Calendar/AgendaListDesign.py @@ -1,7 +1,7 @@ from DesignEntity import DesignEntity from Assets import defaultfontsize, colors from datetime import datetime, date, timedelta -from TableTextDesign import TableTextDesign +from TableDesign import TableDesign from PIL import ImageDraw from TextFormatter import date_summary_str, event_prefix_str @@ -59,7 +59,7 @@ class AgendaListDesign (DesignEntity): self.cell_props.insert(0, props) def __draw_infos__ (self): - table = TableTextDesign(self.size, self.infos, fontsize = self.__date_fontsize__, line_spacing=self.__date_linespace__, col_spacing = self.col_spacing, cell_properties=self.cell_props) + table = TableDesign(self.size, self.infos, fontsize = self.__date_fontsize__, line_spacing=self.__date_linespace__, col_spacing = self.col_spacing, cell_properties=self.cell_props) self.draw_design(table) def __draw_lines__ (self): diff --git a/Calendar/DayListPanel.py b/Calendar/DayListPanel.py index d517da9..a9d3d9a 100644 --- a/Calendar/DayListPanel.py +++ b/Calendar/DayListPanel.py @@ -1,6 +1,6 @@ from PanelDesign import PanelDesign -from Assets import * -from settings import * +from Assets import colors +from settings import general_settings import calendar as callib from datetime import datetime, timedelta, date from PIL import ImageDraw diff --git a/Calendar/EventListDesign.py b/Calendar/EventListDesign.py index c2ea431..a7772c6 100644 --- a/Calendar/EventListDesign.py +++ b/Calendar/EventListDesign.py @@ -1,11 +1,11 @@ from DesignEntity import DesignEntity -from TableTextDesign import TableTextDesign +from TableDesign import TableDesign from settings import language from Assets import defaultfontsize, colors from TextFormatter import date_str class EventListDesign (DesignEntity): - """Creates a TableTextDesign filled with event + """Creates a TableDesign filled with event begin date and title""" def __init__ (self, size, events, text_size = defaultfontsize, line_spacing = 2, col_spacing = 10, event_prefix_rel_dates = [], event_prefix_func = None, font_family = None, general_color = colors["fg"], background_color = colors["bg"], highlight_color = colors["hl"], show_more_info = False): super(EventListDesign, self).__init__(size) @@ -30,7 +30,7 @@ class EventListDesign (DesignEntity): self.__fill_event_matrix__() col_hori_alignment = [ 'right', 'left' ] - table_design = TableTextDesign(self.size, background_color = self.background_color, font=self.font_family, line_spacing=self.line_spacing, col_spacing=self.col_spacing, text_matrix=self.__event_matrix__, fontsize = self.text_size, column_horizontal_alignments=col_hori_alignment, mask=False, truncate_cols=False, cell_properties=self.__props_matrix__) + table_design = TableDesign(self.size, background_color = self.background_color, font=self.font_family, line_spacing=self.line_spacing, col_spacing=self.col_spacing, text_matrix=self.__event_matrix__, fontsize = self.text_size, column_horizontal_alignments=col_hori_alignment, mask=False, truncate_cols=False, cell_properties=self.__props_matrix__) self.draw_design(table_design) def __get_formatted_event__ (self, event, index): diff --git a/Calendar/MonthBlockDesign.py b/Calendar/MonthBlockDesign.py index 87c853b..53d9295 100644 --- a/Calendar/MonthBlockDesign.py +++ b/Calendar/MonthBlockDesign.py @@ -2,8 +2,8 @@ from DesignEntity import DesignEntity import calendar as callib from datetime import datetime, timedelta from TextDesign import TextDesign -from Assets import * -from settings import * +from Assets import colors +from settings import week_starts_on from BoxDesign import BoxDesign daynumberboxsize = (0.143, 0.2) #(0.143, 0.286) diff --git a/Calendar/MonthOvPanel.py b/Calendar/MonthOvPanel.py index 12cd03f..ab19429 100644 --- a/Calendar/MonthOvPanel.py +++ b/Calendar/MonthOvPanel.py @@ -1,6 +1,6 @@ from PanelDesign import PanelDesign -from Assets import * -from settings import * +from Assets import colors +from settings import general_settings, week_starts_on import calendar as callib from datetime import datetime, timedelta from WeatherHeaderDesign import WeatherHeaderDesign diff --git a/Calendar/RssPostListDesign.py b/Calendar/RssPostListDesign.py index 0162f95..96074ea 100644 --- a/Calendar/RssPostListDesign.py +++ b/Calendar/RssPostListDesign.py @@ -1,9 +1,9 @@ from DesignEntity import DesignEntity -from TableTextDesign import TableTextDesign +from TableDesign import TableDesign from Assets import defaultfontsize class RssPostListDesign (DesignEntity): - """Creates a TableTextDesign filled with rss post + """Creates a TableDesign filled with rss post date and title""" def __init__ (self, size, rssfeed, text_size = defaultfontsize): super(RssPostListDesign, self).__init__(size) @@ -14,7 +14,7 @@ class RssPostListDesign (DesignEntity): def __finish_image__ (self): self.__fill_post_matrix__() - table_design = TableTextDesign(self.size, line_spacing=5, col_spacing=3, text_matrix=self.__post_matrix__, fontsize = self.text_size, mask=False, truncate_cols=False, wrap=True) + table_design = TableDesign(self.size, line_spacing=5, col_spacing=3, text_matrix=self.__post_matrix__, fontsize = self.text_size, mask=False, truncate_cols=False, wrap=True) self.draw_design(table_design) def __get_formatted_post__ (self, post): diff --git a/Calendar/TableTextDesign.py b/Calendar/TableDesign.py similarity index 97% rename from Calendar/TableTextDesign.py rename to Calendar/TableDesign.py index 9dd39f8..c5bcfff 100644 --- a/Calendar/TableTextDesign.py +++ b/Calendar/TableDesign.py @@ -8,11 +8,11 @@ default_props = { "background_color" : colors["bg"] } -class TableTextDesign (TextDesign): - """Gets a matrix with text that is than +class TableDesign (TextDesign): + """Gets a matrix with text or designs that is than displayed in a table without borders.""" def __init__ (self, size, text_matrix, max_col_size = None, max_row_size = None, font = None, fontsize = defaultfontsize, column_horizontal_alignments = [], mask = True, line_spacing = 0, col_spacing = 0, truncate_rows = True, truncate_cols = True, wrap = False, truncate_text=True, truncate_suffix="...", cell_properties=None, background_color = colors["bg"]): - super(TableTextDesign, self).__init__(size, font=font, fontsize=fontsize, mask=mask) + super(TableDesign, self).__init__(size, font=font, fontsize=fontsize, mask=mask) self.__init_image__(background_color) self.matrix = text_matrix self.max_col_size = max_col_size diff --git a/Calendar/WeatherColumnDesign.py b/Calendar/WeatherColumnDesign.py index e8436f6..eff51b6 100644 --- a/Calendar/WeatherColumnDesign.py +++ b/Calendar/WeatherColumnDesign.py @@ -1,6 +1,6 @@ from DesignEntity import DesignEntity from TextDesign import TextDesign -from TableTextDesign import TableTextDesign +from TableDesign import TableDesign from Assets import wpath, weathericons, tempicon, humicon, windicon, no_response, colors, defaultfontsize from PIL import Image from settings import hours @@ -41,7 +41,7 @@ class WeatherColumnDesign (DesignEntity): size = (self.size[0], self.size[1] - pos[1]) line_spacing = (size[1] - len(numbers_list) * fontsize_static) / (len(numbers_list) + 1) - table = TableTextDesign(size, numbers_list, fontsize=fontsize_static, line_spacing=line_spacing, column_horizontal_alignments=[ "center" ], max_col_size=[ size[0] ], truncate_text=False) + table = TableDesign(size, numbers_list, fontsize=fontsize_static, line_spacing=line_spacing, column_horizontal_alignments=[ "center" ], max_col_size=[ size[0] ], truncate_text=False) table.pos = pos self.draw_design(table)