Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
 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)]