diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-08-02 11:13:58 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-08-02 11:13:58 +0000 |
| commit | f633dc405709001c4c90fb5259fe4bbe4609296f (patch) | |
| tree | b70a1cdf9fefc1a3db7c18094108b5f93030735b /lib/python | |
| parent | 1b2fe6621d12df28e2e2cd12e0b8db004d3ff513 (diff) | |
| download | enigma2-f633dc405709001c4c90fb5259fe4bbe4609296f.tar.gz enigma2-f633dc405709001c4c90fb5259fe4bbe4609296f.zip | |
Add AsLength option to ClockToText Converter
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Components/Converter/ClockToText.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/python/Components/Converter/ClockToText.py b/lib/python/Components/Converter/ClockToText.py index 6623f248..109f9125 100644 --- a/lib/python/Components/Converter/ClockToText.py +++ b/lib/python/Components/Converter/ClockToText.py @@ -8,6 +8,7 @@ class ClockToText(Converter, object): IN_MINUTES = 2 DATE = 3 FORMAT = 4 + AS_LENGTH = 5 # add: date, date as string, weekday, ... # (whatever you need!) @@ -20,6 +21,8 @@ class ClockToText(Converter, object): self.type = self.IN_MINUTES elif type == "Date": self.type = self.DATE + elif type == "AsLength": + self.type = self.AS_LENGTH elif str(type).find("Format") != -1: self.type = self.FORMAT self.fmt_string = type[7:] @@ -35,6 +38,8 @@ class ClockToText(Converter, object): # handle durations if self.type == self.IN_MINUTES: return "%d min" % (time / 60) + elif self.type == self.AS_LENGTH: + return "%d:%02d" % (time / 60, time % 60) t = localtime(time) |
