| |
---|
| | PROGNAME = "tren.py" |
---|
| | BASENAME = PROGNAME.split(".py")[0] |
---|
| | PROGENV = BASENAME.upper() |
---|
| | INCLENV = PROGENV + "INCL" |
---|
| | RCSID = "$Id: tren.py,v 1.236 2010/08/30 01:52:23 tundra Exp $" |
---|
| | RCSID = "$Id: tren.py,v 1.237 2010/08/30 02:06:42 tundra Exp $" |
---|
| | VERSION = RCSID.split()[2] |
---|
| | |
---|
| | # Copyright Information |
---|
| | |
---|
| |
---|
| | # Handle literal string replacement |
---|
| | |
---|
| | else: |
---|
| | |
---|
| | searchtarget = newname |
---|
| | |
---|
| | # Collapse case if requested |
---|
| | |
---|
| | |
---|
| | if not renrequest[CASESENSITIVE]: |
---|
| | |
---|
| | newname = newname.lower() |
---|
| | searchtarget = searchtarget.lower() |
---|
| | old = old.lower() |
---|
| | |
---|
| | oldlen = len(old) |
---|
| | i = newname.find(old) |
---|
| | i = searchtarget.find(old) |
---|
| | while i >= 0: |
---|
| | |
---|
| | nextloc = i + oldlen |
---|
| | oldstrings.append((i, nextloc)) |
---|
| | i = newname.find(old, nextloc) |
---|
| | i = searchtarget.find(old, nextloc) |
---|
| | |
---|
| | # If we found any matching strings, replace them |
---|
| | |
---|
| | if oldstrings: |
---|
| |
---|
| | |