summaryrefslogtreecommitdiff
path: root/geneticone/gui/gui_helper.py
diff options
context:
space:
mode:
authornecoro <>2006-11-12 17:41:03 +0000
committernecoro <>2006-11-12 17:41:03 +0000
commitccee291737673926730f8573c22bb348b10438eb (patch)
tree3855b9ba0586576721814ab083713c840d2730d3 /geneticone/gui/gui_helper.py
parente6080239db72c7d04b1fe81aa666b2eb379028a1 (diff)
downloadportato-ccee291737673926730f8573c22bb348b10438eb.tar.gz
portato-ccee291737673926730f8573c22bb348b10438eb.tar.bz2
portato-ccee291737673926730f8573c22bb348b10438eb.zip
added control field for specifying the sync command
Diffstat (limited to 'geneticone/gui/gui_helper.py')
-rw-r--r--geneticone/gui/gui_helper.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/geneticone/gui/gui_helper.py b/geneticone/gui/gui_helper.py
index d116877..edddc53 100644
--- a/geneticone/gui/gui_helper.py
+++ b/geneticone/gui/gui_helper.py
@@ -39,7 +39,8 @@ class Config:
"debug_opt" : "debug",
"oneshot_opt" : "oneshot",
"deep_opt" : "deep",
- "newuse_opt" : "newuse"
+ "newuse_opt" : "newuse",
+ "syncCmd_opt" : "synccommand"
}
def __init__ (self, cfgFile):
@@ -421,7 +422,7 @@ class EmergeQueue:
self.db.reload(cat)
debug("Category %s refreshed" % cat)
- def _emerge (self, options, packages, it):
+ def _emerge (self, options, packages, it, command = ["/usr/bin/python","/usr/bin/emerge"]):
"""Calls emerge and updates the terminal.
@param options: options to send to emerge
@@ -429,14 +430,16 @@ class EmergeQueue:
@param packages: packages to emerge
@type packages: list
@param it: Iterators which point to these entries whose children will be removed after completion.
- @type it: Iterator[]"""
+ @type it: Iterator[]
+ @param command: the command to execute - default is "/usr/bin/python /usr/bin/emerge"
+ @type command: string[]"""
# open tty
(master, slave) = pty.openpty()
self.console.set_pty(master)
# start emerge
- process = Popen(["/usr/bin/python","/usr/bin/emerge"]+options+packages, stdout = slave, stderr = STDOUT, shell = False)
+ process = Popen(command+options+packages, stdout = slave, stderr = STDOUT, shell = False)
# start thread waiting for the stop of emerge
Thread(target=self._update_packages, args=(packages+self.deps.keys(), process)).start()
@@ -511,9 +514,16 @@ class EmergeQueue:
self._emerge(options, ["world"], [self.emergeIt])
- def sync (self):
- """Calls "emerge --sync"."""
- self._emerge(["--sync"], [], [])
+ def sync (self, command = None):
+ """Calls "emerge --sync".
+
+ @param command: command to execute to sync. If None "emerge --sync" is taken.
+ @type command: string[]"""
+
+ if command == None:
+ self._emerge(["--sync"], [], [])
+ else:
+ self._emerge([],[],[], command = command)
def remove_with_children (self, it, removeNewFlags = True):
"""Convenience function which removes all children of an iterator and than the iterator itself.