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:
|
elif nargs == 2:
|
||||||
xmlPath = args[0]
|
xmlPath = args[0]
|
||||||
outPath = args[1]
|
outPath = args[1]
|
||||||
print "000", outPath
|
|
||||||
if os.path.isdir(outPath):
|
if os.path.isdir(outPath):
|
||||||
outPath = makeOutputFileName(xmlPath, outPath)
|
outPath = makeOutputFileName(xmlPath, outPath)
|
||||||
files = [(xmlPath, outPath)]
|
files = [(xmlPath, outPath)]
|
||||||
else:
|
else:
|
||||||
outputDir = args[-1]
|
outputDir = args[-1]
|
||||||
|
if not os.path.isdir(outputDir):
|
||||||
|
print "last argument must be an existing directory"
|
||||||
|
sys.exit(2)
|
||||||
files = []
|
files = []
|
||||||
for xmlPath in args[:-1]:
|
for xmlPath in args[:-1]:
|
||||||
files.append((xmlPath, makeOutputFileName(xmlPath, outputDir)))
|
files.append((xmlPath, makeOutputFileName(xmlPath, outputDir)))
|
||||||
|
@ -102,6 +102,9 @@ elif nargs == 2:
|
|||||||
files = [(ttPath, outPath)]
|
files = [(ttPath, outPath)]
|
||||||
else:
|
else:
|
||||||
outputDir = args[-1]
|
outputDir = args[-1]
|
||||||
|
if not os.path.isdir(outputDir):
|
||||||
|
print "last argument must be an existing directory"
|
||||||
|
sys.exit(2)
|
||||||
files = []
|
files = []
|
||||||
for ttPath in args[:-1]:
|
for ttPath in args[:-1]:
|
||||||
files.append((ttPath, makeOutputFileName(ttPath, outputDir)))
|
files.append((ttPath, makeOutputFileName(ttPath, outputDir)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user