test whether final argument is a directory
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@221 4cde692c-a291-49d1-8350-778aa11640f8
This commit is contained in:
parent
ea9dfa9fb2
commit
bf3dc20b46
@ -68,12 +68,14 @@ if nargs == 1:
|
||||
elif nargs == 2:
|
||||
xmlPath = args[0]
|
||||
outPath = args[1]
|
||||
print "000", outPath
|
||||
if os.path.isdir(outPath):
|
||||
outPath = makeOutputFileName(xmlPath, outPath)
|
||||
files = [(xmlPath, outPath)]
|
||||
else:
|
||||
outputDir = args[-1]
|
||||
if not os.path.isdir(outputDir):
|
||||
print "last argument must be an existing directory"
|
||||
sys.exit(2)
|
||||
files = []
|
||||
for xmlPath in args[:-1]:
|
||||
files.append((xmlPath, makeOutputFileName(xmlPath, outputDir)))
|
||||
|
@ -102,6 +102,9 @@ elif nargs == 2:
|
||||
files = [(ttPath, outPath)]
|
||||
else:
|
||||
outputDir = args[-1]
|
||||
if not os.path.isdir(outputDir):
|
||||
print "last argument must be an existing directory"
|
||||
sys.exit(2)
|
||||
files = []
|
||||
for ttPath in args[:-1]:
|
||||
files.append((ttPath, makeOutputFileName(ttPath, outputDir)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user