Fixed problem wherein nonexistent files or wildcards named as rename targets would be silently ignored.
1 parent 38cc7f6 commit d18281a8f7cd65960df9125835075179fe9acfe5
@tundra tundra authored on 25 Aug 2010
Showing 1 changed file
View
18
tren.py
PROGNAME = "tren.py"
BASENAME = PROGNAME.split(".py")[0]
PROGENV = BASENAME.upper()
INCLENV = PROGENV + "INCL"
RCSID = "$Id: tren.py,v 1.227 2010/08/25 19:26:25 tundra Exp $"
RCSID = "$Id: tren.py,v 1.228 2010/08/25 19:47:35 tundra Exp $"
VERSION = RCSID.split()[2]
 
# Copyright Information
 
# have come from an include file (where they are not expanded)
# or from a Windows shell that doesn't know how to handle globbing
# properly.
 
# If the glob expands to nothing, then supply the original string.
# That way an error will be thrown if either an explicitly named file
# does not exist, or if a wildcard expands to nothing.
 
expandedlist = []
for arg in args:
expandedlist += glob.glob(arg)
 
wc = glob.glob(arg)
if wc:
expandedlist += wc
else:
expandedlist.append(arg)
 
targs = RenameTargets(expandedlist)
 
# Now process the options