Esempio n. 1
0
class SimpleTypeClientAPI(object, SimpleTypeInterface):
    """
    Service client implementation.
    """
    def __init__(self, host='localhost', port=9090, ref=None, token=None):
        self.host = host
        self.port = port
        self.transport, self.client = SimpleTypeClientConnection(host, port).get_client()
        self.ref = ref
        self._token = token

    def get_property(self):
        if not self.transport.isOpen():
            self.transport.open()

        try:
            return self.client.get_property(self._token, self.ref)
        except Exception, e:
            raise
        finally:
Esempio n. 2
0
 def __init__(self, host='localhost', port=9090, ref=None, token=None):
     self.host = host
     self.port = port
     self.transport, self.client = SimpleTypeClientConnection(host, port).get_client()
     self.ref = ref
     self._token = token