diff --git a/tren.py b/tren.py index 9db8490..7c91d86 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.170 2010/03/06 01:38:28 tundra Exp $" +RCSID = "$Id: tren.py,v 1.171 2010/03/06 15:57:21 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -107,6 +107,7 @@ TOKCMDEXEC = "`" # Delimiter for command execution renaming tokens TOKDELIM = "/" # Delimiter for all renaming tokens TOKENV = "$" # Introducer for environment variable replacement tokens +TOKFILLEN = "L" # File Length replacement token TOKFILNAM = "F" # File Name replacement token @@ -276,7 +277,7 @@ directories we're renaming. After the class is constructed and the command line fully parsed, this will contain: - self.RenNames = { fullname : {BASE : basename, PATHNAME : pathtofile, STAT : stats} + self.RenNames = { fullname : {BASE : basename, PATHNAME : pathtofile, STATS : stats} ... (repeated for each rename target) } @@ -718,9 +719,13 @@ # File Attribute Renaming Tokens ### - if r[2] == TOKFILNAM: + if r[2] == TOKFILLEN: + r[2] = str(self.RenNames[target][STATS][ST_SIZE]) + + elif r[2] == TOKFILNAM: r[2] = os.path.basename(target) + ### # System Renaming Tokens ###