def __init__(self, work_dir, config):

        """
            Main class which runs Beeswarm in Client mode.

        :param work_dir: Working directory (usually the current working directory)
        :param config_arg: Beeswarm configuration dictionary.
        """
        self.run_flag = True
        self.config = config

        # write ZMQ keys to files - as expected by pyzmq
        extract_keys(work_dir, config)

        BaitSession.client_id = self.config['general']['id']

        if self.config['general']['fetch_ip']:
            self.my_ip = urllib2.urlopen('http://api-sth01.exip.org/?call=ip').read()
            logger.info('Fetched {0} as my external ip.'.format(self.my_ip))
        else:
            self.my_ip = get_most_likely_ip()

        self.dispatcher_greenlets = []
def __init__ ( self , work_dir , config ) : self . run_flag = True self . config = config extract_keys ( work_dir , config ) BaitSession . client_id = self . config [ 'general' ] [ 'id' ] if self . config [ 'general' ] [ 'fetch_ip' ] : self . my_ip = urllib2 . urlopen ( 'http://api-sth01.exip.org/?call=ip' ) . read ( ) logger . info ( 'Fetched {0} as my external ip.' . format ( self . my_ip ) ) else : self . my_ip = get_most_likely_ip ( ) self . dispatcher_greenlets = [ ]
Main class which runs Beeswarm in Client mode.

        :param work_dir: Working directory (usually the current working directory)
        :param config_arg: Beeswarm configuration dictionary.