Components/About.py: fix /etc/image-version parser..now we also show image type ...
authorghost <andreas.monzner@multimedia-labs.de>
Thu, 19 Nov 2009 10:13:17 +0000 (11:13 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Thu, 19 Nov 2009 10:16:34 +0000 (11:16 +0100)
lib/python/Components/About.py

index bb2d75686a0b20e499de9aaf7ca27f73e469b9d2..58d67dc9cd8a59c0b918aaec29075650faee05ff 100644 (file)
@@ -19,11 +19,20 @@ class About:
                                        #0120 2005 11 29 01 16
                                        #0123 4567 89 01 23 45
                                        version = splitted[1]
                                        #0120 2005 11 29 01 16
                                        #0123 4567 89 01 23 45
                                        version = splitted[1]
+                                       image_type = version[0] # 0 = release, 1 = experimental
+                                       major = version[1]
+                                       minor = version[2]
+                                       revision = version[3]
                                        year = version[4:8]
                                        month = version[8:10]
                                        day = version[10:12]
                                        year = version[4:8]
                                        month = version[8:10]
                                        day = version[10:12]
-
-                                       return '-'.join(("dev", year, month, day))
+                                       if image_type == '0':
+                                               image_type = "Release"
+                                       else:
+                                               image_type = "Experimental"
+                                       date = '-'.join((year, month, day))
+                                       version = '.'.join((major, minor, revision))
+                                       return ' '.join((image_type, version, date))
                        file.close()
                except IOError:
                        pass
                        file.close()
                except IOError:
                        pass