From 431a6d1fd67450dc22ea30fa4c15712c21ea6bdd Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 12 Feb 2019 19:00:24 -0500 Subject: [PATCH] Make the log limit more generous, fix line numbers --- buildsrht/blueprints/jobs.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/buildsrht/blueprints/jobs.py b/buildsrht/blueprints/jobs.py index beed9b0..a2e0959 100644 --- a/buildsrht/blueprints/jobs.py +++ b/buildsrht/blueprints/jobs.py @@ -215,7 +215,7 @@ def tag_svg(username, path): .filter(Job.tags.ilike(path + "%")) return svg_page(jobs) -log_max = 16384 +log_max = 131072 def logify(text, task, log_url): if len(text) >= log_max: @@ -224,18 +224,20 @@ def logify(text, task, log_url): text = text[text.index('\n')+1:] except ValueError: pass + nlines = text.encode().count(b'\n') text = (Markup('
')
                 + Markup(''
-                    'This is a big file! Only the last 16KiB is shown. '
+                    'This is a big file! Only the last 128KiB is shown. '
                     f''
                         'Click here to download the full log.'
                     '\n\n')
                 + escape(text)
                 + Markup('
')) + linenos = Markup('
\n\n\n')
     else:
+        nlines = text.encode().count(b'\n')
         text = Markup('
') + escape(text) + Markup('
') - nlines = text.encode().count(b'\n') - linenos = Markup('
')
+        linenos = Markup('
')
     for no in range(1, nlines + 1):
         linenos += Markup(f"{no}")
         if no != nlines:
-- 
2.38.5