fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] multi line output messed up


From: Xinan Wu
Subject: [Fab-user] multi line output messed up
Date: Fri, 10 Jul 2009 20:43:50 -0700

swallows second line, etc. following is a possible fix.

diff -ur fabric-0.9b1-original/fabric/network.py fabric-0.9b1/fabric/network.py
--- fabric-0.9b1-original/fabric/network.py     2009-07-02 21:36:15.000000000 
-0700
+++ fabric-0.9b1/fabric/network.py      2009-07-10 20:35:10.000000000 -0700
@@ -318,7 +318,7 @@
             # Deal with line breaks, printing all lines and storing the
             # leftovers, if any.
             if '\n' in out or '\r' in out:
-                parts = out.splitlines()
+                parts = re.split(r'\r?\n', out)
                 line = leftovers + parts.pop(0)
                 if parts:
                     leftovers = parts.pop()



in old fabric-0.1.1, this is used to be out.split('\n')

"1\n2\n".split('\n') -> ['1','2','']
"1\n2\n".splitlines() -> ['1','2']




reply via email to

[Prev in Thread] Current Thread [Next in Thread]