diff --git a/tren.py b/tren.py index 77238f2..9389004 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.167 2010/03/06 01:18:02 tundra Exp $" +RCSID = "$Id: tren.py,v 1.168 2010/03/06 01:25:46 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -182,7 +182,6 @@ eBADINSTANCE = "%s is an invalid replacement instance! Must be integer values in the form: n, n:n, :n, n:, or :" eBADLEN = "Bad line length '%s'!" eBADNEWOLD = "Bad -r argument '%s'! Requires exactly one new, old string separator (Default: " + DEFSEP + ")" -eBADRENAMETOK = "Renaming token missing delimiter: %s" eBADREGEX = "Invalid Regular Expression: %s" eERROR = "ERROR" eEXECFAIL = "Command: '%s' Failed To Execute!" @@ -192,6 +191,8 @@ eNAMESHORT = "Renaming '%s' to new name '%s' too short! (Minimum length is %s.)" eNULLARG = "%s cannot be empty!" eRENAMEFAIL = "Attempt to rename '%s' to '%s' failed : %s!" +eTOKDELIM = "Renaming token '%s' missing delimiter!" +eTOKUNKNOWN = "Renaming Token '%s' is unknown type!" eTOOMANYINC = "Too many includes! (Max is %d) Possible circular reference?" % MAXINCLUDES @@ -694,7 +695,7 @@ # or the renaming token is malformed if rentokens and len(rentokens[-1]) != 2: - ErrorMsg(eBADRENAMETOK % renstring) + ErrorMsg(eTOKDELIM % renstring) # Now add the renaming token contents. This will be used to # figure out what the replacement text should be. @@ -748,6 +749,11 @@ else: r[2] = output.replace("\n", "") + + # Unrecognized renaming token + + else: + ErrorMsg(eTOKUNKNOWN % r[2]) # Do the actual replacement