force use of python 2.x interpreter, update copyright and version
1 parent 9718d8b commit c066ff61f29c4232f5d11c332a04841e2ea38ff9
@tundra tundra authored on 7 Nov 2020
Showing 2 changed files
View
28
tren.py
#!/usr/bin/env python
#!/usr/bin/env python2
# tren.py
# Copyright (c) 2010-2020 TundraWare Inc.
# For Updates See: http://www.tundraware.com/Software/tren
 
PROGNAME = "tren.py"
BASENAME = PROGNAME.split(".py")[0]
PROGENV = BASENAME.upper()
INCLENV = PROGENV + "INCL"
RCSID = "$Id: tren.py,v 1.242 2011/08/01 18:07:17 tundra Exp $"
RCSID = "$Id: tren.py,v 1.243 2020/11/07 18:07:17 tundra Exp $"
VERSION = RCSID.split()[2]
 
# Copyright Information
 
't' : str.title,
'u' : str.upper
}
 
CASEOPS = list(CASETBL.keys())
CASEOPS = CASETBL.keys()
CASEOPS.sort()
 
 
# Day And Month Conversion Tables
 
try:
pathname, basename = os.path.split(fullname)
stats = os.stat(fullname)
except (IOError, OSError) as xxx_todo_changeme2:
(errno, errstr) = xxx_todo_changeme2.args
except (IOError, OSError), (errno, errstr):
ErrorMsg(eFILEOPEN % (fullname, errstr))
 
# Some operating systems (Windows) terminate the path with
# a separator, some (Posix) do not.
for seqtype in SeqTypes:
 
statflag, storage, order = seqtype
 
vieworder = list(storage.keys())
vieworder = storage.keys()
vieworder.sort()
 
# Sort alphabetically when multiple filenames
# map to the same key, creating overall
if not ProgramOptions[TESTMODE]:
 
try:
os.rename(fullold, fullnew)
except OSError as xxx_todo_changeme:
(errno, errstr) = xxx_todo_changeme.args
except OSError, (errno, errstr):
ErrorMsg(eRENAMEFAIL % (fullold, fullnew, errstr))
 
self.indentlevel -= 1
 
 
token = r[2][1:]
 
found = False
for seqtoken in list(self.SortViews.keys()) + [ORDERBYADATE, ORDERBYCDATE, ORDERBYMDATE]:
for seqtoken in self.SortViews.keys() + [ORDERBYADATE, ORDERBYCDATE, ORDERBYMDATE]:
 
if token.split(ALPHADELIM)[0] == (seqtoken):
 
token, field = token[:len(seqtoken)], token[len(seqtoken):]
DebugMsg(SEPARATOR)
DebugMsg(dCURSTATE)
DebugMsg(SEPARATOR)
 
opts = list(ProgramOptions.keys())
opts = ProgramOptions.keys()
opts.sort()
for o in opts:
DebugMsg(ColumnPad([o, ProgramOptions[o]]))
 
n = [lhs] + n
 
OPTIONS = OPTIONS[:i] + n + OPTIONS[i+1:]
 
except IOError as xxx_todo_changeme1:
(errno, errstr) = xxx_todo_changeme1.args
except IOError, (errno, errstr):
ErrorMsg(eFILEOPEN % (inclfile, errstr))
 
i += 1
 
# And parse the command line
 
try:
opts, args = getopt.getopt(OPTIONS, OPTIONSLIST)
except getopt.GetoptError as xxx_todo_changeme3:
(errmsg, badarg) = xxx_todo_changeme3.args
except getopt.GetoptError, (errmsg, badarg):
ErrorMsg(eBADARG % errmsg)
 
# Create and populate an object with rename targets. This must be
# done here because this object also stores the -r renaming requests
View
0
■■■■■
tren2.py 100755 → 0
Too large (Show diff)