diff --git a/tren.py b/tren.py index cf6e691..42a20d6 100755 --- a/tren.py +++ b/tren.py @@ -7,7 +7,7 @@ PROGNAME = "tren.py" PROGENV = PROGNAME.split(".py")[0].upper() -RCSID = "$Id: tren.py,v 1.114 2010/01/27 18:04:55 tundra Exp $" +RCSID = "$Id: tren.py,v 1.115 2010/01/27 23:32:30 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -66,6 +66,7 @@ MAXLINELEN = 75 # Maximum length of printed line PADCHAR = " " # Padding character PADWIDTH = 30 # Column width +SEQPAD = 13 # Padding to use when dumping sequence tables WRAPINDENT = 8 # Extra indent on wrapped lines @@ -97,7 +98,6 @@ dCURSTATE = "Current State Of Program Options" dDEBUG = "DEBUG" dDUMPOBJ = "Dumping Object %s" -dELLIPSIS = "..." dINCLUDING = "Including file '%s'" dPAIR = "Option/Target Pair" dPROGENV = "$" + PROGENV @@ -209,8 +209,18 @@ self.RenNames[fullname] = [basename, stat] self.cmdorder.append(t) - self.ctimes[stat[ST_CTIME]] = fullname - self.sizes[stat[ST_SIZE]] = fullname + + time = stat[ST_CTIME] + if time in self.ctimes: + self.ctimes[time].append(fullname) + else: + self.ctimes[time] = [fullname] + + size = stat[ST_SIZE] + if size in self.sizes: + self.sizes[size].append(fullname) + else: + self.sizes[size] = [fullname] # Sort the relevant sequence renaming token lists @@ -242,7 +252,7 @@ l = str(l) retval += l + ((padwidth - len(l)) * padchar) - return retval.strip() + return retval # End of 'ColumnPad()' @@ -300,25 +310,27 @@ for name in obj.RenNames: DebugMsg(name) for item in obj.RenNames[name]: - DebugMsg(ColumnPad([dELLIPSIS, item])) + DebugMsg(ColumnPad([" ", item])) # Dump command line sequence - DebugMsg(dSEQCMD) - for item in obj.cmdorder: - DebugMsg(ColumnPad([dELLIPSIS, item])) + DebugMsg(dSEQCMD) + for item in obj.cmdorder: + DebugMsg(ColumnPad([" ", item])) # Dump creation date sequence - DebugMsg(dSEQCTIME) - for item in obj.ByCtime: - DebugMsg(ColumnPad([dELLIPSIS, " %s %s %s" % (item, ARROW, obj.ctimes[item])])) + DebugMsg(dSEQCTIME) + for item in obj.ByCtime: + itemarrow = ColumnPad([item, ARROW], padwidth=SEQPAD) + DebugMsg(ColumnPad([" ", " %s %s" % (itemarrow, obj.ctimes[item])])) # Dump size sequence - DebugMsg(dSEQSIZE) - for item in obj.BySize: - DebugMsg(ColumnPad([dELLIPSIS, " %s %s %s" % (item, ARROW, obj.sizes[item])])) + DebugMsg(dSEQSIZE) + for item in obj.BySize: + itemarrow = ColumnPad([item, ARROW], padwidth=SEQPAD) + DebugMsg(ColumnPad([" ", " %s %s" % (itemarrow, obj.sizes[item])])) DebugMsg(SEPARATOR + "\n\n") @@ -582,7 +594,9 @@ # We have to do this here so that subsequent # renaming tokens references can be resolved. - targs = RenameTargets(args) + targs = None + if args: + targs = RenameTargets(args) # Now process the options @@ -629,5 +643,6 @@ REGEX = True - # Release the target container - del targs + # Release the target container if we created one + if targs: + del targs