X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=blobdiff_plain;f=python%2Fashd%2Fpdm.py;h=5d95d8f6f67346da4d4bd26a1d960b18cf4da547;hp=de4ac7a6daf45ad00904b584c74c1b31f37d992a;hb=158cbdf5710ee78a32450e0a1c25a75978da81dd;hpb=6983e03616216c8144489707ebf81587a00adf60 diff --git a/python/ashd/pdm.py b/python/ashd/pdm.py index de4ac7a..5d95d8f 100644 --- a/python/ashd/pdm.py +++ b/python/ashd/pdm.py @@ -15,8 +15,12 @@ class repl(object): self.printer = pprint.PrettyPrinter(indent = 4, depth = 6) cl.sk.send("+REPL\n") + def sendlines(self, text): + for line in text.split("\n"): + self.cl.sk.send(" " + line + "\n") + def echo(self, ob): - self.cl.sk.send(self.printer.pformat(ob) + "\n") + self.sendlines(self.printer.pformat(ob)) def command(self, cmd): try: @@ -31,7 +35,7 @@ class repl(object): self.cl.sk.send("+OK\n") except: for line in traceback.format_exception(*sys.exc_info()): - self.cl.sk.send(line) + self.cl.sk.send(" " + line) self.cl.sk.send("+EXC\n") def handle(self, buf):