From 32c16bb2060a6cc7e46d6cea84d07a0c86094270 Mon Sep 17 00:00:00 2001 From: Artem30801 Date: Thu, 21 Mar 2019 22:00:27 +0300 Subject: [PATCH] Json error fix --- Drone/client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Drone/client.py b/Drone/client.py index a0e9d52..18c13ca 100644 --- a/Drone/client.py +++ b/Drone/client.py @@ -110,9 +110,9 @@ def form_message(str_command, dict_arguments): def parse_message(msg): try: j_message = json.loads(msg) - except json.decoder.JSONDecodeError: + except json.JSONDecodeError: print("Json string not in correct format") - return None + return None, None str_command = list(j_message.keys())[0] @@ -253,13 +253,13 @@ try: command, args = parse_message(message) print("Command from server:", command, args) if command == "writefile": - recive_file(list(args.values)[0]) + recive_file(list(args.values)[0]) #TODO repace elif command == 'config_write': write_to_config(args['section'], args['option'], args['value']) elif command == 'config_reload': load_config() elif command == "starttime": - starttime = float(list(args.values)[0]) + starttime = float(list(args.values)[0]) #TODO repace print("Starting on:", time.ctime(starttime)) dt = starttime - get_ntp_time(NTP_HOST, NTP_PORT) print("Until start:", dt)