def __init__(self, host, port, parent=None): super(window_main, self).__init__(parent) self.__conn = connection.connection(host=host, port=port) self.client = client.client(self.__conn) self.handler = handler.handler(self.__conn) self.thread = QThread() self.setupUi(self) self.setupConnect() self.__exit = False
def start(mode): hostname = socket.gethostname() local_ip = socket.gethostbyname(hostname) print("Verwendete IP ist " + local_ip) value = inp("IP ändern [y/N]", ["Y", "y", "N", "n"]).lower() if(value == "y"): local_ip = input("Neue IP : ") if mode == 0: print("Server Start") s = server(str(local_ip)) elif mode == 1: print("Client Start") c = client(str(local_ip))
def __init__(self): self.__bookId = 5 self.__title = "Fratii Karamazov" self.__author = "Dostoievski" self.__description = "pam pam" self.__clientId = 7 self.__name = "Ion Iliescu" self.__rentalId = 16 self.__rentedDate = 20 self.__dueDate = 13 self.__returnedDate = 30 self.__book = Book(self.__bookId, self.__title, self.__description, self.__author) self.__client = client(self.__clientId, self.__name) self.__rental = rental(self.__rentalId, self.__bookId, self.__clientId, self.__rentedDate, self.__dueDate, self.__returnedDate) self.__repo = repository() self.__valid = validation() self.__repo1 = repository() self.__business = business(self.__repo1, self.__valid)
def add(self, li): ''' This method adds a new client object to the client list ''' self._clientList.append(client(li[0], li[1]))
sys.path.append(r'../') from client import client url = 'http://www.yunqi.com/index.php/openapi/rpc/service' flag = 'test' token = 'OaYMGiaNlXXsspjnsnTjzjrDCYWngEkh' obj = "po.add" parameter = { 'name' : '采购单1', #采购单名称 'vendor' : '123', #供应商 'po_type' : 1, #1 – 现购2 – 赊购 'branch_bn' : 'stockhouse', #到货仓库编号 'arrive_time' : 1, #到货时间 'operator' : 'admin', #经办人 'memo' : '备注', #备注 'items' : '[{"bn":"00000001","name":"商品1","nums":"2","price":"1"}]', #货号 货品名称 数量 单价 } client = client() cli = client.client(url,parameter,obj,flag,token) print(cli)
def updateClient(self, clientId, name): new_client = client(clientId, name) self.__repo.updateClientList(new_client)
def removeClient(self, clientId, name): old_client = client(clientId, name) self.__repo.removeElement(old_client)
def addNewClient(self, clientId, name): new_client = client(clientId, name) self.__repo.addElement(new_client)
def create_client(): logging.info("starting the client") this_client = client() this_client.recv()
from client import client if __name__ == '__main__': client.client()