Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
options.new = 1
elif arg in ["-xg", "-g"]:
if arg == "-xg":
options.excludeGlyphList = 1
i = i +1
glyphString = sys.argv[i]
if glyphString[0] == "-":
raise ACOptionParseError("Option Error: it looks like the first item in the glyph list following '-g' is another option.")
options.glyphList += parseGlyphListArg(glyphString)
elif arg in ["-xgf", "-gf"]:
if arg == "-xgf":
options.excludeGlyphList = 1
i = i +1
filePath = sys.argv[i]
if filePath[0] == "-":
raise ACOptionParseError("Option Error: it looks like the the glyph list file following '-gf' is another option.")
try:
with open(filePath, "r", encoding='utf-8') as gf:
glyphString = gf.read()
except (IOError,OSError):
raise ACOptionParseError("Option Error: could not open glyph list file <%s>." % filePath)
options.glyphList += parseGlyphListArg(glyphString)
elif arg[0] == "-":
raise ACOptionParseError("Option Error: Unknown option <%s>." % arg)
else:
arg = arg.rstrip(os.sep) # might be a UFO font. auto completion in some shells adds a dir separator, which then causes problems with os.path.dirname().
options.fileList += [arg]
i += 1
if not options.fileList:
raise ACOptionParseError("Option Error: You must provide at least one font file path.")
raise ACOptionParseError("Option Error: it looks like the the glyph list file following '-gf' is another option.")
try:
with open(filePath, "r", encoding='utf-8') as gf:
glyphString = gf.read()
except (IOError,OSError):
raise ACOptionParseError("Option Error: could not open glyph list file <%s>." % filePath)
options.glyphList += parseGlyphListArg(glyphString)
elif arg[0] == "-":
raise ACOptionParseError("Option Error: Unknown option <%s>." % arg)
else:
arg = arg.rstrip(os.sep) # might be a UFO font. auto completion in some shells adds a dir separator, which then causes problems with os.path.dirname().
options.fileList += [arg]
i += 1
if not options.fileList:
raise ACOptionParseError("Option Error: You must provide at least one font file path.")
return options
options.glyphList += parseGlyphListArg(glyphString)
elif arg in ["-xgf", "-gf"]:
if arg == "-xgf":
options.excludeGlyphList = 1
i = i +1
filePath = sys.argv[i]
if filePath[0] == "-":
raise ACOptionParseError("Option Error: it looks like the the glyph list file following '-gf' is another option.")
try:
with open(filePath, "r", encoding='utf-8') as gf:
glyphString = gf.read()
except (IOError,OSError):
raise ACOptionParseError("Option Error: could not open glyph list file <%s>." % filePath)
options.glyphList += parseGlyphListArg(glyphString)
elif arg[0] == "-":
raise ACOptionParseError("Option Error: Unknown option <%s>." % arg)
else:
arg = arg.rstrip(os.sep) # might be a UFO font. auto completion in some shells adds a dir separator, which then causes problems with os.path.dirname().
options.fileList += [arg]
i += 1
if not options.fileList:
raise ACOptionParseError("Option Error: You must provide at least one font file path.")
return options
elif arg == "-d":
options.debug = 1
elif arg == "-q":
options.verbose = 0
elif arg == "-o":
i = i +1
options.reportPath = sys.argv[i]
elif arg == "-new":
options.new = 1
elif arg in ["-xg", "-g"]:
if arg == "-xg":
options.excludeGlyphList = 1
i = i +1
glyphString = sys.argv[i]
if glyphString[0] == "-":
raise ACOptionParseError("Option Error: it looks like the first item in the glyph list following '-g' is another option.")
options.glyphList += parseGlyphListArg(glyphString)
elif arg in ["-xgf", "-gf"]:
if arg == "-xgf":
options.excludeGlyphList = 1
i = i +1
filePath = sys.argv[i]
if filePath[0] == "-":
raise ACOptionParseError("Option Error: it looks like the the glyph list file following '-gf' is another option.")
try:
with open(filePath, "r", encoding='utf-8') as gf:
glyphString = gf.read()
except (IOError,OSError):
raise ACOptionParseError("Option Error: could not open glyph list file <%s>." % filePath)
options.glyphList += parseGlyphListArg(glyphString)
elif arg[0] == "-":
raise ACOptionParseError("Option Error: Unknown option <%s>." % arg)