git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't crash when background jobs fail and user presses red key
[enigma2.git]
/
lib
/
python
/
Components
/
Ipkg.py
diff --git
a/lib/python/Components/Ipkg.py
b/lib/python/Components/Ipkg.py
index eac264289ff76dcb0eb1d738551d6fcf833feac6..31889bcf0ecae0532c004f1a1b1c0404b7f1d96e 100644
(file)
--- a/
lib/python/Components/Ipkg.py
+++ b/
lib/python/Components/Ipkg.py
@@
-22,10
+22,7
@@
class IpkgComponent:
self.ipkg = ipkg
self.cmd = eConsoleAppContainer()
self.ipkg = ipkg
self.cmd = eConsoleAppContainer()
- self.cmd.appClosed.get().append(self.cmdFinished)
- self.cmd.dataAvail.get().append(self.cmdData)
self.cache = None
self.cache = None
-
self.callbackList = []
self.setCurrentCommand()
self.callbackList = []
self.setCurrentCommand()
@@
-34,8
+31,11
@@
class IpkgComponent:
def runCmd(self, cmd):
print "executing", self.ipkg, cmd
def runCmd(self, cmd):
print "executing", self.ipkg, cmd
- self.cmd.execute(self.ipkg + " " + cmd)
-
+ self.cmd.appClosed.append(self.cmdFinished)
+ self.cmd.dataAvail.append(self.cmdData)
+ if self.cmd.execute(self.ipkg + " " + cmd):
+ self.cmdFinished(-1)
+
def startCmd(self, cmd, args = None):
if cmd == self.CMD_UPDATE:
self.runCmd("update")
def startCmd(self, cmd, args = None):
if cmd == self.CMD_UPDATE:
self.runCmd("update")
@@
-56,7
+56,9
@@
class IpkgComponent:
def cmdFinished(self, retval):
self.callCallbacks(self.EVENT_DONE)
def cmdFinished(self, retval):
self.callCallbacks(self.EVENT_DONE)
-
+ self.cmd.appClosed.remove(self.cmdFinished)
+ self.cmd.dataAvail.remove(self.cmdData)
+
def cmdData(self, data):
print "data:", data
if self.cache is None:
def cmdData(self, data):
print "data:", data
if self.cache is None:
@@
-96,7
+98,10
@@
class IpkgComponent:
self.callCallbacks(self.EVENT_ERROR, None)
elif data.find('ipkg_download: ERROR:') == 0:
self.callCallbacks(self.EVENT_ERROR, None)
self.callCallbacks(self.EVENT_ERROR, None)
elif data.find('ipkg_download: ERROR:') == 0:
self.callCallbacks(self.EVENT_ERROR, None)
- elif data.find(' Configuration file') == 0:
+ elif data.find(' Configuration file \'') >= 0:
+ # Note: the config file update question doesn't end with a newline, so
+ # if we get multiple config file update questions, the next ones
+ # don't necessarily start at the beginning of a line
self.callCallbacks(self.EVENT_MODIFIED, data.split(' \'', 1)[1][:-1])
def callCallbacks(self, event, param = None):
self.callCallbacks(self.EVENT_MODIFIED, data.split(' \'', 1)[1][:-1])
def callCallbacks(self, event, param = None):