eric6/eric6_api.py

changeset 7836
2f0d208b8137
parent 7785
9978016560ec
child 7923
91e843545d9a
equal deleted inserted replaced
7835:0835ed67714b 7836:2f0d208b8137
274 ignoreBuiltinModules=ignoreBuiltinModules) 274 ignoreBuiltinModules=ignoreBuiltinModules)
275 apiGenerator = APIGenerator(module) 275 apiGenerator = APIGenerator(module)
276 api = apiGenerator.genAPI(True, basePackage, 276 api = apiGenerator.genAPI(True, basePackage,
277 includePrivate) 277 includePrivate)
278 bases = apiGenerator.genBases(includePrivate) 278 bases = apiGenerator.genBases(includePrivate)
279 except IOError as v: 279 except OSError as v:
280 sys.stderr.write("{0} error: {1}\n".format(file, v[1])) 280 sys.stderr.write("{0} error: {1}\n".format(file, v[1]))
281 continue 281 continue
282 except ImportError as v: 282 except ImportError as v:
283 sys.stderr.write("{0} error: {1}\n".format(file, v)) 283 sys.stderr.write("{0} error: {1}\n".format(file, v))
284 continue 284 continue
297 os.makedirs(outdir) 297 os.makedirs(outdir)
298 try: 298 try:
299 with open(outputFile, "w", encoding="utf-8", 299 with open(outputFile, "w", encoding="utf-8",
300 newline=newline) as out: 300 newline=newline) as out:
301 out.write("\n".join(sorted(apis)) + "\n") 301 out.write("\n".join(sorted(apis)) + "\n")
302 except IOError as v: 302 except OSError as v:
303 sys.stderr.write("{0} error: {1}\n".format(outputFile, v[1])) 303 sys.stderr.write("{0} error: {1}\n".format(outputFile, v[1]))
304 sys.exit(3) 304 sys.exit(3)
305 try: 305 try:
306 with open(basesFile, "w", encoding="utf-8", 306 with open(basesFile, "w", encoding="utf-8",
307 newline=newline) as out: 307 newline=newline) as out:
308 for baseEntry in sorted(basesDict.keys()): 308 for baseEntry in sorted(basesDict.keys()):
309 out.write("{0} {1}\n".format( 309 out.write("{0} {1}\n".format(
310 baseEntry, " ".join(sorted(basesDict[baseEntry])))) 310 baseEntry, " ".join(sorted(basesDict[baseEntry]))))
311 except IOError as v: 311 except OSError as v:
312 sys.stderr.write("{0} error: {1}\n".format(basesFile, v[1])) 312 sys.stderr.write("{0} error: {1}\n".format(basesFile, v[1]))
313 sys.exit(3) 313 sys.exit(3)
314 314
315 sys.stdout.write('\nDone.\n') 315 sys.stdout.write('\nDone.\n')
316 sys.exit(0) 316 sys.exit(0)

eric ide

mercurial