[Piuparts-devel] [PATCH 2/3] piuparts-analyze.py: Repair extract_headers to actually return headers.

debian at mikapflueger.de debian at mikapflueger.de
Fri Jul 29 13:41:12 UTC 2011


From: Mika Pflüger <mika at mikapflueger.de>

---
 piuparts-analyze.py |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/piuparts-analyze.py b/piuparts-analyze.py
index 81907cb..3896c64 100644
--- a/piuparts-analyze.py
+++ b/piuparts-analyze.py
@@ -74,21 +74,13 @@ def extract_errors(log):
         whole += text
     return whole
 
+
 def extract_headers(log):
-    f = file(log, "r")
+    f = open(log)
     data = f.read()
     f.close()
     headers = []
-    cont = False
-    for line in data.split("\n\n", 1)[0].split("\n"):
-        if line.startswith("Start:"):
-            cont = True
-        elif cont and line[:1].isspace():
-            pass
-        else:
-            headers.append(line)
-            cont = False
-    headers = "\n".join(headers)
+    headers = data.partition("\nExecuting:")[0]
     if headers and not headers.endswith("\n"):
         headers += "\n"
     return headers
-- 
1.7.5.4




More information about the Piuparts-devel mailing list