Python ntpq

Achim Gratz Stromeko at nexgo.de
Sun Nov 27 08:14:11 UTC 2016


Eric S. Raymond writes:
> 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.

Then it's not appropriate to make the choice of interpreter dependent on
the vagaries of the PATH setting at the time of invocation as you do now
by using env to find the binary.  Especially in the case the user built
ntp with a specific python binary it might not be in path at all for the
user(s) invoking the scripts.

> 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, here I was hoping that by giving the -w option it would switch
back to using a fixed width display since it's now again having a whole
line for the variable length component to play with.

> 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.

Yes, and please provide an option to set that width instead of trying to
figure out a number that works for everyone.  Well, you can do that too,
but I can guarantee that whatever number you come up with doesn't work
for at least one person.

There is actually a much better solution: move the variable length field
to the end of the line.  It also needs an option since it breaks
compatibility (the wide display already does anyway since you can't
parse the output using fixed columns anymore).


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds



More information about the devel mailing list