[Git][NTPsec/ntpsec][master] ntpviz. Make summary.csv comply with RFC4180

Gary E. Miller gitlab at mg.gitlab.com
Sun Oct 16 20:00:34 UTC 2016


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


Commits:
3f1e862e by Gary E. Miller at 2016-10-16T13:00:18-07:00
ntpviz.  Make summary.csv comply with RFC4180

- - - - -


1 changed file:

- ntpstats/ntpviz


Changes:

=====================================
ntpstats/ntpviz
=====================================
--- a/ntpstats/ntpviz
+++ b/ntpstats/ntpviz
@@ -92,9 +92,10 @@ class VizStats(NTPStats):
     unit        = 's'         # display units: s, ppm, etc.
     multiplier  = 1
 
+    # observe RFC 4180, end lines with CRLF
     csv_head =  """\
-Name, Min, 1%, 5%, 50%, 95%, 99%, Max,, 90% Range, 98% Range, StdDev,, \
-Mean, Units
+Name, Min, 1%, 5%, 50%, 95%, 99%, Max,, 90% Range, 98% Range, StdDev, , \
+Mean, Units\r
 """
 
     table_head =  """\
@@ -234,11 +235,11 @@ Mean, Units
 
         s =  """\
 %(title)s, %(p0)s, %(p1)s, %(p5)s, %(p50)s, %(p95)s, %(p99)s, %(p100)s, , \
- %(r90)s, %(r98)s, %(pstd)s, , %(mu)s, %(unit)s
+ %(r90)s, %(r98)s, %(pstd)s, , %(mu)s, %(unit)s\
 """
 
-        self.csv   =  s % self.percs    # no commas in the csv
-        self.table =  s % self.percs_f
+        self.csv   =  s % self.percs + '\r\n'    # RFC4180 says CRLF
+        self.table =  s % self.percs_f + '\n'
 
         self.table = '<tr style="vertical-align:top;">' + \
                      '<td style="text-align:left;">' + \



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/3f1e862eaf8b52067e6fa401af3e3f4b7e9e4ecc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161016/d65ce38a/attachment.html>


More information about the vc mailing list