from . import api
class Client:
## pylint: disable=too-many-instance-attributes,too-many-arguments
def __init__(self, host='localhost', port=44363, username='anon', key='1234', insecure=False, is_node=False):
self.api = api.v1.Client()
self.host = host
self.port = port
self.insecure = insecure
self.username = username
self.key = key
self.is_node = is_node
self.task = None
def is_connected(self):
return self.api.is_connected()
def is_performing_task(self):
return self.task != None
def get_task(self):
return self.task
def get_host_port(self):
return self.api.get_host_port()
def set_host_port(self, host, port):
return self.api.set_host_port(host, port)
def set_insecure(self, insecure):
return self.api.set_insecure(insecure)
def get_server_info(self, key):
return self.api.get_server_info(key)
def connect(self, user, key):
return self.api.connect(user, key)
def disconnect(self):
return self.api.disconnect()
def idle(self):
pass
def request_new_task(self):
pass