当前位置: 首页>>代码示例>>Python>>正文


Python GUIUtility.hasInstance方法代码示例

本文整理汇总了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 = {}
开发者ID:duy,项目名称:tribler,代码行数:27,代码来源:GuiDBHandler.py

示例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 = {}
开发者ID:Anbcorp,项目名称:tribler,代码行数:21,代码来源:GuiDBHandler.py

示例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
开发者ID:Antiade,项目名称:tribler,代码行数:24,代码来源:GuiDBHandler.py

示例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)
开发者ID:Antiade,项目名称:tribler,代码行数:6,代码来源:test_as_server.py

示例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)
开发者ID:Anbcorp,项目名称:tribler,代码行数:5,代码来源:test_as_server.py


注:本文中的Tribler.Main.vwxGUI.GuiUtility.GUIUtility.hasInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。