Python ntpq
Achim Gratz
Stromeko at nexgo.de
Sun Nov 27 13:43:21 UTC 2016
Achim Gratz writes:
> Eric S. Raymond writes:
>>> That now doesn't work like this:
>>
>> Fix pushed. Try again?
>
> Almost there… where are the double double quotes coming from?
Fixed by:
--- a/pylib/packet.py
+++ b/pylib/packet.py
@@ -1108,7 +1108,6 @@ class ControlSession:
response = ""
for c in self.response:
if c == '"':
- response = response + c
instring = not instring
if instring and c == ',':
response = response + "\xae"
> And can the header rule be truncated to the table width, please?
Fixed by:
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -87,14 +87,14 @@ class PeerSummary:
# By default, the peer spreadsheet layout is designed so lines just
# fit in 80 characters. This tells us how much extra horizontal space
# we have available on a wider terminal emulator.
- self.horizontal_slack = (termwidth or 80) - 80
+ self.horizontal_slack = min((termwidth or 80) - 80, 24)
# Peer spreadsheet column widths. The reason we cap extra
# width used at 24 is that on very wide displays, slamming the
# non-hostname fields all the way to the right produces a huge
# river that makes the entries difficult to read as wholes.
# This choice caps the peername field width at that of the longest
# possible IPV6 numeric address.
- self.namewidth = 15 + min(self.horizontal_slack, 24)
+ self.namewidth = 15 + self.horizontal_slack
self.refidwidth = 15
# Compute peer spreadsheet headers
self.__remote = " remote ".ljust(self.namewidth)
Although I still think the limiting should be done in ntpq (or any other
program using utils) rather than there so that one can override the
termwidth from the top-level caller without second-guessing by util.
Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
Samples for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra
More information about the devel
mailing list