def _apply_value(self, model, iter_, cell, stamp): if not stamp: cell.set_property('text', _("Never")) else: fmt = config.gettext("settings", "datecolumn_timestamp_format") text = format_date(stamp, fmt) cell.set_property('text', text)
def test_numeric(self): a_date_format = "%Y-%m-%d" config.set("settings", "datecolumn_timestamp_format", a_date_format) p = PaneConfig("~#lastplayed") self.failUnlessEqual(p.title, "Last Played") self.failUnlessEqual(p.tags, {"~#lastplayed"}) zero_date = format_date(0, a_date_format) self.failUnlessEqual(p.format(SONGS[0]), [(zero_date, zero_date)]) self.failIf(p.has_markup)
def format(song: AudioFile) -> List[Tuple[Text, Text]]: fmt = config.gettext("settings", "datecolumn_timestamp_format") date_str = format_date(song(cat), fmt) return [(date_str, date_str)]