diff --git a/tren.py b/tren.py index 13bc53c..a218f2d 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.163 2010/02/26 20:11:29 tundra Exp $" +RCSID = "$Id: tren.py,v 1.164 2010/02/27 00:31:57 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -454,7 +454,12 @@ for renrequest in self.RenRequests: - old, new = self.ResolveRenameTokens(renrequest[OLD], renrequest[NEW]) + # Resolve any embedded renaming tokens + + old = self.__ResolveRenameTokens(target, renrequest[OLD]) + new = self.__ResolveRenameTokens(target, renrequest[NEW]) + + oldstrings = [] # Build a list of indexes to every occurence of the old string, @@ -500,7 +505,7 @@ # And save off the results for match in rematches: - oldstrings.append((match.start(), match.end())) + oldstrings.append(match.span()) except: ErrorMsg(eBADREGEX % old) @@ -650,12 +655,11 @@ then be applied to the rename. """ - def ResolveRenameTokens(self, old, new): + def __ResolveRenameTokens(self, target, renstring): + return renstring - return [old, new] - - # End of 'ResolveRenameTokens()' + # End of '__ResolveRenameTokens()' # End of class 'RenameTargets'