[Git][NTPsec/ntpsec][master] ntpviz: remove 3 uses of locals().

Gary E. Miller gitlab at mg.gitlab.com
Sat Oct 29 01:54:56 UTC 2016


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


Commits:
3c4dfa15 by Gary E. Miller at 2016-10-28T18:54:13-07:00
ntpviz: remove 3 uses of locals().

- - - - -


1 changed file:

- ntpstats/ntpviz


Changes:

=====================================
ntpstats/ntpviz
=====================================
--- a/ntpstats/ntpviz
+++ b/ntpstats/ntpviz
@@ -426,7 +426,9 @@ file.</p>
             # fields: time, temp
             plot_data += self.plot_slice( tempsmap[key], 3)
 
-        size = args.png_size
+        out = {}
+        out['sitename'] = sitename
+        out['size'] = args.png_size
 
         plot_template = NTPViz.Common + """\
 set terminal png size %(size)s
@@ -434,11 +436,12 @@ set title "%(sitename)s: Local Temparatures"
 set ytics format "%%1.1f °C" nomirror textcolor rgb '#0060ad'
 set style line 1 lc rgb '#0060ad' lt 1 lw 1 pt 7 ps 0   # --- blue
 plot \\
-""" % locals()
+""" % out
 
         for key in tempslist:
+            out['key'] = key
             plot_template += "'-' using 1:2 title '%(key)s' with line, \\\n" \
-                 % locals()
+                 % out
 
         # strip the trailing ", \n"
         plot_template = plot_template[:-4] + "\n"
@@ -474,7 +477,9 @@ component of frequency drift.</p>
             # fields: time, tdop, nSats
             plot_data += self.plot_slice( gpsmap[key], 3, 4)
 
-        size = args.png_size
+        out = {}
+        out['sitename'] = sitename
+        out['size'] = args.png_size
 
         plot_template = NTPViz.Common + """\
 set terminal png size %(size)s
@@ -484,7 +489,7 @@ set y2tics format "%%2.0f nSat"  nomirror textcolor rgb '#dd181f'
 set style line 1 lc rgb '#0060ad' lt 1 lw 1 pt 7 ps 0   # --- blue
 set style line 2 lc rgb '#dd181f' lt 1 lw 1 pt 5 ps 0   # --- red
 plot \\
-""" % locals()
+""" % out
 
         for key in gpslist:
             plot_template += """\



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


More information about the vc mailing list