Added info about current day
This commit is contained in:
parent
63b702cbb4
commit
904c50224c
1 changed files with 8 additions and 1 deletions
|
@ -9,13 +9,14 @@ line_width = 1
|
||||||
|
|
||||||
class AgendaListDesign (DesignEntity):
|
class AgendaListDesign (DesignEntity):
|
||||||
'''Lists upcoming events in chronological order and groups them by days'''
|
'''Lists upcoming events in chronological order and groups them by days'''
|
||||||
def __init__ (self, size, calendar, line_spacing = 3, col_spacing = 8, text_size = defaultfontsize, start_date = date.today()):
|
def __init__ (self, size, calendar, line_spacing = 3, col_spacing = 8, text_size = defaultfontsize, start_date = date.today(), always_add_start_row = True):
|
||||||
super(AgendaListDesign, self).__init__(size)
|
super(AgendaListDesign, self).__init__(size)
|
||||||
self.calendar = calendar
|
self.calendar = calendar
|
||||||
self.line_spacing = line_spacing
|
self.line_spacing = line_spacing
|
||||||
self.col_spacing = col_spacing
|
self.col_spacing = col_spacing
|
||||||
self.text_size = text_size
|
self.text_size = text_size
|
||||||
self.start_dt = datetime(start_date.year, start_date.month, start_date.day)
|
self.start_dt = datetime(start_date.year, start_date.month, start_date.day)
|
||||||
|
self.always_add_start_row = always_add_start_row
|
||||||
|
|
||||||
def __finish_image__ (self):
|
def __finish_image__ (self):
|
||||||
self.__calculate_parameter__()
|
self.__calculate_parameter__()
|
||||||
|
@ -51,6 +52,12 @@ class AgendaListDesign (DesignEntity):
|
||||||
self.infos.append(row)
|
self.infos.append(row)
|
||||||
fetch_day = fetch_day + timedelta(1)
|
fetch_day = fetch_day + timedelta(1)
|
||||||
|
|
||||||
|
if self.infos[0][1] != date_summary_str(self.start_dt) and self.always_add_start_row:
|
||||||
|
row = ["", date_summary_str(self.start_dt), "", ""]
|
||||||
|
props = self.__get_row_props__()
|
||||||
|
self.infos.insert(0, row)
|
||||||
|
self.cell_props.insert(0, props)
|
||||||
|
|
||||||
def __draw_infos__ (self):
|
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 = TableTextDesign(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)
|
self.draw_design(table)
|
||||||
|
|
Loading…
Reference in a new issue