Beispiel #1
0
 def __init__(self):
     if GUIDBProducer.__single:
         raise RuntimeError, "GuiDBProducer is singleton"
     
     #Lets get the reference to the shared database_thread
     from Tribler.Core.Session import Session
     if Session.has_instance():
         self.database_thread = Session.get_instance().lm.database_thread
     else:
         raise RuntimeError('Session not initialized')
     
     self.guitaskqueue = GUITaskQueue.getInstance()
     
     #Lets get a reference to utility
     from Tribler.Main.vwxGUI.GuiUtility import GUIUtility
     if GUIUtility.hasInstance():
         self.utility = GUIUtility.getInstance().utility
     else:
         Utility = namedtuple('Utility', ['abcquitting',])
         self.utility = Utility(False)
     
     self.uIds = set()
     self.uIdsLock = Lock()
     
     self.nrCallbacks = {}
Beispiel #2
0
    def __init__(self, database_thread):
        if GUIDBProducer.__single:
            raise RuntimeError("GuiDBProducer is singleton")

        self.database_thread = database_thread
        self.guitaskqueue = GUITaskQueue.getInstance()

        # Lets get a reference to utility
        from Tribler.Main.vwxGUI.GuiUtility import GUIUtility
        if GUIUtility.hasInstance():
            self.utility = GUIUtility.getInstance().utility
        else:
            Utility = namedtuple('Utility', ['abcquitting', ])
            self.utility = Utility(False)

        self.uIds = set()
        self.uIdsLock = Lock()

        self.nrCallbacks = {}
Beispiel #3
0
    def __init__(self, database_thread):
        if GUIDBProducer.__single:
            raise RuntimeError("GuiDBProducer is singleton")

        self.database_thread = database_thread
        self.guitaskqueue = GUITaskQueue.getInstance()

        # Lets get a reference to utility
        from Tribler.Main.vwxGUI.GuiUtility import GUIUtility
        if GUIUtility.hasInstance():
            self.utility = GUIUtility.getInstance().utility
        else:
            Utility = namedtuple('Utility', [
                'abcquitting',
            ])
            self.utility = Utility(False)

        self.uIds = set()
        self.uIdsLock = Lock()

        self.nrCallbacks = {}
Beispiel #4
0
    def __init__(self):
        if GUIDBProducer.__single:
            raise RuntimeError("GuiDBProducer is singleton")

        super(GUIDBProducer, self).__init__()

        self._logger = logging.getLogger(self.__class__.__name__)

        # Lets get a reference to utility
        from Tribler.Main.vwxGUI.GuiUtility import GUIUtility
        if GUIUtility.hasInstance():
            self.utility = GUIUtility.getInstance().utility
        else:
            Utility = namedtuple('Utility', ['abcquitting', ])
            self.utility = Utility(False)

        self.uIds = set()
        self.uIdsLock = Lock()

        self.nrCallbacks = {}

        self._auto_counter = 0
Beispiel #5
0
    def __init__(self):
        if GUIDBProducer.__single:
            raise RuntimeError("GuiDBProducer is singleton")

        super(GUIDBProducer, self).__init__()

        self._logger = logging.getLogger(self.__class__.__name__)

        # Lets get a reference to utility
        from Tribler.Main.vwxGUI.GuiUtility import GUIUtility
        if GUIUtility.hasInstance():
            self.utility = GUIUtility.getInstance().utility
        else:
            Utility = namedtuple('Utility', [
                'abcquitting',
            ])
            self.utility = Utility(False)

        self.uIds = set()
        self.uIdsLock = Lock()

        self.nrCallbacks = {}

        self._auto_counter = 0
Beispiel #6
0
 def wait_for_guiutility():
     self._logger.debug("waiting for guiutility instance")
     self.lm = self.session.lm
     self.CallConditional(30, lambda: GUIUtility.hasInstance(), wait_for_init)
Beispiel #7
0
 def wait_for_guiutility():
     print >> sys.stderr, "tgs: waiting for guiutility instance"
     self.CallConditional(30, lambda: GUIUtility.hasInstance(), wait_for_init)