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


Python OverlayThreadingBridge.resetSingleton方法代码示例

本文整理汇总了Python中Tribler.Core.Overlay.OverlayThreadingBridge.OverlayThreadingBridge.resetSingleton方法的典型用法代码示例。如果您正苦于以下问题:Python OverlayThreadingBridge.resetSingleton方法的具体用法?Python OverlayThreadingBridge.resetSingleton怎么用?Python OverlayThreadingBridge.resetSingleton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tribler.Core.Overlay.OverlayThreadingBridge.OverlayThreadingBridge的用法示例。


在下文中一共展示了OverlayThreadingBridge.resetSingleton方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

# 需要导入模块: from Tribler.Core.Overlay.OverlayThreadingBridge import OverlayThreadingBridge [as 别名]
# 或者: from Tribler.Core.Overlay.OverlayThreadingBridge.OverlayThreadingBridge import resetSingleton [as 别名]
    def setUp(self):

        print >>sys.stderr,"test: TestOverlayThreadingBridge.setUp()"

        self.config_path = tempfile.mkdtemp()
        config = {}
        config['state_dir'] = self.config_path
        config['torrent_collecting_dir'] = self.config_path
        config['install_dir'] = os.path.join('..','..')
        config['peer_icon_path'] = os.path.join(self.config_path,'peer_icons')
        config['superpeer'] = False
        sqlitecachedb.init(config, self.rawserver_fatalerrorfunc)

        secover1 = SecureOverlay.getInstance()
        secover1.resetSingleton()
        secover2 = SecureOverlay.getInstance()
        secover2.resetSingleton()

        overbridge1 = OverlayThreadingBridge()
        overbridge1.register_bridge(secover1,None)
        overbridge1.resetSingleton()

        overbridge2 = OverlayThreadingBridge()
        overbridge2.register_bridge(secover2,None)
        overbridge2.resetSingleton()


        self.peer1 = Peer(self,1234,overbridge1)
        self.peer2 = Peer(self,5678,overbridge2)
        self.peer1.start()
        self.peer2.start()
        self.wanted = False
        self.wanted2 = False
        self.got = False
        self.got2 = False
        self.first = True

        print >>sys.stderr,"test: setUp: peer1 permid is",show_permid_short(self.peer1.my_permid)
        print >>sys.stderr,"test: setUp: peer2 permid is",show_permid_short(self.peer2.my_permid)

        time.sleep(2) # let server threads start
开发者ID:Devristo,项目名称:tribler,代码行数:43,代码来源:test_overlay_bridge.py


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