summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asciifarm/client/commandhandler.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/asciifarm/client/commandhandler.py b/asciifarm/client/commandhandler.py
index 550484c..9a0ff44 100644
--- a/asciifarm/client/commandhandler.py
+++ b/asciifarm/client/commandhandler.py
@@ -1,5 +1,6 @@
import shlex
+import json
class InvalidCommandException(Exception):
pass
@@ -23,7 +24,9 @@ class CommandHandler:
"inputwithselected": self.actWithSelected,
"eval": self.eval,
"exec": self.exec,
- "scrollchat": self.scrollChat
+ "scrollchat": self.scrollChat,
+ "json": self.json,
+ "ijson": self.ijson
}
def execute(self, action):
@@ -81,4 +84,10 @@ class CommandHandler:
def scrollChat(self, lines):
self.client.display.scrollBack(lines)
+ def json(self, text):
+ self.send(json.loads(text))
+
+ def ijson(self, text):
+ self.input(json.loads(text))
+