コード例 #1
0
ファイル: build.py プロジェクト: nihilus/hexrays-python
def gen_docs(z=False):
    print "Generating documentation....."
    old_dir = os.getcwd()
    try:
        curdir = os.getcwd() + os.sep
        docdir = "hexrays-python-reference-%d.%d.%d" % (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
        sys.path.append(curdir + "python")
        # ~ sys.path.append(curdir + 'tools')
        # ~ sys.path.append(curdir + 'docs')
        import epydoc.cli
        import swigdocs

        os.chdir("docs")
        PYWRAPS_FN = "pywraps"
        swigdocs.gen_docs(outfn=PYWRAPS_FN + ".py")
        epydoc.cli.optparse.sys.argv = [
            "epydoc",
            "--no-sourcecode",
            "-u",
            "http://github.com/EiNSTeiN-/hexrays_python/",
            "--navlink",
            '<a href="http://www.hex-rays.com/idapro/idapython_docs/">IDAPython Reference</a>',
            "--no-private",
            "--simple-term",
            "-o",
            docdir,
            "--html",
            "idc",
            "idautils",
            PYWRAPS_FN,
            "idaapi",
        ]
        # Generate the documentation
        epydoc.cli.cli()

        print "Documentation generated!"

        # Clean temp files
        for f in [PYWRAPS_FN + ".py", PYWRAPS_FN + ".pyc"]:
            if os.path.exists(f):
                os.unlink(f)

        if z:
            z = docdir + "-doc.zip"
            zip = zipfile.ZipFile(z, "w", zipfile.ZIP_DEFLATED)
            for fn in glob.glob(docdir + os.sep + "*"):
                zip.write(fn)
            zip.close()
            print "Documentation compressed to", z
    except Exception, e:
        print "Failed to generate documentation:", e
コード例 #2
0
ファイル: hrdoc.py プロジェクト: z6s469s1/idapython-src
def gen_docs():
    import swigdocs

    define_idaapi_resolver()

    swigdocs.gen_docs(outfn='pywraps.py')
    # append obj/x86_win_vc_32/idaapi.py to it
    #    os.system(r'copy /b idaapi.py+..\obj\x86_win_vc_32\idaapi.py idaapi.py')

    # delete all output files
    for fn in glob('hr-html/*'):
        os.unlink(fn)

    epydoc.cli.optparse.sys.argv = [
        'epydoc', '--config', '../tools/docs/hrdoc.cfg', '--simple-term'
    ]

    # Generate the documentation
    epydoc.cli.cli()
コード例 #3
0
ファイル: build.py プロジェクト: loveezu/src
def gen_docs(z = False):
        print "Generating documentation....."
        old_dir = os.getcwd()
        try:
            curdir = os.getcwd() + os.sep
            docdir = 'idapython-reference-%d.%d.%d' % (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
            sys.path.append(curdir + 'python')
            sys.path.append(curdir + 'tools')
            sys.path.append(curdir + 'docs')
            import epydoc.cli
            import swigdocs
            os.chdir('docs')
            PYWRAPS_FN = 'pywraps'
            swigdocs.gen_docs(outfn = PYWRAPS_FN + '.py')
            epydoc.cli.optparse.sys.argv = [ 'epydoc',
                                             '--no-sourcecode',
                                             '-u', 'http://code.google.com/p/idapython/',
                                             '--navlink', '<a href="http://www.hex-rays.com/idapro/idapython_docs/">IDAPython Reference</a>',
                                             '--no-private',
                                             '--simple-term',
                                             '-o', docdir,
                                             '--html',
                                             'idc', 'idautils', PYWRAPS_FN, 'idaapi']
            # Generate the documentation
            epydoc.cli.cli()

            print "Documentation generated!"

            # Clean temp files
            for f in [PYWRAPS_FN + '.py', PYWRAPS_FN + '.pyc']:
                if os.path.exists(f):
                  os.unlink(f)

            if z:
                z = docdir + '-doc.zip'
                zip = zipfile.ZipFile(z, "w", zipfile.ZIP_DEFLATED)
                for fn in glob.glob(docdir + os.sep + '*'):
                    zip.write(fn)
                zip.close()
                print "Documentation compressed to", z
        except Exception, e:
            print 'Failed to generate documentation:', e
コード例 #4
0
ファイル: hrdoc.py プロジェクト: AmesianX/src
def gen_docs():
    import swigdocs

    define_idaapi_resolver()

    swigdocs.gen_docs(outfn = 'pywraps.py')
    # append obj/x86_win_vc_32/idaapi.py to it
#    os.system(r'copy /b idaapi.py+..\obj\x86_win_vc_32\idaapi.py idaapi.py')

    # delete all output files
    for fn in glob('hr-html/*'):
      os.unlink(fn)

    epydoc.cli.optparse.sys.argv = [ 'epydoc',
                                     '--config', '../tools/docs/hrdoc.cfg',
                                     '--simple-term'
                                   ]

    # Generate the documentation
    epydoc.cli.cli()
コード例 #5
0
def gen_docs(z=False):
    print "Generating documentation....."
    old_dir = os.getcwd()
    try:
        curdir = os.getcwd() + os.sep
        docdir = 'idapython-reference-%d.%d.%d' % (
            VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
        sys.path.append(curdir + 'python')
        sys.path.append(curdir + 'tools')
        sys.path.append(curdir + 'docs')
        import epydoc.cli
        import swigdocs
        os.chdir('docs')
        PYWRAPS_FN = 'pywraps'
        swigdocs.gen_docs(outfn=PYWRAPS_FN + '.py')
        epydoc.cli.optparse.sys.argv = [
            'epydoc', '--no-sourcecode', '-u',
            'http://code.google.com/p/idapython/', '--navlink',
            '<a href="http://www.hex-rays.com/idapro/idapython_docs/">IDAPython Reference</a>',
            '--no-private', '--simple-term', '-o', docdir, '--html', 'idc',
            'idautils', PYWRAPS_FN, 'idaapi'
        ]
        # Generate the documentation
        epydoc.cli.cli()

        print "Documentation generated!"

        # Clean temp files
        for f in [PYWRAPS_FN + '.py', PYWRAPS_FN + '.pyc']:
            if os.path.exists(f):
                os.unlink(f)

        if z:
            z = docdir + '-doc.zip'
            zip = zipfile.ZipFile(z, "w", zipfile.ZIP_DEFLATED)
            for fn in glob.glob(docdir + os.sep + '*'):
                zip.write(fn)
            zip.close()
            print "Documentation compressed to", z
    except Exception, e:
        print 'Failed to generate documentation:', e