Commit 0e6be66a authored by Dimitris Lampridis's avatar Dimitris Lampridis

write file name as first line in log files

parent 6b780e1a
......@@ -152,13 +152,13 @@ if __name__ == '__main__':
now = now.replace(" ","-")
now = now.replace(":","-")
lgf = "%s/log/%s-%s-%s-%s-%1d.log" % (dir,bnm,sno,xno,now,lun)
inf = "%s/log/%s-%s-%s-%s-%1d.inf" % (dir,bnm,sno,xno,now,lun)
log_file = "%s/log/%s-%s-%s-%s-%1d.log" % (dir,bnm,sno,xno,now,lun)
inf_file = "%s/log/%s-%s-%s-%s-%1d.inf" % (dir,bnm,sno,xno,now,lun)
# Open the log and info files
try:
log = open(lgf, "w")
inf = open(inf, "w")
log = open(log_file, "w")
inf = open(inf_file, "w")
except Exception, e:
msg = "Exception: %s" % (e)
......@@ -168,11 +168,15 @@ if __name__ == '__main__':
# and print them to console if in debug mode
if options.debug:
print "\n"
print "Log file is: %s" % lgf
print "Inf file is: %s" % inf
print "Log file is: %s" % log_file
print "Inf file is: %s" % inf_file
print "\n"
# write file name as first line in file
inf.write(inf_file + '\n')
log.write(log_file + '\n')
# Open up a bus object, can be one of following (depending on tested device):
# * VME -- VME board (SVEC, etc.)
# * PCI -- PCI board (SPEC, etc.)
......@@ -294,8 +298,8 @@ if __name__ == '__main__':
# Print info file to console if in debug mode
if options.debug:
print "Debug: printing:%s" % (inf)
inf = open(inf, "r")
print "Debug: printing:%s" % (inf_file)
inf = open(inf_file, "r")
try:
for line in inf:
l = line.split("\n")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment