def update_creation(self): """Update the author and date """ author = self.pres.meta.get('author', '') author_spec = spec_from_style(config.STYLE["author"]) date = self.pres.meta.get('date', '') date_spec = spec_from_style(config.STYLE["date"]) self.creation.set_text([ (author_spec, f" {author} "), (date_spec, f" {date} "), ])
def update_slide_num(self): """Update the slide number """ slide_text = "slide {} / {}".format( self.curr_slide.number + 1, len(self.pres.slides), ) date = self.pres.meta.get('date', '') spec = spec_from_style(config.STYLE["slides"]) self.slide_num.set_text([(spec, slide_text)])
def update_title(self): """Update the title """ title = self.pres.meta.get("title", "") spec = spec_from_style(config.STYLE["title"]) self.slide_title.set_text([(spec, f" {title} ")])
def text(style, data, align="left"): if isinstance(style, dict): style = spec_from_style(style) return urwid.Text((style, data), align=align)