Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • selsky/ntpsec
  • armbiant/gnome-ntpsec
  • smallm/ntpsec
  • devicenull/ntpsec
  • paelzer/ntpsec
  • mvangund/ntpsec
  • fe051/ntpsec
  • ollie314/ntpsec
  • rlaager/ntpsec
  • fhgwright/ntpsec
  • phirephly/ntpsec
  • Omnifarious/ntpsec
  • ghane/ntpsec
  • antranigv/ntpsec
  • pakarsolusitelematika/ntpsec
  • ianbruene/ntpsec
  • wingel/ntpsec
  • katyaBeck/ntpsec
  • akumiszcza/ntpsec
  • rouing/ntpsec
  • NTPsec/ntpsec
  • mlichvar/ntpsec
  • ktims/ntpsec
  • fararano.kevin/ntpsec
  • phillipcharleshart/ntpsec
  • SPACE001/ntpsec
  • thomasdstewart/ntpsec
  • testsleeek/ntpsec
  • NeatNerdPrime/ntpsec
  • marcinbrodowski35/ntpsec
  • AbbasDev/ntpsec
  • jurgen.xhelo/ntpsec
  • Wan10/ntpsec
  • BrnoPCmaniak/ntpsec
  • anastrophe/ntpsec
  • georgyo/ntpsec
  • mikie.simpson/ntpsec
  • OptimalRanging/ntpsec
  • toofishes/ntpsec
  • Jandrusk/ntpsec
  • sdwalker/ntpsec
  • mnordhoff/ntpsec
  • cjmayo/ntpsec
  • micromax/ntpsec
  • tychotithonus/ntpsec
  • ddrown/ntpsec
  • brendanbank/ntpsec
  • jh23453/ntpsec
  • samifarin/ntpsec
  • miller24joseph/ntpsec
  • AZDNice/ntpsec
  • lnceballos/ntpsec
  • gabriel-ku/ntpsec
  • psreport/ntpsec
  • thesamesam/ntpsec
  • alexk7/ntpsec
  • RRZEFox/ntpsec
  • m_by/ntpsec
  • jameshilliard/ntpsec
  • daemoneye/ntpsec
  • xgerault/ntpsec
  • permanent-vacations/ntpsec
  • o.zeynalpour/ntpsec
  • ravi.love.nippy/ntpsec
  • jhamlin96/ntpsec
  • abaehr/ntpsec
  • accidentallythecable-public/forks/ntpsec
  • james.jstroud/ntpsec
  • youwt19821020/ntpsec-no-root
  • jamesb_fe80/ntpsec
  • demsjf8/ntpsec
  • yegorich/ntpsec
  • 1963bib/ntpsec
  • armbiant/gnome-ntp
  • chucalu/ntpsec
  • folkertvanheusden/ntpsec
  • mktyler/ntpsec
  • 19bcs2794/ntpsec
  • LOCNNIL/ntpsec
  • lifeofguenter/ntpsec
  • trv-n/ntpsec-trimble-3
  • szepeviktor/ntpsec
  • lightswitch05/ntpsec
  • m_msft/ntpsec
84 results
Show changes
Commits on Source (5)
......@@ -290,14 +290,14 @@ def gnuplot(template, outfile=None):
# can be 30% faster to write to a tmp file than to pipe to gnuplot
# bonus, we can keep the plot file for debug.
tmp_file, tmp_filename = tempfile.mkstemp( suffix='.plt')
tmp_file = tempfile.NamedTemporaryFile(mode='w', suffix='.plt', delete=False)
# note that tmp_file is a file handle, it is not a file object
os.write( tmp_file, template)
os.close(tmp_file)
tmp_file.write(template)
tmp_file.close()
# shell=True is a security hazard, do not use
try:
rcode = subprocess.call( ['gnuplot', tmp_filename], stdout=out)
rcode = subprocess.call(['gnuplot', tmp_file.name], stdout=out)
except OSError as e:
if e.errno == os.errno.ENOENT:
# gnuplot not found
......@@ -309,12 +309,12 @@ def gnuplot(template, outfile=None):
if 0 != rcode:
sys.stderr.write("ntpviz: WARNING: plot returned %s\n" % rcode)
sys.stderr.write("ntpviz: WARNING: plot file %s\n" % tmp_filename)
sys.stderr.write("ntpviz: WARNING: plot file %s\n" % tmp_file.name)
elif 2 <= args.debug_level:
sys.stderr.write("ntpviz: INFO: plot file %s\n" % tmp_filename)
sys.stderr.write("ntpviz: INFO: plot file %s\n" % tmp_file.name)
else:
# remove tmp file
os.remove(tmp_filename)
os.remove(tmp_file.name)
return rcode
......@@ -444,7 +444,7 @@ file.</p>
return ''
tempsmap = self.tempssplit()
tempslist = tempsmap.keys()
tempslist = list(tempsmap.keys())
tempslist.sort()
if not len( tempsmap) or not len( tempslist):
sys.stderr.write("ntpviz: WARNING: no temps to graph\n")
......@@ -525,7 +525,7 @@ file, and field 3 from the temp log .</p>
"Generate gnuplot code graphing local temperature statistics"
sitename = self.sitename
tempsmap = self.tempssplit()
tempslist = tempsmap.keys()
tempslist = list(tempsmap.keys())
tempslist.sort()
if not len( tempsmap) or not len( tempslist):
......@@ -576,7 +576,7 @@ component of frequency drift.</p>
"Generate gnuplot code graphing local GPS statistics"
sitename = self.sitename
gpsmap = self.gpssplit()
gpslist = gpsmap.keys()
gpslist = list(gpsmap.keys())
gpslist.sort()
if not len( gpsmap) or not len( gpslist):
......@@ -758,7 +758,7 @@ plot \
peerdict = self.peersplit()
if not peerlist:
peerlist = peerdict.keys()
peerlist = list(peerdict.keys())
if not len( peerlist):
sys.stderr.write("ntpviz: WARNING: no peer data to graph\n")
return ''
......@@ -1461,13 +1461,13 @@ Python by ESR, concept and gnuplot code by Dan Drown.
# if no ntpsec favicon.ico, write one.
ico_filename = os.path.join(args.outdir, "favicon.ico")
if not os.path.lexists( ico_filename ):
with open( ico_filename, "w" ) as wp:
with open( ico_filename, "wb" ) as wp:
wp.write(binascii.a2b_base64(ntpsec_ico))
# if no ntpsec logo, write one.
logo_filename = os.path.join(args.outdir, "ntpsec-logo.png")
if not os.path.lexists( logo_filename ):
with open( logo_filename, "w" ) as wp:
with open( logo_filename, "wb" ) as wp:
wp.write(binascii.a2b_base64(ntpsec_logo))
report_time = datetime.datetime.utcnow() # the time now is...
......@@ -1645,7 +1645,7 @@ ntpviz</a>, part of the <a href="https://www.ntpsec.org/">NTPsec project</a>
("peer-offsets", stats.peer_offsets_gnuplot()),
]
peerlist = stats.peersplit().keys()
peerlist = list(stats.peersplit().keys())
# sort for output order stability
peerlist.sort()
for key in peerlist:
......@@ -1714,12 +1714,12 @@ ntpviz</a>, part of the <a href="https://www.ntpsec.org/">NTPsec project</a>
# and send the file buffer
index_filename = os.path.join(args.outdir, "index.html")
with open(index_filename + ".tmp", "wb") as ifile:
with open(index_filename + ".tmp", "w") as ifile:
ifile.write(index_buffer)
# create csv file, as a tmp file
csv_filename = os.path.join(args.outdir, "summary.csv")
with open( csv_filename + ".tmp", "wb" ) as csv_file:
with open( csv_filename + ".tmp", "w" ) as csv_file:
csv_ob = csv.writer(csv_file)
csv_ob.writerow(VizStats.csv_head)
for row in csvs:
......
......@@ -88,9 +88,9 @@ class NTPStats:
if starttime > os.path.getmtime(logpart):
continue
if logpart.endswith("gz"):
lines += gzip.open(logpart, 'rb').readlines()
lines += gzip.open(logpart, 'rt').readlines()
else:
lines += open(logpart, 'rb').readlines()
lines += open(logpart, 'r').readlines()
except IOError:
sys.stderr.write("ntpviz: WARNING: could not read %s\n" \
% logpart)
......