From bb2cbd527bffadbe22465a3d486e436192e01237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 29 Sep 2015 12:51:11 -0700 Subject: [PATCH] Increase wiki error detail length limit 8k is too small, e.g. when make -jN errors or when there are a lot of scanner errors and warnings. 16k should be better. Also, use "[...]" to make it obvious that the output is truncated. --- fdroidserver/common.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 67885fd6..1c3ab8e4 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -1099,14 +1099,16 @@ class FDroidException(Exception): self.value = value self.detail = detail + def limit_size(detail): + if len(detail) < 16000: + return detail + return '[...]\n' + detail[-16000:] + def get_wikitext(self): ret = repr(self.value) + "\n" if self.detail: ret += "=detail=\n" - ret += "
\n"
-            txt = self.detail[-8192:] if len(self.detail) > 8192 else self.detail
-            ret += str(txt)
-            ret += "
\n" + ret += "
\n" + limit_size(self.detail) + "
\n" return ret def __str__(self):