summaryrefslogtreecommitdiff
path: root/geneticone/gui/main.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--geneticone/gui/main.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/geneticone/gui/main.py b/geneticone/gui/main.py
index eb7f74d..dc980b6 100644
--- a/geneticone/gui/main.py
+++ b/geneticone/gui/main.py
@@ -1,19 +1,25 @@
#!/usr/bin/python
+# our backend stuff
import geneticone
-from geneticone.modules import geneticthread
+# gtk stuff
import pygtk
pygtk.require("2.0")
import gtk
+import gobject
# for doing emerge
from subprocess import *
+# threading
+from threading import Thread
+
# for the terminal
import pty
import vte
+# other
from portage_util import unique_array
class EmergeQueue:
@@ -56,9 +62,10 @@ class EmergeQueue:
if self.unmergeIt: # update tree
self.tree.append(self.unmergeIt, [sth])
- def __emerge(self):
- self.process.wait()
- for p in self.ps:
+ def update_packages(self, process, packages):
+ """This updates the packages-list. It simply removes all affected categories so they have to be rebuilt."""
+ process.wait()
+ for p in packages:
try:
cat = geneticone.split_package_name(p)[0]
while cat[0] in ["=",">","<","!"]:
@@ -73,9 +80,8 @@ class EmergeQueue:
"""Calls emerge and updates the terminal."""
(master, slave) = pty.openpty()
self.console.set_pty(master)
- self.process = Popen(["/usr/bin/python","/usr/bin/emerge"]+options+packages, stdout = slave, stderr = STDOUT, shell = False)
- self.ps = packages
- geneticthread.thread_start(self.__emerge)
+ process = Popen(["/usr/bin/python","/usr/bin/emerge"]+options+packages, stdout = slave, stderr = STDOUT, shell = False)
+ Thread(target=self.update_packages, args=(process, packages).start()
self.remove_all(it)
def emerge (self, force = False):
@@ -94,7 +100,6 @@ class EmergeQueue:
"""Unmerges everything in the umerge-queue. If force is 'False' (default) only "emerge -pv -C" is called."""
if len(self.unmergequeue) == 0: return
- #list = " ".join(self.unmergequeue)
list = self.unmergequeue[:]
s = ["-C"]
if not force: s = ["-Cpv"]
@@ -614,6 +619,7 @@ class MainWindow:
def main (self):
"""Main."""
+ gobject.threads_init()
gtk.main()
def blocked_dialog (blocked, blocks):
c42c60d060ded9a3f4529840546290500e54&follow=1'>Improve changelogRené 'Necoro' Neumann1-2/+4 2023-06-05IMAP client does not need to know about max number of connectionsRené 'Necoro' Neumann2-19/+12 2023-06-04ChangelogRené 'Necoro' Neumann1-0/+4 2023-06-04Add new config option to set max number of IMAP connections.René 'Necoro' Neumann5-20/+26 2023-06-04Improve locking around IMAP connect/disconnect.René 'Necoro' Neumann1-10/+26 2023-05-20Bump golang.org/x/net from 0.9.0 to 0.10.0dependabot[bot]2-2/+3 2023-05-12Amend changelogRené 'Necoro' Neumann1-0/+1 2023-05-12Issue #95 Add warning when config can be read globally.René 'Necoro' Neumann1-0/+11 2023-05-11Issue #95: Change cache ownership.René 'Necoro' Neumann1-0/+4 2023-05-11Issue #95: Add hint about sensible access rights.René 'Necoro' Neumann1-0/+1 2023-04-23[workflow] Port changes also to releaseRené 'Necoro' Neumann1-6/+5 2023-04-23[workflow] Checkout before go setupRené 'Necoro' Neumann1-3/+3 2023-04-23[workflow] determine go version from go.modRené 'Necoro' Neumann1-3/+2 2023-04-23Improve test to also validate error messageRené 'Necoro' Neumann1-42/+39 2023-04-22Fix/improve testsRené 'Necoro' Neumann1-59/+104 2023-04-22Improve error handlingRené 'Necoro' Neumann1-1/+11 2023-04-21Fix workflow: '1.20' needs to be quotedRené 'Necoro' Neumann2-2/+2