diff --git a/tren.py b/tren.py index 9389004..c0f7553 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.168 2010/03/06 01:25:46 tundra Exp $" +RCSID = "$Id: tren.py,v 1.169 2010/03/06 01:31:07 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -104,9 +104,9 @@ # Replacement Token Literals ##### -TOKENCMDEXEC = "`" # Delimiter for command execution renaming tokens -TOKENDELIM = "/" # Delimiter for all renaming tokens -TOKENENV = "$" # Introducer for environment variable replacement tokens +TOKCMDEXEC = "`" # Delimiter for command execution renaming tokens +TOKDELIM = "/" # Delimiter for all renaming tokens +TOKENV = "$" # Introducer for environment variable replacement tokens # Internal program state literals @@ -676,7 +676,7 @@ # Find all token delimiters rentokens = [] - td = re.finditer(TOKENDELIM, renstring) + td = re.finditer(TOKDELIM, renstring) # Build list of begin/end delimiter pairs @@ -715,12 +715,12 @@ # Environment Variable replacement token - if r[2].startswith(TOKENENV): + if r[2].startswith(TOKENV): r[2] = os.getenv(r[2][1:]) # Command Run replacement token - elif r[2].startswith(TOKENCMDEXEC) and r[2].endswith(TOKENCMDEXEC): + elif r[2].startswith(TOKCMDEXEC) and r[2].endswith(TOKCMDEXEC): command = r[2][1:-1] @@ -753,7 +753,7 @@ # Unrecognized renaming token else: - ErrorMsg(eTOKUNKNOWN % r[2]) + ErrorMsg(eTOKUNKNOWN % (TOKDELIM + r[2] + TOKDELIM)) # Do the actual replacement