diff --git a/tren.py b/tren.py index 31340b5..f51ebcb 100755 --- a/tren.py +++ b/tren.py @@ -8,7 +8,7 @@ PROGNAME = "tren.py" BASENAME = PROGNAME.split(".py")[0] PROGENV = BASENAME.upper() -RCSID = "$Id: tren.py,v 1.139 2010/02/03 23:43:20 tundra Exp $" +RCSID = "$Id: tren.py,v 1.140 2010/02/03 23:56:38 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -108,6 +108,7 @@ # Rename target keys BASE = "BASENAME" +PATHNAME = "PATHNAME" STATS = "STATS" ORDERBYCMDLINE = "ORDERBYCOMMANDLINE" ORDERBYALPHA = "ORDERBYALPHA" @@ -244,7 +245,7 @@ directories we're renaming. After the class is constructed and the command line fully parsed, this will contain: - self.RenNames = { fullname : {BASE : basename, STAT : stats} + self.RenNames = { fullname : {BASE : basename, PATHNAME : pathtofile, STAT : stats} ... (repeated for each rename target) } @@ -342,7 +343,7 @@ # Store fullname, basename, and stat info for this file - self.RenNames[fullname] = {BASE : basename, STATS : stats} + self.RenNames[fullname] = {BASE : basename, PATHNAME : fullname.split(basename)[0], STATS : stats} # Incrementally build lists of keys that will later be # used to create sequence renaming tokens @@ -440,7 +441,7 @@ for target in self.SortViews[ORDERBYCMDLINE]: - newname = target + newname, pathname = self.RenNames[target][BASE], self.RenNames[target][PATHNAME] for renrequest in self.RenRequests: old, new = self.ResolveRenameStrings(renrequest[OLD], renrequest[NEW]) @@ -455,7 +456,7 @@ if i >= 0: newname = newname[:i] + new + newname[i + len(old):] - print ColumnPad([target, newname], padwidth = 50) + print ColumnPad([target, pathname + newname], padwidth = 50) # End of 'Rename()'