aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2010-02-09 19:45:42 +0100
committerghost <andreas.monzner@multimedia-labs.de>2010-02-09 19:47:32 +0100
commite50f482422a4d0f1d08f0970dc7988e2e3ebc78e (patch)
treed77374bba1b8f31637463503d99c2ed77a6b0913 /lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py
parenta57f7724f413c42aa22c87331c986eeac45ac957 (diff)
downloadenigma2-e50f482422a4d0f1d08f0970dc7988e2e3ebc78e.tar.gz
enigma2-e50f482422a4d0f1d08f0970dc7988e2e3ebc78e.zip
lib/python/Plugins/SystemPlugins/SoftwareManager: more robust code this i.e. fixes:
Traceback (most recent call last): File "/usr/lib/enigma2/python/Tools/BoundFunction.py", line 9, in __call__ return self.fnc(*self.args + args, **newkwargs) File "/usr/lib/enigma2/python/Components/Console.py", line 56, in finishedCB self.callbacks[name](data,retval,extra_args) File "/usr/lib/enigma2/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py", line 108, in IpkgListAvailableCB SoftwareTools.available_packetlist.append([name, split[1].strip(), split[2].strip()]) File "/usr/lib/enigma2/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py", line 108, in IpkgListAvailableCB SoftwareTools.available_packetlist.append([name, split[1].strip(), split[2].strip()]) ref bug #383
Diffstat (limited to 'lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py')
-rwxr-xr-xlib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py b/lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py
index 4e7591ef..e8cf6dc2 100755
--- a/lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py
+++ b/lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py
@@ -94,14 +94,17 @@ class SoftwareTools(DreamInfoHandler):
def IpkgListAvailableCB(self, result, retval, extra_args = None):
(callback) = extra_args
- if len(result):
+ if result:
if SoftwareTools.list_updating:
SoftwareTools.available_packetlist = []
for x in result.splitlines():
- split = x.split(' - ')
- name = split[0].strip()
+ tokens = x.split(' - ')
+ name = tokens[0].strip()
if not any(name.endswith(x) for x in self.unwanted_extensions):
- SoftwareTools.available_packetlist.append([name, split[1].strip(), split[2].strip()])
+ l = len(tokens)
+ version = l > 1 and tokens[1].strip() or ""
+ descr = l > 2 and tokens[2].strip() or ""
+ SoftwareTools.available_packetlist.append([name, version, descr])
if callback is None:
self.startInstallMetaPackage()
else:
@@ -126,7 +129,7 @@ class SoftwareTools(DreamInfoHandler):
def InstallMetaPackageCB(self, result, retval, extra_args = None):
(callback) = extra_args
- if len(result):
+ if result:
self.fillPackagesIndexList()
if callback is None:
self.startIpkgListInstalled()
@@ -152,13 +155,15 @@ class SoftwareTools(DreamInfoHandler):
def IpkgListInstalledCB(self, result, retval, extra_args = None):
(callback) = extra_args
- if len(result):
+ if result:
SoftwareTools.installed_packetlist = {}
for x in result.splitlines():
- split = x.split(' - ')
- name = split[0].strip()
+ tokens = x.split(' - ')
+ name = tokens[0].strip()
if not any(name.endswith(x) for x in self.unwanted_extensions):
- SoftwareTools.installed_packetlist[name] = split[1].strip()
+ l = len(tokens)
+ version = l > 1 and tokens[1].strip() or ""
+ SoftwareTools.installed_packetlist[name] = version
if callback is None:
self.countUpdates()
else:
@@ -203,7 +208,7 @@ class SoftwareTools(DreamInfoHandler):
def IpkgUpdateCB(self, result, retval, extra_args = None):
(callback) = extra_args
- if len(result):
+ if result:
if self.Console:
if len(self.Console.appContainers) == 0:
if callback is not None: