From 0560e19edd1f87694c5eb995844e61dd3e06997f Mon Sep 17 00:00:00 2001 From: Rena kim Date: Mon, 19 Mar 2018 17:28:47 +0900 Subject: [PATCH] bug fix file options not use thread. --- wizconfig.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/wizconfig.py b/wizconfig.py index 51f7dc8..274b982 100644 --- a/wizconfig.py +++ b/wizconfig.py @@ -368,11 +368,19 @@ def run(self): th_config.SetMultiIP(host_ip) th_config.start() elif args.getfile: - # op_code = OP_GETFILE + op_code = OP_GETFILE cmd_list = wizmakecmd.get_value(mac_addr, args.getfile) - th_config = MultiConfigThread(mac_addr, cmd_list, OP_GETFILE) - th_config.start() + wizmsghangler.makecommands(cmd_list, op_code) + wizmsghangler.sendcommands() + wizmsghangler.parseresponse() + elif args.setfile: + op_code = OP_SETFILE + print('[Setfile] Device [%s] Config from \'%s\' file.' % (mac_addr, args.setfile)) + cmd_list = wizmakecmd.set_value(mac_addr, args.setfile) + + wizmsghangler.makecommands(cmd_list, op_code) + wizmsghangler.sendcommands() else: if args.reset: print('[Multi] Reset devices %d: %s' % (i+1, mac_addr)) @@ -380,16 +388,11 @@ def run(self): elif args.factory: print('[Multi] Factory reset devices %d: %s' % (i+1, mac_addr)) cmd_list = wizmakecmd.factory_reset(mac_addr) - elif args.setfile: - # op_code = OP_SETFILE - print('[Setfile] Device [%s] Config from \'%s\' file.' % (mac_addr, args.setfile)) - cmd_list = wizmakecmd.set_value(mac_addr, args.setfile) else: # op_code = OP_SETCOMMAND print('[Multi] Setting devcies %d: %s' % (i+1, mac_addr)) cmd_list = wizmakecmd.setcommand(mac_addr, list(setcmd.keys()), list(setcmd.values())) get_cmd_list = wizmakecmd.getcommand(mac_addr, list(setcmd.keys())) - th_config = MultiConfigThread(mac_addr, cmd_list, OP_SETCOMMAND) th_config.start() # print(' op_code %d, cmd_list: %s\n' % (op_code, cmd_list))