[Git][NTPsec/ntpsec][master] Deleted 6 commits: Change 'notes' to 'footer'. More flexible.

Eric S. Raymond gitlab at mg.gitlab.com
Wed Aug 17 22:57:19 UTC 2016


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


WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below.


Deleted commits:
e97a93e7 by Gary E. Miller at 2016-08-17T18:56:30-04:00
Change 'notes' to 'footer'. More flexible.

The 'footer' file can contain server notes (OS, GPS, etc.),
configuration notes (ntp.conf, recent changes), and maybe
links to other pages.

- - - - -
fa608329 by Gary E. Miller at 2016-08-17T18:56:38-04:00
Document the new ntpviz footer file.

- - - - -
25cd615f by Gary E. Miller at 2016-08-17T18:56:46-04:00
ntpviz man page typos and tweaks.

- - - - -
42254275 by Gary E. Miller at 2016-08-17T18:56:51-04:00
Add a 'header' file, just like the 'footer' file.

A good place to put links between day/week graphs, etc.

- - - - -
b1f7f7f2 by Gary E. Miller at 2016-08-17T18:56:57-04:00
Document new ntpviz 'header' file.

A good place to put links or headline notes.

- - - - -
560f8264 by Gary E. Miller at 2016-08-17T18:57:02-04:00
Make ntpviz html5 valid again.

It seems html5 no longer allows cache directives of any kind.
It seems they never worked, so instead of fixing them they removed
them.

- - - - -


2 changed files:

- docs/includes/ntpviz-body.txt
- ntpstats/ntpviz


Changes:

=====================================
docs/includes/ntpviz-body.txt
=====================================
--- a/docs/includes/ntpviz-body.txt
+++ b/docs/includes/ntpviz-body.txt
@@ -90,6 +90,21 @@ named 'ntpgraphs', but the name can be changed with the -o option.
 Warning: existing PNG files and index.html in this directory will be
 clobbered.
 
+When an index is generated, ntpviz will look for two files in the
+output directory.  Neither file need be present, and both files may
+contain aribtrary HTML.
+
+The first file is named 'header'.  The contents of that file will be
+added almost at the top of the body on the generated index.
+
+This is the place to put links to other web pages, or headline notes.
+
+The second file is named 'footer'.  The contents of that file will be
+added almost at the bottom of the body on the generated index.
+
+It is suggested that notes on the server be included in the footer
+file: OS, versions, CPU speed, etc.  You may also put links there.
+
 The code includes various sanity checks and will bail out with a message to
 standard error on, for example, missing logfile data required for a plot.
 


=====================================
ntpstats/ntpviz
=====================================
--- a/ntpstats/ntpviz
+++ b/ntpstats/ntpviz
@@ -374,14 +374,11 @@ if __name__ == '__main__':
         now = datetime.datetime.utcnow()
         index_header = '''\
 <!DOCTYPE html>
-<html>
+<html lang="en">
 <head>
 <meta charset="UTF-8">
 <meta http-equiv="refresh" content="1800">
-<meta http-equiv="expires" content="0">
-<meta http-equiv="cache-content" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="content-language" content="en_US">
+<meta name="expires" content="0">
 <title>ntpviz plot</title>
 </head>
 <body>
@@ -393,7 +390,7 @@ if __name__ == '__main__':
 '''
         index_header += 'Last Update: %s UTC <br>' %  now.strftime("%c")
         index_header += 'Period: %s days <br></div> ' %  period_days
-        index_header += '<div style="clear:both;"/>'
+        index_header += '<div style="clear:both;"></div>'
 
         index_trailer = '''\
 <br>
@@ -425,17 +422,29 @@ ntpviz</a>, part of the <a href="https://www.ntpsec.org/">NTPsec project</a>
             gnuplot(image, os.path.join(outdir, imagename + ".png"))
             with open(os.path.join(outdir, "index.html"), "w") as ifile:
                 ifile.write(index_header)
+                # if header file, add it to index.html
+                header = os.path.join(outdir, "header")
+                if os.path.isfile(header):
+                    try:
+                        header_file = open( header, 'r')
+                        header_txt = header_file.read()
+                        ifile.write('<br>\n' + header_txt + '\n')
+                    except IOError:
+                        pass
+                # now the graphs
                 for (imagename, _) in imagepairs:
                     ifile.write("<img src='%s.png' alt='%s plot'>\n" % (imagename, imagename.replace('-', ' ')))
-                # if notes file, add it to index.html
-                notes = os.path.join(outdir, "notes")
-                if os.path.isdir(outdir):
+                # if footer file, add it to index.html
+                footer = os.path.join(outdir, "footer")
+                if os.path.isfile(footer):
                     try:
-                        notes_file = open( notes, 'r')
-                        notes_txt = notes_file.read()
-                        ifile.write('<br>Notes:\n' + notes_txt + '\n')
+                        footer_file = open( footer, 'r')
+                        footer_txt = footer_file.read()
+                        ifile.write('<br>\n' + footer_txt + '\n')
                     except IOError:
                         pass
+                # and finish the file
                 ifile.write(index_trailer)
+                ifile.close()
 
 # end



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/298805ed20a586eb6436ed1e9ebcfe1e5a2ca224...560f8264625526017b0cc31698c704aa539f1135
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160817/f4429d94/attachment.html>


More information about the vc mailing list