# Path: pyanaconda/threads.py
# class ThreadManager(object):
# class AnacondaThread(threading.Thread):
#     def __init__(self):
#     def __call__(self):
#     def add(self, obj):
#     def remove(self, name):
#     def exists(self, name):
#     def get(self, name):
#     def wait(self, name):
#     def wait_all(self):
#     def set_error(self, name, *exc_info):
#     def get_error(self, name):
#     def any_errors(self):
#     def raise_error(self, name):
#     def in_main_thread(self):
#     def running(self):
#     def names(self):
#     def __init__(self, *args, **kwargs):
#     def run(self, *args, **kwargs):
# def initThreading():


from pyanaconda.threads import threadMgr
from contextlib import contextmanager
from gi.repository import Gtk, GLib, AnacondaWidgets
    from pyanaconda.ui.gui import ANACONDA_WINDOW_GROUP
import Queue
import gettext
def gtk_call_once(func, *args):
    """Wrapper for GLib.idle_add call that ensures the func is called
       only once.
    """
    def wrap(args):
        func(*args)
        return False

    GLib.idle_add(wrap, args)

def gtk_action_wait(func):
    """Decorator method which ensures every call of the decorated function to be
       executed in the context of Gtk main loop even if called from a non-main
       thread and returns the ret value after the decorated method finishes.
    """

    queue = Queue.Queue()

    def _idle_method(q_args):
        """This method contains the code for the main loop to execute.
        """
        queue, args = q_args
        ret = func(*args)
        queue.put(ret)
        return False

    def _call_method(*args):
        """The new body for the decorated method. If needed, it uses closure
           bound queue variable which is valid until the reference to this
           method is destroyed."""

# Path: pyanaconda/threads.py
# class ThreadManager(object):
# class AnacondaThread(threading.Thread):
#     def __init__(self):
#     def __call__(self):
#     def add(self, obj):
#     def remove(self, name):
#     def exists(self, name):
#     def get(self, name):
#     def wait(self, name):
#     def wait_all(self):
#     def set_error(self, name, *exc_info):
#     def get_error(self, name):
#     def any_errors(self):
#     def raise_error(self, name):
#     def in_main_thread(self):
#     def running(self):
#     def names(self):
#     def __init__(self, *args, **kwargs):
#     def run(self, *args, **kwargs):
# def initThreading():


# Path: pyanaconda/ui/gui/utils.py
from pyanaconda.threads import threadMgr
from contextlib import contextmanager
from gi.repository import Gtk, GLib, AnacondaWidgets
    from pyanaconda.ui.gui import ANACONDA_WINDOW_GROUP
import Queue
import gettext

def gtk_call_once(func, *args):
    """Wrapper for GLib.idle_add call that ensures the func is called
       only once.
    """
    def wrap(args):
        func(*args)
        return False

    GLib.idle_add(wrap, args)

def gtk_action_wait(func):
    """Decorator method which ensures every call of the decorated function to be
       executed in the context of Gtk main loop even if called from a non-main
       thread and returns the ret value after the decorated method finishes.
    """

    queue = Queue.Queue()

    def _idle_method(q_args):
        """This method contains the code for the main loop to execute.
        """
        queue, args = q_args
        ret = func(*args)
        queue.put(ret)
        return False

    def _call_method(*args):
        """The new body for the decorated method. If needed, it uses closure
           bound queue variable which is valid until the reference to this
           method is destroyed."""

        if threadMgr.in_main_thread():