[Git][NTPsec/ntpsec][master] In pyntpq, add line folding to variable dumping.

Eric S. Raymond gitlab at mg.gitlab.com
Wed Oct 26 10:15:38 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
9dd30efb by Eric S. Raymond at 2016-10-26T06:14:42-04:00
In pyntpq, add line folding to variable dumping.

- - - - -


1 changed file:

- ntpq/pyntpq


Changes:

=====================================
ntpq/pyntpq
=====================================
--- a/ntpq/pyntpq
+++ b/ntpq/pyntpq
@@ -579,6 +579,14 @@ usage: help [ command ]
                 else:
                     item += repr(value)
                 item += ", "
+                lastcount = 0
+                for c in text:
+                    if c == '\n':
+                        lastcount = 0
+                    else:
+                        lastcount += 1
+                if lastcount + len(item) > 78:
+                    text = text[:-1] + "\n"
                 text += item
             text = text[:-2] + "\n"
         text = text.replace("'", '"')



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/9dd30efb21cadd4756d9eeac16394a6e54bfd096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161026/344d1059/attachment.html>


More information about the vc mailing list