Exemple #1
0
def main():
    input_file = None

    if len(sys.argv) == 5:
        input_file = sys.argv[1]
        gen_headerfile_name = sys.argv[2]
        gen_sourcefile_name = sys.argv[3]
        gen_pythonfile_name = sys.argv[4]
    else:
        print("usage: %s winerrorfile headerfile sourcefile pythonfile" %
              (sys.argv[0]))
        sys.exit()

    # read in the data
    file_contents = io.open(input_file, "rt", encoding='utf8')

    errors = parseErrorDescriptions(file_contents, False, transformErrorName)

    print("writing new header file: %s" % gen_headerfile_name)
    out_file = io.open(gen_headerfile_name, "wt", encoding='utf8')
    generateHeaderFile(out_file, errors)
    out_file.close()
    print("writing new source file: %s" % gen_sourcefile_name)
    out_file = io.open(gen_sourcefile_name, "wt", encoding='utf8')
    generateSourceFile(out_file, errors)
    out_file.close()
    print("writing new python file: %s" % gen_pythonfile_name)
    out_file = io.open(gen_pythonfile_name, "wt", encoding='utf8')
    generatePythonFile(out_file, errors)
    out_file.close()
Exemple #2
0
def main():
    if len(sys.argv) == 5:
        input_file_name = sys.argv[1]
        gen_headerfile_name = sys.argv[2]
        gen_sourcefile_name = sys.argv[3]
        gen_pythonfile_name = sys.argv[4]
    else:
        print "usage: %s winerrorfile headerfile sourcefile pythonfile" % sys.argv[0]
        sys.exit()

    input_file = open(input_file_name, "r")
    errors = parseErrorDescriptions(input_file, True, transformErrorName)
    input_file.close()

    print "writing new header file: %s" % gen_headerfile_name
    out_file = open(gen_headerfile_name, "w")
    generateHeaderFile(out_file, errors)
    out_file.close()
    print "writing new source file: %s" % gen_sourcefile_name
    out_file = open(gen_sourcefile_name, "w")
    generateSourceFile(out_file, errors)
    out_file.close()
    print "writing new python file: %s" % gen_pythonfile_name
    out_file = open(gen_pythonfile_name, "w")
    generatePythonFile(out_file, errors)
    out_file.close()
Exemple #3
0
def main():
    if len(sys.argv) == 5:
        input_file_name = sys.argv[1]
        gen_headerfile_name = sys.argv[2]
        gen_sourcefile_name = sys.argv[3]
        gen_pythonfile_name = sys.argv[4]
    else:
        print "usage: %s winerrorfile headerfile sourcefile pythonfile" % sys.argv[
            0]
        sys.exit()

    input_file = open(input_file_name, "r")
    errors = parseErrorDescriptions(input_file, True, transformErrorName)
    input_file.close()

    print "writing new header file: %s" % gen_headerfile_name
    out_file = open(gen_headerfile_name, "w")
    generateHeaderFile(out_file, errors)
    out_file.close()
    print "writing new source file: %s" % gen_sourcefile_name
    out_file = open(gen_sourcefile_name, "w")
    generateSourceFile(out_file, errors)
    out_file.close()
    print "writing new python file: %s" % gen_pythonfile_name
    out_file = open(gen_pythonfile_name, "w")
    generatePythonFile(out_file, errors)
    out_file.close()
Exemple #4
0
def main ():
    input_file = None;

    if len(sys.argv) == 5:
        input_file =  sys.argv[1]
        gen_headerfile_name = sys.argv[2]
        gen_sourcefile_name = sys.argv[3]
        gen_pythonfile_name = sys.argv[4]
    else:
        print("usage: %s winerrorfile headerfile sourcefile pythonfile" % (sys.argv[0]))
        sys.exit()

    # read in the data
    file_contents = open(input_file, "r")

    errors = parseErrorDescriptions(file_contents, False, transformErrorName)

    print("writing new header file: %s" % gen_headerfile_name)
    out_file = open(gen_headerfile_name, "w")
    generateHeaderFile(out_file, errors)
    out_file.close()
    print("writing new source file: %s" % gen_sourcefile_name)
    out_file = open(gen_sourcefile_name, "w")
    generateSourceFile(out_file, errors)
    out_file.close()
    print("writing new python file: %s" % gen_pythonfile_name)
    out_file = open(gen_pythonfile_name, "w")
    generatePythonFile(out_file, errors)
    out_file.close()