本文整理汇总了Python中Tribler.Main.vwxGUI.GuiUtility.GUIUtility.hasInstance方法的典型用法代码示例。如果您正苦于以下问题:Python GUIUtility.hasInstance方法的具体用法?Python GUIUtility.hasInstance怎么用?Python GUIUtility.hasInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tribler.Main.vwxGUI.GuiUtility.GUIUtility
的用法示例。
在下文中一共展示了GUIUtility.hasInstance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Tribler.Main.vwxGUI.GuiUtility import GUIUtility [as 别名]
# 或者: from Tribler.Main.vwxGUI.GuiUtility.GUIUtility import hasInstance [as 别名]
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 = {}
示例2: __init__
# 需要导入模块: from Tribler.Main.vwxGUI.GuiUtility import GUIUtility [as 别名]
# 或者: from Tribler.Main.vwxGUI.GuiUtility.GUIUtility import hasInstance [as 别名]
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 = {}
示例3: __init__
# 需要导入模块: from Tribler.Main.vwxGUI.GuiUtility import GUIUtility [as 别名]
# 或者: from Tribler.Main.vwxGUI.GuiUtility.GUIUtility import hasInstance [as 别名]
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
示例4: wait_for_guiutility
# 需要导入模块: from Tribler.Main.vwxGUI.GuiUtility import GUIUtility [as 别名]
# 或者: from Tribler.Main.vwxGUI.GuiUtility.GUIUtility import hasInstance [as 别名]
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)
示例5: wait_for_guiutility
# 需要导入模块: from Tribler.Main.vwxGUI.GuiUtility import GUIUtility [as 别名]
# 或者: from Tribler.Main.vwxGUI.GuiUtility.GUIUtility import hasInstance [as 别名]
def wait_for_guiutility():
print >> sys.stderr, "tgs: waiting for guiutility instance"
self.CallConditional(30, lambda: GUIUtility.hasInstance(), wait_for_init)