def start(self, port=50666): self.context = zmq.Context() self.socket = self.context.socket(zmq.REP) self.socket.bind("tcp://*:" + str(port)) self.session = Session() self.done = False while not self.done: try: self.loop() except Exception as e: log.critical("There exist unhandled exception!", e.args) self.clean()
from xing.xasession import Session session = Session() session.login('credential.conf') print(session.account()) print(session.heartbeat()) session.logout()
def login(self, **kwargs): self.session = Session() self.session.login(**kwargs) return True