aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/About.py
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-02-19 21:10:56 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-02-19 21:10:56 +0000
commitf37aa673fead3c929789ef19af3f992f0f4be7a2 (patch)
tree1cd167b66ea35b5a035e006b769f74c974d45d0e /lib/python/Components/About.py
parent57534d26a3ec9cc77ab3eedc5ad393897e4dee95 (diff)
downloadenigma2-f37aa673fead3c929789ef19af3f992f0f4be7a2.tar.gz
enigma2-f37aa673fead3c929789ef19af3f992f0f4be7a2.zip
display image version a bit more nicely
Diffstat (limited to 'lib/python/Components/About.py')
-rw-r--r--lib/python/Components/About.py30
1 files changed, 21 insertions, 9 deletions
diff --git a/lib/python/Components/About.py b/lib/python/Components/About.py
index 24bfb2b0..6317af7c 100644
--- a/lib/python/Components/About.py
+++ b/lib/python/Components/About.py
@@ -5,13 +5,25 @@ class About:
pass
def getVersionString(self):
- file = open(resolveFilename(SCOPE_SYSETC, 'image-version'), 'r')
- lines = file.readlines()
- for x in lines:
- splitted = x.split('=')
- if splitted[0] == "version":
- return "2.0-" + str(splitted[1])
- file.close()
- return "2.0b"
+ try:
+ file = open(resolveFilename(SCOPE_SYSETC, 'image-version'), 'r')
+ lines = file.readlines()
+ for x in lines:
+ splitted = x.split('=')
+ if splitted[0] == "version":
+ # YYYY MM DD hh mm
+ #0120 2005 11 29 01 16
+ #0123 4567 89 01 23 45
+ version = splitted[1]
+ year = version[4:8]
+ month = version[8:10]
+ day = version[10:12]
+
+ return '-'.join(["2.0", year, month, day])
+ file.close()
+ except IOError:
+ pass
+
+ return "unavailable"
-about = About() \ No newline at end of file
+about = About()