chiark / gitweb /
Try to fix <pre> issues on large lastbuilds
authorDaniel Martí <mvdan@mvdan.cc>
Mon, 17 Mar 2014 13:52:01 +0000 (14:52 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Mon, 17 Mar 2014 13:52:01 +0000 (14:52 +0100)
fdroidserver/build.py
fdroidserver/common.py

index 92f3d00eccc019a6b18a5afcd69294b61402953f..2155ec814b0d25fb0f9f18cccb5906671c25b711 100644 (file)
@@ -962,10 +962,7 @@ def main():
             if options.wiki and wikilog:
                 try:
                     newpage = site.Pages[app['id'] + '/lastbuild']
-                    txt = wikilog
-                    if len(txt) > 8192:
-                        txt = txt[-8192:]
-                    txt = "Build completed at " + time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime()) + "\n\n" + txt
+                    txt = "Build completed at " + time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime()) + "\n\n" + wikilog
                     newpage.save(txt, summary='Build log')
                 except:
                     logging.info("Error while attempting to publish build log")
index 2cf1904ec68e9ab8659807df01354524b1c49869..75139b28711b58e4d100e879e6c02576fffadd46 100644 (file)
@@ -774,7 +774,8 @@ class BuildException(Exception):
         if self.detail:
             ret += "=detail=\n"
             ret += "<pre>\n"
-            ret += str(self.detail)
+            txt = self.detail[-8192:] if len(self.detail) > 8192 else self.detail
+            ret += str(txt)
             ret += "</pre>\n"
         return ret