summaryrefslogtreecommitdiffstats
path: root/pyanaconda/threads.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2012-05-09 14:54:16 -0400
committerChris Lumens <clumens@redhat.com>2012-05-09 14:54:16 -0400
commit5354086f1ece5d5aebf1e5f8c9360b3aa853bb12 (patch)
tree28b048e5a06f56b54eede0ab5ef14529ac30855e /pyanaconda/threads.py
parent374761910be654941c826f865249eacb5218b379 (diff)
downloadanaconda-5354086f1ece5d5aebf1e5f8c9360b3aa853bb12.tar.gz
anaconda-5354086f1ece5d5aebf1e5f8c9360b3aa853bb12.tar.xz
anaconda-5354086f1ece5d5aebf1e5f8c9360b3aa853bb12.zip
Add more docstrings for the new UI.
Diffstat (limited to 'pyanaconda/threads.py')
-rw-r--r--pyanaconda/threads.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pyanaconda/threads.py b/pyanaconda/threads.py
index 7fed48a1e..f83bb0909 100644
--- a/pyanaconda/threads.py
+++ b/pyanaconda/threads.py
@@ -64,6 +64,14 @@ class ThreadManager(object):
return self._objs.get(name)
class AnacondaThread(threading.Thread):
+ """A threading.Thread subclass that exists only for a couple purposes:
+
+ (1) Make exceptions that happen in a thread invoke our exception handling
+ code as well. Otherwise, threads will silently die and we are doing
+ a lot of complicated code in them now.
+
+ (2) Remove themselves from the thread manager when completed.
+ """
def run(self, *args, **kwargs):
# http://bugs.python.org/issue1230540#msg25696
import sys
@@ -78,6 +86,10 @@ class AnacondaThread(threading.Thread):
threadMgr.remove(self.name)
def initThreading():
+ """Set up threading for anaconda's use. This method must be called before
+ any GTK or threading code is called, or else threads will only run when
+ an event is triggered in the GTK main loop.
+ """
from gi.repository import GObject
GObject.threads_init()