From 6b1c83e57869dc2a5f20ed5cdf35c90deb466b61 Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Wed, 1 May 2019 20:12:11 +0200 Subject: ctl messages are json, not yaml --- pyapd/ctl.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pyapd/ctl.py b/pyapd/ctl.py index 4f5270f..8be523d 100644 --- a/pyapd/ctl.py +++ b/pyapd/ctl.py @@ -1,9 +1,8 @@ import errno import functools +import json import socket -import ruamel.yaml - import tornado.netutil import tornado.ioloop import tornado.iostream @@ -19,7 +18,6 @@ class Commands(): class CtlServer(): def __init__(self, config): - self.yaml = ruamel.yaml.YAML(typ='safe') self.commands = Commands() self.config = config self.ctl_socket = tornado.netutil.bind_unix_socket( @@ -53,7 +51,7 @@ class CtlServer(): print("command result was:", res) async def get_command(self, message): - args = self.yaml.load(message) + args = json.loads(message) cmd = args.pop('command') try: res = getattr(self.commands, cmd)(*args) @@ -61,5 +59,5 @@ class CtlServer(): res = "no such command" except TypeError: res = "syntax error" - # TODO: wrap res in a sensible yaml + # TODO: wrap res in a sensible json return res -- cgit v1.2.3