diff --git a/tren.py b/tren.py index 504150b..2bdd86c 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.199 2010/03/18 16:09:06 tundra Exp $" +RCSID = "$Id: tren.py,v 1.200 2010/03/18 17:40:31 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -166,6 +166,7 @@ TOKAMON = "AMON" # MM replacement token TOKAMONTH = "AMONTH" # Mmm replacement token TOKASEC = "ASEC" # ss replacement token +TOKAWDAY = "AWDAY" # Ddd replacement token TOKAYEAR = "AYEAR" # yyyy replacement token TOKCDAY = "CDAY" # mm replacement token @@ -174,6 +175,7 @@ TOKCMON = "CMON" # MM replacement token TOKCMONTH = "CMONTH" # Mmm replacement token TOKCSEC = "CSEC" # ss replacement token +TOKCWDAY = "CWDAY" # Ddd replacement token TOKCYEAR = "CYEAR" # yyyy replacement token TOKMDAY = "MDAY" # mm replacement token @@ -182,6 +184,7 @@ TOKMMON = "MMON" # MM replacement token TOKMMONTH = "MMONTH" # Mmm replacement token TOKMSEC = "MSEC" # ss replacement token +TOKMWDAY = "MWDAY" # Ddd replacement token TOKMYEAR = "MYEAR" # yyyy replacement token # System Renaming Tokens @@ -354,8 +357,11 @@ # Lookup Tables # #----------------------------------------------------------# -# Month Conversion Table +# Day And Month Conversion Tables + +DAYS = {0:"Mon", 1:"Tue", 2:"Wed", 3:"Thu", 4:"Fri", 5:"Sat", 6:"Sun"} + MONTHS = {1:"Jan", 2:"Feb", 3:"Mar", 4:"Apr", 5:"May", 6:"Jun", 7:"Jul", 8:"Aug", 9:"Sep", 10:"Oct", 11:"Nov", 12:"Dec"} @@ -367,6 +373,7 @@ TOKAMON : ("%02d", "ST_ATIME", "tm_mon"), TOKAMONTH : ("", "ST_ATIME", "tm_mon"), TOKASEC : ("%02d", "ST_ATIME", "tm_sec"), + TOKAWDAY : ("", "ST_ATIME", "tm_wday"), TOKAYEAR : ("%04d", "ST_ATIME", "tm_year"), TOKCDAY : ("%02d", "ST_CTIME", "tm_mday"), TOKCHOUR : ("%02d", "ST_CTIME", "tm_hour"), @@ -374,6 +381,7 @@ TOKCMON : ("%02d", "ST_CTIME", "tm_mon"), TOKCMONTH : ("", "ST_CTIME", "tm_mon"), TOKCSEC : ("%02d", "ST_CTIME", "tm_sec"), + TOKCWDAY : ("", "ST_CTIME", "tm_wday"), TOKCYEAR : ("%04d", "ST_CTIME", "tm_year"), TOKMDAY : ("%02d", "ST_MTIME", "tm_mday"), TOKMHOUR : ("%02d", "ST_MTIME", "tm_hour"), @@ -381,6 +389,7 @@ TOKMMON : ("%02d", "ST_MTIME", "tm_mon"), TOKMMONTH : ("", "ST_MTIME", "tm_mon"), TOKMSEC : ("%02d", "ST_MTIME", "tm_sec"), + TOKMWDAY : ("", "ST_MTIME", "tm_wday"), TOKMYEAR : ("%04d", "ST_MTIME", "tm_year") } @@ -1087,8 +1096,11 @@ if parms[0]: r[2] = parms[0] % val - else: + elif parms[2] == "tm_mon": r[2] = MONTHS[val] + + elif parms[2] == "tm_wday": + r[2] = DAYS[val] ### # System Renaming Tokens