Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
file options not use thread.
  • Loading branch information
renakim committed Mar 19, 2018
1 parent be47c2d commit 0560e19
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions wizconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,28 +368,31 @@ 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))
cmd_list = wizmakecmd.reset(mac_addr)
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('<ALL> op_code %d, cmd_list: %s\n' % (op_code, cmd_list))
Expand Down

0 comments on commit 0560e19

Please sign in to comment.