git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add remove to ipkg component and screen
[enigma2.git]
/
lib
/
python
/
Components
/
Converter
/
ClockToText.py
diff --git
a/lib/python/Components/Converter/ClockToText.py
b/lib/python/Components/Converter/ClockToText.py
index 65e431bcd5bd7a698983305d558b640eaa3d9485..109f91259b9db071cf1d0fcf25608d50a851bd29 100644
(file)
--- 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
IN_MINUTES = 2
DATE = 3
FORMAT = 4
+ AS_LENGTH = 5
# add: date, date as string, weekday, ...
# (whatever you need!)
# add: date, date as string, weekday, ...
# (whatever you need!)
@@
-20,7
+21,9
@@
class ClockToText(Converter, object):
self.type = self.IN_MINUTES
elif type == "Date":
self.type = self.DATE
self.type = self.IN_MINUTES
elif type == "Date":
self.type = self.DATE
- elif type.find("Format") != -1:
+ elif type == "AsLength":
+ self.type = self.AS_LENGTH
+ elif str(type).find("Format") != -1:
self.type = self.FORMAT
self.fmt_string = type[7:]
else:
self.type = self.FORMAT
self.fmt_string = type[7:]
else:
@@
-35,6
+38,8
@@
class ClockToText(Converter, object):
# handle durations
if self.type == self.IN_MINUTES:
return "%d min" % (time / 60)
# 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)
t = localtime(time)