log_dir specifies the base data directory.
If it doesn't exist, log_dir is created.
- A subdir of log_dir is created (if neccessary) named YYYYMMDD,
+ A subdir of log_dir is created (if necessary) named YYYYMMDD,
where YYYYMMDD is the current day in localtime.
If noclobber_logsubdir == True, this dir must not exist yet.
log_name specifies the base name for the created log files (in the log subdir).
The created log filenames are prefixed with a YYYYMMDDHHMMSS timestamp.
If the target filename already exists, the filename is postfixed with
- '_N', where N is the lowest integer that doesn't clober an existing file.
+ '_N', where N is the lowest integer that doesn't clobber an existing file.
General data is saved to the log files with the write(obj) method.
By default, write() cPickles the object passed.
def get_filename(self, timestamp=None) :
"""
Get a filename (using localtime if timestamp==None),
- appending integers as neccessary to avoid clobbering.
+ appending integers as necessary to avoid clobbering.
For use in write() routines.
Returns (filepath, timestamp)
"""
raise error, "Saved %d uint16s, read %d" % (npts, len(data_in))
for i in range(npts) :
if data_in[i] != data[i] :
- print "Dissagreement in element %d" % i
+ print "Disagreement in element %d" % i
print "Saved %d, read back %d" % (data[i], data_in[i])
raise error, "Poorly saved"
os.remove(filepath)
data2_in = fromfile(filepath+"_data_2", dtype=uint16)
for i in range(npts) :
if data1_in[i] != data1[i] :
- print "Dissagreement in element %d of data1" % i
+ print "Disagreement in element %d of data1" % i
print "Saved %d, read back %d" % (data1[i], data1_in[i])
raise error, "Poorly saved"
if data2_in[i] != data2[i] :
- print "Dissagreement in element %d of data2" % i
+ print "Disagreement in element %d of data2" % i
print "Saved %d, read back %d" % (data2[i], data2_in[i])
raise error, "Poorly saved"
os.remove(filepath)