mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-11-01 18:04:12 +08:00
Updating to support \n separated commands, might need to support \r\n
as well, but this'll do for now
This commit is contained in:
1 parent
8bd9231432
commit
2ecef98263
1 file changed
+5
-2
+5
-2
@@ -285,10 +285,13 @@ class Handler(SimpleHTTPRequestHandler):
|
|||||||
))
|
))
|
||||||
return parts
|
return parts
|
||||||
|
|
||||||
def parse_cmd(self, cmd):
|
def parse_cmd(self, cmdstring):
|
||||||
|
response = ""
|
||||||
|
for cmd in cmdstring.split("\n"):
|
||||||
pieces = cmd.split(" ")
|
pieces = cmd.split(" ")
|
||||||
handler = self.get_parsers().get(pieces[0])
|
handler = self.get_parsers().get(pieces[0])
|
||||||
return handler(pieces) if handler else {}
|
response += str(handler(pieces)) + "\n"
|
||||||
|
return response
|
||||||
|
|
||||||
def get_parsers(self):
|
def get_parsers(self):
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in new issue
Block a user