Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6983e03
)
python: Made PDM REPL output more easily parsable.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Fri, 18 Nov 2011 03:35:12 +0000
(
04:35
+0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Fri, 18 Nov 2011 03:35:12 +0000
(
04:35
+0100)
python/ashd/pdm.py
patch
|
blob
|
blame
|
history
diff --git
a/python/ashd/pdm.py
b/python/ashd/pdm.py
index
de4ac7a
..
5d95d8f
100644
(file)
--- 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")
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):
def echo(self, ob):
- self.
cl.sk.send(self.printer.pformat(ob) + "\n"
)
+ self.
sendlines(self.printer.pformat(ob)
)
def command(self, cmd):
try:
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("+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):
self.cl.sk.send("+EXC\n")
def handle(self, buf):