def update_constants(header, pygen): try: fd = open(header) for name, val in parsers.iter_header_constants(fd): pygen.dump_constant(name, str(val)) finally: fd.close()
def test_module(filename): import scintilla total = 0 missing = [] try: header = open(filename) for name, val in parsers.iter_header_constants(header): if not hasattr(scintilla, name): missing.append((name, val)) total += 1 finally: header.close() for name, val in missing: print "%s = %d" % (name, val) print "Compliance: %d/%d" % (total - len(missing), total)