[Git][reproducible-builds/diffoscope][master] Avoid clumsy profiling title length calculations by using Markdown syntax, not reStructuredText.

Chris Lamb gitlab at salsa.debian.org
Sat Jan 26 00:17:02 CET 2019


Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
ef2aa62f by Chris Lamb at 2019-01-25T22:57:14Z
Avoid clumsy profiling title length calculations by using Markdown syntax, not reStructuredText.

- - - - -


1 changed file:

- diffoscope/profiling.py


Changes:

=====================================
diffoscope/profiling.py
=====================================
@@ -72,21 +72,18 @@ class ProfileManager(object):
             self.output(fn)
 
     def output(self, print_fn):
-        title = "Profiling output for: {}".format(' '.join(sys.argv))
+        title = "# Profiling output for: {}".format(' '.join(sys.argv))
 
         print_fn(title)
-        print_fn("=" * len(title))
 
         def key(x):
             return x[1]['time']
 
         for namespace, keys in sorted(self.data.items(), key=lambda x: x[0]):
-            subtitle = "{} (total time: {:.3f}s)".format(
+            print_fn("\n## {} (total time: {:.3f}s)".format(
                 namespace,
                 sum(x['time'] for x in keys.values()),
-            )
-
-            print_fn("\n{}\n{}\n".format(subtitle, "-" * len(subtitle)))
+            ))
 
             for value, totals in sorted(keys.items(), key=key, reverse=True):
                 print_fn("  {:10.3f}s {:6d} call{}    {}".format(



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/ef2aa62f279a57b92ab6e8c4f709a7e3509b31f2

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/ef2aa62f279a57b92ab6e8c4f709a7e3509b31f2
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20190125/9de5beab/attachment.html>


More information about the rb-commits mailing list