[Git][NTPsec/ntpsec][master] 5 commits: Typos

Eric S. Raymond gitlab at mg.gitlab.com
Wed Oct 26 09:19:26 UTC 2016


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


Commits:
d4a77f42 by Matt Selsky at 2016-10-26T01:44:02-04:00
Typos

- - - - -
bce18dd6 by Matt Selsky at 2016-10-26T01:44:08-04:00
Update pyntpq pktversion to match ntpq

- - - - -
390d5a9d by Matt Selsky at 2016-10-26T02:10:18-04:00
Properly decode mode values in pyntpq

- - - - -
6684cbea by Matt Selsky at 2016-10-26T02:10:18-04:00
Fix spaces in pyntpq leapsecond indicator

- - - - -
fcc5b5d1 by Matt Selsky at 2016-10-26T02:25:05-04:00
Fix calls to say() to use proper syntax.

- - - - -


2 changed files:

- ntpq/pyntpq
- ntpstats/ntpviz


Changes:

=====================================
ntpq/pyntpq
=====================================
--- a/ntpq/pyntpq
+++ b/ntpq/pyntpq
@@ -148,7 +148,7 @@ class Ntpq(cmd.Cmd):
         self.chosts = []		# Command-line hosts
         self.peers = []			# Data from NTP peers.
         self.debug = 0
-        self.pktversion = NTP_VERSION
+        self.pktversion = NTP_OLDVERSION + 1
         self.uservars = collections.OrderedDict()
 
     def emptyline(self):
@@ -177,7 +177,7 @@ usage: help [ command ]
     @staticmethod
     def high_truncate(hostname, maxlen):
         "Truncate on the left using leading _ to indicate 'more'."
-        # Used for local IPv6 addresses, best distinguashed by low bits
+        # Used for local IPv6 addresses, best distinguished by low bits
         if len(hostname) <= maxlen:
             return hostname
         else:
@@ -606,12 +606,12 @@ usage: help [ command ]
             self.say("server=%s " % self.session.hostname)
 	if not variables:
             if associd == 0:
-                self.say("No system%s variables returned\n",
+                self.say("No system%s variables returned\n"%
 				" clock" if (type == TYPE_CLOCK) else "")
             else:
-                self.say("No information returned for%s association %d\n",
-				" clock" if (type == TYPE_CLOCK) else "",
-				associd)
+                self.say("No information returned for%s association %d\n"%
+				(" clock" if (type == TYPE_CLOCK) else "",
+				associd))
             return True
 	if not quiet:
             self.say("associd=%d " % associd);
@@ -665,8 +665,17 @@ usage: timeout [ msec ]
                 self.say("%s  %s\n" % (legend, value))
             elif fmt == NTP_LFP:
                 self.say("%s  %s\n" % (legend, prettydate(value)))
-            elif fmt in (NTP_2BIT, NTP_MODE):
-                self.say("%s %s\n" % (legend, ("00", "01", "10", "11")[value]))
+            elif fmt == NTP_2BIT:
+                self.say("%s  %s\n" % (legend, ("00", "01", "10", "11")[value]))
+            elif fmt == NTP_MODE:
+                modes = (
+                    "unspec", "sym_active", "sym_passive", "client", "server",
+                    "broadcast", "control", "private", "bclient"
+                )
+                try:
+                    self.say("%s  %s\n" % (legend, modes[value]))
+                except IndexError:
+                    self.say("%s  %s%d\n" % (legend, "mode#", value))
             else:
                 self.warn("unexpected vc type %s for %s, value %s\n" % (fmt, name, value))
 


=====================================
ntpstats/ntpviz
=====================================
--- a/ntpstats/ntpviz
+++ b/ntpstats/ntpviz
@@ -339,7 +339,7 @@ set rmargin 10
                 plot_data += row[1] + ' ' + row[item1] + '\n'
         # I know you want to replace the plot_data string concat with
         # or more join()s, do not do it, it is slower
-        # next you'll want to try %-subsitution.  it too is slower
+        # next you'll want to try %-substitution.  it too is slower
         plot_data += "e\n"
         return plot_data
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/7ec553280d604ed4fa7564cdf10894239e549af9...fcc5b5d1511b242e6423b2557e88910f5bb960f7
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161026/57dea546/attachment.html>


More information about the vc mailing list