class mtail:
- subversion_id = "$Id: mtail.py 571 2007-06-22 21:38:07Z thierry $"
+ subversion_id = "$Id$"
default_time_format = "%H:%M:%S"
self.files[filename]['size']=size
elif size < offset:
self.show_file_when_size_decreased(filename,offset,size)
- del self.files[filename]['old-file']
+ try:
+ del self.files[filename]['old-file']
+ except:
+ pass
else:
# enter file with current size
# if we didn't set format yet, it's because we are initializing
print sys.argv[0],": WARNING : no file in scope"
self.format="%s"
else:
- self.margin=max(*[len(f) for f in filenames])
+ if len(filenames)==1:
+ self.margin=len(filenames[0])
+ else:
+ # this stupidly fails when there's only 1 file
+ self.margin=max(*[len(f) for f in filenames])
self.format="%%%ds"%self.margin
if self.options.verbose:
print 'Current set of files:',filenames