本文整理匯總了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