diff --git a/tren.py b/tren.py index b9fb94b..4bbac02 100755 --- a/tren.py +++ b/tren.py @@ -9,7 +9,7 @@ BASENAME = PROGNAME.split(".py")[0] PROGENV = BASENAME.upper() INCLENV = PROGENV + "INCL" -RCSID = "$Id: tren.py,v 1.221 2010/08/12 02:58:08 tundra Exp $" +RCSID = "$Id: tren.py,v 1.222 2010/08/19 19:22:04 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -141,7 +141,7 @@ # List all legal command line options that will be processed by getopt() later. # We exclude -I here because it is parsed manually before the getopt() call. -OPTIONSLIST = "A:abCcdfhi:P:qR:r:S:tvw:Xx" # All legal command line options in getopt() format +OPTIONSLIST = "A:abCcde:fhi:P:qR:r:S:tvw:Xx" # All legal command line options in getopt() format ##### @@ -264,6 +264,7 @@ ASK = "ASK" BACKUPS = "BACKUPS" DEBUG = "DEBUG" +CASECONV = "CASECONV" CASESENSITIVE = "CASESENSITIVE" ESCAPE = "ESCAPE" EXISTSUFFIX = "EXISTSUFFIX" @@ -397,6 +398,7 @@ " -C Do case-sensitive renaming (Default)", " -c Collapse case when doing string substitution (Default: False)", " -d Dump debugging information (Default: False)", + " -e type Force case conversion (Default: None)", " -f Force renaming even if target file or directory name already exists (Default: False)", " -h Print help information (Default: False)", " -I file Include command line arguments from file", @@ -418,6 +420,7 @@ # Lookup Tables # #----------------------------------------------------------# + # Day And Month Conversion Tables @@ -500,6 +503,7 @@ ASK : False, # Interactively ask user before renaming each file BACKUPS : True, # Do backups during forced renaming DEBUG : False, # Debugging off + CASECONV : None, # Forced case conversions CASESENSITIVE : True, # Search is case-sensitive ESCAPE : DEFESC, # Escape string EXISTSUFFIX : DEFSUFFIX, # What to tack on when renaming existing targets @@ -568,6 +572,7 @@ OLD : old rename string, NEW : new rename string, DEBUG : debug flag, + CASECONV : type of case conversion, CASESENSITIVE : case sensitivity flag, FORCERENAME : force renaming flag, INSTANCESTART : DReplace first, leftmost instance by default @@ -2058,6 +2063,11 @@ ProgramOptions[DEBUG] = True DumpState() + # Force case conversion + + if opt == "-e": + pass # Stick validation and storage logic here + # Force renaming of existing targets if opt == "-f":