Python ntpq

Eric S. Raymond esr at thyrsus.com
Sun Nov 27 00:44:11 UTC 2016


Achim Gratz <Stromeko at nexgo.de>:
> Eric S. Raymond writes:
> > We've tried to
> > write the NTPsec Python this way, but the packet library is still
> > under active development on a Python 2 system and that sometimes
> > breaks Python 3 compatibility.  One of our guys, Matt Selsky, is
> > working on catching it up and I expect fixes will land soon.
> 
> OK, but if it's finally version-agnostic the ntp sub-directory should
> not be installed into a version-dependent tree.

You have a point. Unfortunately there is no version-independent place
for Python libraries that the Python interpreter recognizes. And
there's a good reason for this - the bytecode used in .pyc/.pyo files
(the just-in-time compiled versions of .py files) differs across
versions.

> > No can do.  You're going to have to live with using the --wide option.
> 
> How about giving this option a number argument?  Besides, the --help says:
> 
>    -w no  wide           enable wide display of addresses 

The -w option doesn't actually use more screen width at all.  Instead...uh oh,
it's got a bug.  Fix pushed.  Where was I?  Oh yes:

esr at snark:~/software/ntp-rescue/ntpsec$ ntpq/ntpq -p
     remote              refid      st t when poll reach   delay   offset  jitter
=================================================================================
 us.pool.ntp.org    .POOL.          16 p    -   64    0    0.000    0.000   0.001
-104.131.53.252     209.51.161.238   2 u   51   64  377    8.115    0.195   1.176
-104.156.99.226     192.12.19.20     2 u    1   64  377   80.869    4.499   0.566
-mirror             216.93.242.12    3 u    -   64  377   28.447    0.181   0.691
-mis.wci.com        131.107.13.100   2 u   34   64  377   78.246    2.603   0.893
-cheezum.mattnordho 66.228.59.187    3 u   97  128  377   45.435    2.786   0.814
*level1e.cs.unc.edu .PPS.            1 u    6   64  377   30.781   -1.981   0.678
-66.241.101.63      169.254.0.2      2 u   68  128  377   60.657    2.227   1.192
+helium.constant.co 208.90.144.72    2 u   61   64  377   13.262   -3.405   0.736
-enigma.wiredgoats. 64.142.1.20      2 u   46   64  377   75.871    1.312   1.044
+mail.coldnorthadmi 132.246.11.231   2 u   51   64  377   10.741   -2.608   1.207
esr at snark:~/software/ntp-rescue/ntpsec$ ntpq/ntpq -p -w
     remote              refid      st t when poll reach   delay   offset  jitter
=================================================================================
 us.pool.ntp.org    .POOL.          16 p    -   64    0    0.000    0.000   0.001
-104.131.53.252     209.51.161.238   2 u   53   64  377    8.115    0.195   1.176
-104.156.99.226     192.12.19.20     2 u    3   64  377   80.869    4.499   0.566
-mirror             216.93.242.12    3 u    2   64  377   28.447    0.181   0.691
-mis.wci.com        131.107.13.100   2 u   36   64  377   78.246    2.603   0.893
-cheezum.mattnordhoff.net
                    66.228.59.187    3 u   99  128  377   45.435    2.786   0.814
*level1e.cs.unc.edu .PPS.            1 u    8   64  377   30.781   -1.981   0.678
-66.241.101.63      169.254.0.2      2 u   70  128  377   60.657    2.227   1.192
+helium.constant.com
                    208.90.144.72    2 u   63   64  377   13.262   -3.405   0.736
-enigma.wiredgoats.com
                    64.142.1.20      2 u   48   64  377   75.871    1.312   1.044
+mail.coldnorthadmin.com
                    132.246.11.231   2 u   53   64  377   10.741   -2.608   1.207
esr at snark:~/software/ntp-rescue/ntpsec$ 

See the difference?  A numeric argument to -w wouldn't mean anything.  Besides,
it would be the kind of compatibility break that people yell about.

> Well, I'm not giving it the -w / --wide option and it still uses a wide
> display for the peers.  It doesn't use wide display for the rv and cv
> commands no matter the option.  So I'd think it's actually ignoring the
> option at the moment.

Nope, it's paying attention all right, it's just interpreting "wide"
in a way you're not expecting, that has nothing to do with the screen
width.  (We inherited this behavior and I haven't changed it.)

The only way I can think of to get near to what you want would be to set
a maximum width for the clockname field, implicitly bounding the amount the
display can extent to the right.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>


More information about the devel mailing list