| |
---|
| | PROGNAME = "tren.py" |
---|
| | BASENAME = PROGNAME.split(".py")[0] |
---|
| | PROGENV = BASENAME.upper() |
---|
| | INCLENV = PROGENV + "INCL" |
---|
| | RCSID = "$Id: tren.py,v 1.225 2010/08/25 18:08:41 tundra Exp $" |
---|
| | RCSID = "$Id: tren.py,v 1.226 2010/08/25 18:54:38 tundra Exp $" |
---|
| | VERSION = RCSID.split()[2] |
---|
| | |
---|
| | # Copyright Information |
---|
| | |
---|
| |
---|
| | dDUMPOBJ = "Dumping Object %s" |
---|
| | dINCLFILES = "Included Files:" |
---|
| | dPROGENV = "$" + PROGENV |
---|
| | dRENREQ = "Renaming Request:" |
---|
| | dRENSEQ = "Renaming Sequence: %s" |
---|
| | dRENTARGET = "Rename Target:" |
---|
| | dRESOLVEDOPTS = "Resolved Command Line" |
---|
| | dSEPCHAR = "-" # Used for debug separator lines |
---|
| | dSORTVIEW = "Sort View:" |
---|
| |
---|
| | # This includes the renaming of any existing targets. |
---|
| | |
---|
| | for target in self.SortViews[ORDERBYCMDLINE]: |
---|
| | |
---|
| | rensequence = [] |
---|
| | oldname, pathname = self.RenNames[target][BASE], self.RenNames[target][PATHNAME] |
---|
| | newname = oldname |
---|
| | name = oldname |
---|
| | |
---|
| | # Keep track of incremental renaming for use by debug |
---|
| | rensequence.append(oldname) |
---|
| | |
---|
| | for renrequest in self.RenRequests: |
---|
| | |
---|
| | # Handle conventional string replacement renaming requests |
---|
| | |
---|
| |
---|
| | |
---|
| | # Any subsequent replacements operate on the modified name |
---|
| | name = newname |
---|
| | |
---|
| | # Keep track of incremental renaming for use by debug |
---|
| | rensequence.append(newname) |
---|
| | |
---|
| | # Show the incremental renaming steps if debug is on |
---|
| | |
---|
| | if ProgramOptions[DEBUG]: |
---|
| | DebugMsg(dRENSEQ % ARROW.join(rensequence)) |
---|
| | |
---|
| | # Nothing to do, if old- and new names are the same |
---|
| | |
---|
| | if newname != oldname: |
---|
| | self.__RenameIt(pathname, oldname, newname) |
---|
| |
---|
| | |