Example #1
0
 def __init__(self, runmode, log):
     super(Bootstrapper, self).__init__()
     self.log = log  #.getChild("bootstrap")
     self.runmode = runmode
     self.ircbootstrapper = IrcBootstrapper(runmode, log=log)
     self.dnsbootstrapper = DnsBoostrapper(runmode, log=log)
     self.ircbootstrapper.subscribe(IrcBootstrapper.EVT_FOUND_PEER,
                                    self.on_found_peer)
     self.dnsbootstrapper.subscribe(DnsBoostrapper.EVT_FOUND_PEER,
                                    self.on_found_peer)
Example #2
0
 def __init__(self, runmode, log):
     super(Bootstrapper, self).__init__()
     self.log = log #.getChild("bootstrap")
     self.runmode = runmode
     self.ircbootstrapper = IrcBootstrapper(runmode, log=log)
     self.dnsbootstrapper = DnsBoostrapper(runmode, log=log)
     self.ircbootstrapper.subscribe(IrcBootstrapper.EVT_FOUND_PEER, self.on_found_peer)
     self.dnsbootstrapper.subscribe(DnsBoostrapper.EVT_FOUND_PEER, self.on_found_peer)
Example #3
0
class Bootstrapper(Observable):
    EVT_FOUND_PEER = Observable.createevent()
    
    def __init__(self, runmode, log):
        super(Bootstrapper, self).__init__()
        self.log = log #.getChild("bootstrap")
        self.runmode = runmode
        self.ircbootstrapper = IrcBootstrapper(runmode, log=log)
        self.dnsbootstrapper = DnsBoostrapper(runmode, log=log)
        self.ircbootstrapper.subscribe(IrcBootstrapper.EVT_FOUND_PEER, self.on_found_peer)
        self.dnsbootstrapper.subscribe(DnsBoostrapper.EVT_FOUND_PEER, self.on_found_peer)

    def on_found_peer(self, event):
        self.fire(self.EVT_FOUND_PEER, peeraddress=event.peeraddress)
       
    def bootstrap(self):
        if self.runmode == MAIN:
            self.dnsbootstrapper.bootstrap()
        else:
            self.ircbootstrapper.start()
Example #4
0
class Bootstrapper(Observable):
    EVT_FOUND_PEER = Observable.createevent()

    def __init__(self, runmode, log):
        super(Bootstrapper, self).__init__()
        self.log = log  #.getChild("bootstrap")
        self.runmode = runmode
        self.ircbootstrapper = IrcBootstrapper(runmode, log=log)
        self.dnsbootstrapper = DnsBoostrapper(runmode, log=log)
        self.ircbootstrapper.subscribe(IrcBootstrapper.EVT_FOUND_PEER,
                                       self.on_found_peer)
        self.dnsbootstrapper.subscribe(DnsBoostrapper.EVT_FOUND_PEER,
                                       self.on_found_peer)

    def on_found_peer(self, event):
        self.fire(self.EVT_FOUND_PEER, peeraddress=event.peeraddress)

    def bootstrap(self):
        if self.runmode == MAIN:
            self.dnsbootstrapper.bootstrap()
        else:
            self.ircbootstrapper.start()