From: ghost Date: Tue, 16 Nov 2010 14:28:32 +0000 (+0100) Subject: Merge branch 'master' into experimental X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=commitdiff_plain;h=7d6ff22b6dd5b0f7b35fb35747109d70b6324d3e;hp=bddf5dc4d95831ef714ab55e2f47b1ac114ebe01 Merge branch 'master' into experimental --- diff --git a/data/defaults/Dream/Makefile.am b/data/defaults/Dream/Makefile.am index 1758f67..ee66c93 100644 --- a/data/defaults/Dream/Makefile.am +++ b/data/defaults/Dream/Makefile.am @@ -15,4 +15,6 @@ dist_install_DATA = \ settings.7020hd \ settings.7025 \ settings.800 \ - settings.8000 + settings.8000 \ + settings.c \ + settings.t diff --git a/data/defaults/Dream/dm500hd.info b/data/defaults/Dream/dm500hd.info index b1b4d53..29d14b6 100644 --- a/data/defaults/Dream/dm500hd.info +++ b/data/defaults/Dream/dm500hd.info @@ -19,8 +19,28 @@ - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/defaults/Dream/dm7020hd.info b/data/defaults/Dream/dm7020hd.info index 3af4679..e0a1fbb 100644 --- a/data/defaults/Dream/dm7020hd.info +++ b/data/defaults/Dream/dm7020hd.info @@ -19,8 +19,28 @@ - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/defaults/Dream/dm7025.info b/data/defaults/Dream/dm7025.info index a1585cf..0211199 100644 --- a/data/defaults/Dream/dm7025.info +++ b/data/defaults/Dream/dm7025.info @@ -19,8 +19,28 @@ - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/defaults/Dream/dm800.info b/data/defaults/Dream/dm800.info index 4793bd8..39b0cb0 100644 --- a/data/defaults/Dream/dm800.info +++ b/data/defaults/Dream/dm800.info @@ -19,8 +19,28 @@ - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/defaults/Dream/dm8000.info b/data/defaults/Dream/dm8000.info index 2ef2013..f052226 100644 --- a/data/defaults/Dream/dm8000.info +++ b/data/defaults/Dream/dm8000.info @@ -19,8 +19,28 @@ - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/defaults/Dream/dm800se.info b/data/defaults/Dream/dm800se.info index 6974b12..1685ede 100644 --- a/data/defaults/Dream/dm800se.info +++ b/data/defaults/Dream/dm800se.info @@ -19,8 +19,28 @@ - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/defaults/Dream/settings.c b/data/defaults/Dream/settings.c new file mode 100644 index 0000000..72ab938 --- /dev/null +++ b/data/defaults/Dream/settings.c @@ -0,0 +1 @@ +config.tv.lastroot=1:7:1:0:0:0:0:0:0:0:(type == 1) || (type == 17) || (type == 22) || (type == 25) || (type == 134) || (type == 195) ORDER BY name; diff --git a/data/defaults/Dream/settings.t b/data/defaults/Dream/settings.t new file mode 100644 index 0000000..72ab938 --- /dev/null +++ b/data/defaults/Dream/settings.t @@ -0,0 +1 @@ +config.tv.lastroot=1:7:1:0:0:0:0:0:0:0:(type == 1) || (type == 17) || (type == 22) || (type == 25) || (type == 134) || (type == 195) ORDER BY name; diff --git a/data/skin_default.xml b/data/skin_default.xml index 272fdcf..dcd2e8b 100755 --- a/data/skin_default.xml +++ b/data/skin_default.xml @@ -1205,7 +1205,7 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y())) Format:%S - + config.usage.blinking_display_clock_during_recording,True,CheckSourceBoolean Blink @@ -1221,7 +1221,7 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y())) Format:%H:%M - + config.usage.blinking_display_clock_during_recording,True,CheckSourceBoolean Blink @@ -1253,7 +1253,7 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y())) Format:%H:%M - + config.usage.blinking_display_clock_during_recording,True,CheckSourceBoolean Blink diff --git a/lib/python/Components/Harddisk.py b/lib/python/Components/Harddisk.py old mode 100755 new mode 100644 index e8e612a..7f83756 --- a/lib/python/Components/Harddisk.py +++ b/lib/python/Components/Harddisk.py @@ -5,6 +5,10 @@ from SystemInfo import SystemInfo import time from Components.Console import Console +def MajorMinor(path): + rdev = stat(path).st_rdev + return (major(rdev),minor(rdev)) + def readFile(filename): file = open(filename) data = file.read().strip() @@ -125,13 +129,15 @@ class Harddisk: for line in lines: parts = line.strip().split(" ") - if path.realpath(parts[0]).startswith(self.dev_path): - try: + real_path = path.realpath(parts[0]) + if not real_path[-1].isdigit(): + continue + try: + if MajorMinor(real_path) == MajorMinor(self.partitionPath(real_path[-1])): stat = statvfs(parts[1]) - except OSError: - continue - return stat.f_bfree/1000 * stat.f_bsize/1000 - + return stat.f_bfree/1000 * stat.f_bsize/1000 + except OSError: + pass return -1 def numPartitions(self): @@ -168,10 +174,17 @@ class Harddisk: cmd = "umount" - for line in lines: - parts = line.strip().split(" ") - if path.realpath(parts[0]).startswith(self.dev_path): - cmd = ' ' . join([cmd, parts[1]]) + for line in lines: + parts = line.strip().split(" ") + real_path = path.realpath(parts[0]) + if not real_path[-1].isdigit(): + continue + try: + if MajorMinor(real_path) == MajorMinor(self.partitionPath(real_path[-1])): + cmd = ' ' . join([cmd, parts[1]]) + break + except OSError: + pass res = system(cmd) return (res >> 8) @@ -201,10 +214,16 @@ class Harddisk: res = -1 for line in lines: parts = line.strip().split(" ") - if path.realpath(parts[0]) == self.partitionPath("1"): - cmd = "mount -t ext3 " + parts[0] - res = system(cmd) - break + real_path = path.realpath(parts[0]) + if not real_path[-1].isdigit(): + continue + try: + if MajorMinor(real_path) == MajorMinor(self.partitionPath(real_path[-1])): + cmd = "mount -t ext3 " + parts[0] + res = system(cmd) + break + except OSError: + pass return (res >> 8) diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index d7506e3..44ad6d2 100755 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -1624,16 +1624,17 @@ class Config(ConfigSubsection): self.pickle_this("config", self.saved_value, result) return ''.join(result) - def unpickle(self, lines): + def unpickle(self, lines, base_file=True): tree = { } for l in lines: if not l or l[0] == '#': continue n = l.find('=') + name = l[:n] val = l[n+1:].strip() - names = l[:n].split('.') + names = name.split('.') # if val.find(' ') != -1: # val = val[:val.find(' ')] @@ -1644,6 +1645,12 @@ class Config(ConfigSubsection): base[names[-1]] = val + if not base_file: # not the initial config file.. + #update config.x.y.value when exist + configEntry = eval(name) + if configEntry is not None: + configEntry.value = val + # we inherit from ConfigSubsection, so ... #object.__setattr__(self, "saved_value", tree["config"]) if "config" in tree: @@ -1655,9 +1662,9 @@ class Config(ConfigSubsection): f.write(text) f.close() - def loadFromFile(self, filename): + def loadFromFile(self, filename, base_file=False): f = open(filename, "r") - self.unpickle(f.readlines()) + self.unpickle(f.readlines(), base_file) f.close() config = Config() @@ -1668,7 +1675,7 @@ class ConfigFile: def load(self): try: - config.loadFromFile(self.CONFIG_FILE) + config.loadFromFile(self.CONFIG_FILE, True) except IOError, e: print "unable to load config (%s), assuming defaults..." % str(e)