예제 #1
0
파일: server.py 프로젝트: lisidan/tega
 def __init__(self, ghost, gport, config, operational, server_tega_id):
     self.ghost = ghost
     self.gport = gport
     self.config = config 
     self.operational = operational 
     self.server_tega_id = server_tega_id
     self.client = None
     self.on_notify = None
     self.parser = build_parser('client')
     self.client = None
     self.subscriber = None
예제 #2
0
파일: driver.py 프로젝트: lisidan/tega
    def __init__(self, host=HOST, port=PORT, tega_id=None, subscriber=None):
        '''
        HTTP connection initialization
        '''
        self.conn = httplib2.Http()
        self.base_url = 'http://{}:{}'.format(host, port)
        self.txid = None
        self.pubsub_url = WEBSOCKET_PUBSUB_URL.format(host, port)
        self._tega_id = tega_id
        self.client = None
        self.parser = build_parser('driver')
        self._urlencode = _make_urlencode(self.base_url)

        if subscriber:
            self.subscriber = subscriber
            self._tega_id = subscriber.tega_id
        elif tega_id:
            self._tega_id = tega_id
        else:
            self._tega_id = str(uuid.uuid4())

        for cmd in ('roots', 'old', 'channels', 'subscribers', 'ids', 'global',
                    'forwarders', 'plugins', 'reload'):
            setattr(self, cmd, self._build_cmd(cmd))
예제 #3
0
파일: driver.py 프로젝트: araobp/tega
    def __init__(self, host=HOST, port=PORT, tega_id=None, subscriber=None):
        '''
        HTTP connection initialization
        '''
        self.conn = httplib2.Http()
        self.base_url = 'http://{}:{}'.format(host, port)
        self.txid = None
        self.pubsub_url = WEBSOCKET_PUBSUB_URL.format(host, port)
        self._tega_id = tega_id 
        self.client = None
        self.parser = build_parser('driver')
        self._urlencode = _make_urlencode(self.base_url)
    
        if subscriber:
            self.subscriber = subscriber
            self._tega_id = subscriber.tega_id
        elif tega_id:
            self._tega_id = tega_id
        else:
            self._tega_id = str(uuid.uuid4())

        for cmd in ('roots', 'old', 'channels', 'subscribers',
                    'ids', 'global', 'forwarders', 'plugins', 'reload'):
            setattr(self, cmd, self._build_cmd(cmd))
예제 #4
0
파일: server.py 프로젝트: lisidan/tega
 def __init__(self, application, request, **kwargs):
 #def initialize(self):
     super().__init__(application, request, **kwargs)
     self.parser = build_parser('server')
     self.tega_id = None  # remote tega_id set by SESSION
     self.subscriber = None