コード例 #1
0
ファイル: AccEventGen.py プロジェクト: 70599/Waterfox
def main():
    from argparse import ArgumentParser
    o = ArgumentParser()
    o.add_argument('-I', action='append', dest='incdirs', default=['.'],
                 help="Directory to search for imported files")
    o.add_argument('config',
                 help='Config file to load')
    o.add_argument('header_output', metavar='FILE',
                 help="Quick stub header output file")
    o.add_argument('stub_output', metavar='FILE',
                 help="C++ source output file")
    o.add_argument('makedepend_output', metavar='FILE',
                 help="gnumake dependencies output file")
    global options
    options = o.parse_args()

    # Instantiate the parser.
    global p
    p = xpidl.IDLParser()

    conf = readConfigFile(options.config)

    with FileAvoidWrite(options.header_output) as fh:
        idl_paths = print_header_file(fh, conf)
    with FileAvoidWrite(options.stub_output) as fh:
        idl_paths |= print_cpp_file(fh, conf)
    with FileAvoidWrite(options.makedepend_output) as fh:
        write_dep_makefile(fh, options.stub_output, idl_paths)
コード例 #2
0
def main():
    from argparse import ArgumentParser
    o = ArgumentParser()
    o.add_argument('-I', action='append', dest='incdirs', default=['.'],
                 help="Directory to search for imported files")
    o.add_argument('config',
                 help='Config file to load')
    o.add_argument('header_output', metavar='FILE',
                 help="Quick stub header output file")
    o.add_argument('stub_output', metavar='FILE',
                 help="C++ source output file")
    o.add_argument('makedepend_output', metavar='FILE',
                 help="gnumake dependencies output file")
    global options
    options = o.parse_args()

    # Instantiate the parser.
    global p
    p = xpidl.IDLParser()

    conf = readConfigFile(options.config)

    with FileAvoidWrite(options.header_output) as fh:
        idl_paths = print_header_file(fh, conf)
    with FileAvoidWrite(options.stub_output) as fh:
        idl_paths |= print_cpp_file(fh, conf)
    with FileAvoidWrite(options.makedepend_output) as fh:
        write_dep_makefile(fh, options.stub_output, idl_paths)
コード例 #3
0
ファイル: test_makeutil.py プロジェクト: Floflis/gecko-b2g
 def test_write_dep_makefile(self):
     out = StringIO()
     write_dep_makefile(out, "target", ["b", "c", "a"])
     self.assertEqual(out.getvalue(), "target: b c a\n" + "a b c:\n")
コード例 #4
0
ファイル: test_makeutil.py プロジェクト: Andrel322/gecko-dev
 def test_write_dep_makefile(self):
     out = StringIO()
     write_dep_makefile(out, 'target', ['b', 'c', 'a'])
     self.assertEqual(out.getvalue(),
                      'target: b c a\n' +
                      'a b c:\n')
コード例 #5
0
 def test_write_dep_makefile(self):
     out = StringIO()
     write_dep_makefile(out, 'target', ['b', 'c', 'a'])
     self.assertEqual(out.getvalue(), 'target: b c a\n' + 'a b c:\n')