]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/hotshotmain.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Tools / scripts / hotshotmain.py
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/hotshotmain.py b/AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/hotshotmain.py
deleted file mode 100644 (file)
index d94a2f9..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env python\r
-# -*- coding: iso-8859-1 -*-\r
-\r
-"""\r
-Run a Python script under hotshot's control.\r
-\r
-Adapted from a posting on python-dev by Walter Dörwald\r
-\r
-usage %prog [ %prog args ] filename [ filename args ]\r
-\r
-Any arguments after the filename are used as sys.argv for the filename.\r
-"""\r
-\r
-import sys\r
-import optparse\r
-import os\r
-import hotshot\r
-import hotshot.stats\r
-\r
-PROFILE = "hotshot.prof"\r
-\r
-def run_hotshot(filename, profile, args):\r
-    prof = hotshot.Profile(profile)\r
-    sys.path.insert(0, os.path.dirname(filename))\r
-    sys.argv = [filename] + args\r
-    prof.run("execfile(%r)" % filename)\r
-    prof.close()\r
-    stats = hotshot.stats.load(profile)\r
-    stats.sort_stats("time", "calls")\r
-\r
-    # print_stats uses unadorned print statements, so the only way\r
-    # to force output to stderr is to reassign sys.stdout temporarily\r
-    save_stdout = sys.stdout\r
-    sys.stdout = sys.stderr\r
-    stats.print_stats()\r
-    sys.stdout = save_stdout\r
-\r
-    return 0\r
-\r
-def main(args):\r
-    parser = optparse.OptionParser(__doc__)\r
-    parser.disable_interspersed_args()\r
-    parser.add_option("-p", "--profile", action="store", default=PROFILE,\r
-                      dest="profile", help='Specify profile file to use')\r
-    (options, args) = parser.parse_args(args)\r
-\r
-    if len(args) == 0:\r
-        parser.print_help("missing script to execute")\r
-        return 1\r
-\r
-    filename = args[0]\r
-    return run_hotshot(filename, options.profile, args[1:])\r
-\r
-if __name__ == "__main__":\r
-    sys.exit(main(sys.argv[1:]))\r