Exemple #1
0
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
Exemple #2
0
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()
Exemple #3
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
Exemple #4
0
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()
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