Removed unnecessary features, changed some details and activated wrapping
This commit is contained in:
parent
81a4e5c4c5
commit
69fce8c8d2
1 changed files with 3 additions and 8 deletions
|
@ -1,12 +1,10 @@
|
||||||
from DesignEntity import DesignEntity
|
from DesignEntity import DesignEntity
|
||||||
from TableTextDesign import TableTextDesign
|
from TableTextDesign import TableTextDesign
|
||||||
|
|
||||||
col_sizes = [0.15, 0.85]
|
|
||||||
|
|
||||||
class RssPostListDesign (DesignEntity):
|
class RssPostListDesign (DesignEntity):
|
||||||
"""Creates a TableTextDesign filled with rss post
|
"""Creates a TableTextDesign filled with rss post
|
||||||
date and title"""
|
date and title"""
|
||||||
def __init__ (self, size, rssfeed, text_size = 16):
|
def __init__ (self, size, rssfeed, text_size = 18):
|
||||||
super(RssPostListDesign, self).__init__(size)
|
super(RssPostListDesign, self).__init__(size)
|
||||||
self.rssfeed = rssfeed
|
self.rssfeed = rssfeed
|
||||||
self.__post_matrix__ = []
|
self.__post_matrix__ = []
|
||||||
|
@ -14,17 +12,14 @@ class RssPostListDesign (DesignEntity):
|
||||||
|
|
||||||
def __finish_image__ (self):
|
def __finish_image__ (self):
|
||||||
self.__fill_post_matrix__()
|
self.__fill_post_matrix__()
|
||||||
|
|
||||||
max_col_size = [int(col_sizes[0] * self.size[0]), int(col_sizes[1] * self.size[0])]
|
|
||||||
col_hori_alignment = ['right', 'left']
|
|
||||||
|
|
||||||
table_design = TableTextDesign(self.size, line_spacing=3, col_spacing=10, text_matrix=self.__post_matrix__, fontsize = self.text_size, column_horizontal_alignments=col_hori_alignment, mask=False, max_col_size = max_col_size, truncate_cols=False)
|
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)
|
||||||
self.draw_design(table_design)
|
self.draw_design(table_design)
|
||||||
|
|
||||||
def __get_formatted_post__ (self, post):
|
def __get_formatted_post__ (self, post):
|
||||||
date = post.datetime.strftime('%d %b')
|
date = post.datetime.strftime('%d %b')
|
||||||
date = self.__remove_leading_zero__(date)
|
date = self.__remove_leading_zero__(date)
|
||||||
return [ date, post.title ]
|
return [ '•', post.title ]
|
||||||
|
|
||||||
def __remove_leading_zero__(self, text):
|
def __remove_leading_zero__(self, text):
|
||||||
while text[0] is '0':
|
while text[0] is '0':
|
||||||
|
|
Loading…
Reference in a new issue