def __init__(self): if FriendshipMsgHandler.__singleton: raise RuntimeError, "FriendshipMsgHandler is singleton" self.overlay_bridge = None self.currmsgs = {} self.online_fsext_peers = Set() # online peers that speak FRIENDSHIP ext self.peerdb = PeerDBHandler.getInstance() self.frienddb = FriendDBHandler.getInstance() self.friendshipStatistics_db = FriendshipStatisticsDBHandler.getInstance() self.list_no_of_conn_attempts_per_target= {} self.usercallback = None
def setUpPostSession(self): """ override TestAsServer """ TestCrawler.setUpPostSession(self) self.some_keypair = EC.gen_params(EC.NID_sect233k1) self.some_keypair.gen_key() self.some_permid = str(self.some_keypair.pub().get_der()) self.friendshipStatistics_db = FriendshipStatisticsDBHandler.getInstance() self.friendshipStatistics_db.insertFriendshipStatistics( bin2str(self.his_permid), bin2str(self.some_permid), int(time.time()), 0, commit=True) self.friendshipStatistics_db.insertFriendshipStatistics( bin2str(self.my_permid), bin2str(self.some_permid), int(time.time()), 0, commit=True) # make sure that the OLConnection IS in the crawler_db crawler_db = CrawlerDBHandler.getInstance() crawler_db.temporarilyAddCrawler(self.my_permid)
def __init__(self,session): self.session = session self.friendshipStatistics_db = FriendshipStatisticsDBHandler.getInstance()
def __init__(self, session): self.session = session self.friendshipStatistics_db = FriendshipStatisticsDBHandler.getInstance( )