403Webshell
Server IP : 123.56.80.60  /  Your IP : 216.73.216.78
Web Server : Apache/2.4.54 (Win32) OpenSSL/1.1.1s PHP/7.4.33 mod_fcgid/2.3.10-dev
System : Windows NT iZhx3sob14hnz7Z 10.0 build 14393 (Windows Server 2016) i586
User : SYSTEM ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Program Files/python/Lib/site-packages/PyInstaller/lib/modulegraph/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Program Files/python/Lib/site-packages/PyInstaller/lib/modulegraph//__main__.py
from __future__ import print_function
import sys
import os
import argparse
from .modulegraph import ModuleGraph


def parse_arguments():
    parser = argparse.ArgumentParser(
        conflict_handler='resolve', prog='%s -mmodulegraph' % (
            os.path.basename(sys.executable)))
    parser.add_argument(
        '-d', action='count', dest='debug', default=1,
        help='Increase debug level')
    parser.add_argument(
        '-q', action='store_const', dest='debug', const=0,
        help='Clear debug level')
    parser.add_argument(
        '-m', '--modules', action='store_true',
        dest='domods', default=False,
        help='arguments are module names, not script files')
    parser.add_argument(
        '-x', metavar='NAME', action='append', dest='excludes',
        default=[], help='Add NAME to the excludes list')
    parser.add_argument(
        '-p', action='append', metavar='PATH', dest='addpath', default=[],
        help='Add PATH to the module search path')
    parser.add_argument(
        '-g', '--dot', action='store_const', dest='output', const='dot',
        help='Output a .dot graph')
    parser.add_argument(
        '-h', '--html', action='store_const',
        dest='output', const='html', help='Output a HTML file')
    parser.add_argument(
        'scripts', metavar='SCRIPT', nargs='+', help='scripts to analyse')

    opts = parser.parse_args()
    return opts


def create_graph(scripts, domods, debuglevel, excludes, path_extras):
    # Set the path based on sys.path and the script directory
    path = sys.path[:]

    if domods:
        del path[0]
    else:
        path[0] = os.path.dirname(scripts[0])

    path = path_extras + path
    if debuglevel > 1:
        print("path:", file=sys.stderr)
        for item in path:
            print("   ", repr(item), file=sys.stderr)

    # Create the module finder and turn its crank
    mf = ModuleGraph(path, excludes=excludes, debug=debuglevel)
    for arg in scripts:
        if domods:
            if arg[-2:] == '.*':
                mf.import_hook(arg[:-2], None, ["*"])
            else:
                mf.import_hook(arg)
        else:
            mf.run_script(arg)
    return mf


def output_graph(output_format, mf):
    if output_format == 'dot':
        mf.graphreport()
    elif output_format == 'html':
        mf.create_xref()
    else:
        mf.report()


def main():
    opts = parse_arguments()
    mf = create_graph(
        opts.scripts, opts.domods, opts.debug,
        opts.excludes, opts.addpath)
    output_graph(opts.output, mf)


if __name__ == '__main__':  # pragma: no cover
    try:
        main()
    except KeyboardInterrupt:
        print("\n[interrupt]")

Youez - 2016 - github.com/yon3zu
LinuXploit