[Git][NTPsec/ntpsec][master] Have f8dot4() and f8dot3() use string constants for signals.

Gary E. Miller gitlab at mg.gitlab.com
Tue Aug 8 22:39:41 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
68863d4b by Gary E. Miller at 2017-08-08T15:38:44-07:00
Have f8dot4() and f8dot3() use string constants for signals.

A better way to show missing data.

- - - - -


1 changed file:

- pylib/util.py


Changes:

=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -390,6 +390,8 @@ def f8dot4(f):
     if str(float(f)).lower() == 'nan':
         # yes, this is a better test than math.isnan()
         # it also catches None, strings, etc.
+        if isinstance(s, basestring):
+              return "%8s" % f
         return "     nan"
 
     fmt = "%8d"          # xxxxxxxx
@@ -421,6 +423,8 @@ def f8dot3(f):
     if str(float(f)).lower() == 'nan':
         # yes, this is a better test than math.isnan()
         # it also catches None, strings, etc.
+        if isinstance(s, basestring):
+              return "%8s" % f
         return "     nan"
 
     fmt = "%8d" % f          # xxxxxxxx or -xxxxxxx
@@ -751,10 +755,10 @@ class PeerSummary:
         clock_name = ''
         dstadr_refid = ""
         dstport = 0
-        estdelay = ""
-        estdisp = float('NaN')
-        estjitter = ""
-        estoffset = ""
+        estdelay = '.'
+        estdisp = '.'
+        estjitter = '.'
+        estoffset = '.'
         filtdelay = 0.0
         filtdisp = 0.0
         filtoffset = 0.0



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/68863d4b9f152f0a06e4029af1f5c85a843c9712

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/68863d4b9f152f0a06e4029af1f5c85a843c9712
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170808/ac3273bd/attachment.html>


More information about the vc mailing list