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
+7
-4
+7
-4
@@ -285,10 +285,13 @@ class Handler(SimpleHTTPRequestHandler):
|
||||
))
|
||||
return parts
|
||||
|
||||
def parse_cmd(self, cmd):
|
||||
pieces = cmd.split(" ")
|
||||
handler = self.get_parsers().get(pieces[0])
|
||||
return handler(pieces) if handler else {}
|
||||
def parse_cmd(self, cmdstring):
|
||||
response = ""
|
||||
for cmd in cmdstring.split("\n"):
|
||||
pieces = cmd.split(" ")
|
||||
handler = self.get_parsers().get(pieces[0])
|
||||
response += str(handler(pieces)) + "\n"
|
||||
return response
|
||||
|
||||
def get_parsers(self):
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user