Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: tools/telemetry/third_party/modulegraph/modulegraph/__main__.py

Issue 1647513002: Delete tools/telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/third_party/modulegraph/modulegraph/__main__.py
diff --git a/tools/telemetry/third_party/modulegraph/modulegraph/__main__.py b/tools/telemetry/third_party/modulegraph/modulegraph/__main__.py
deleted file mode 100644
index 2a84cdadf69c5f2a0cdebaba1f84f8d1b37a35fe..0000000000000000000000000000000000000000
--- a/tools/telemetry/third_party/modulegraph/modulegraph/__main__.py
+++ /dev/null
@@ -1,76 +0,0 @@
-from __future__ import print_function
-import sys
-import os
-import optparse
-import textwrap
-from .modulegraph import ModuleGraph
-
-def main():
- # Parse command line
- usage = textwrap.dedent('''\
- Usage:
- modulegraph [options] scriptfile ...
-
- Valid options:
- * -d: Increase debug level
- * -q: Clear debug level
-
- * -m: arguments are module names, not script files
- * -x name: Add 'name' to the excludes list
- * -p name: Add 'name' to the module search path
-
- * -g: Output a .dot graph
- * -h: Output a html file
- ''')
- parser = optparse.OptionParser(usage=usage, add_help_option=False)
- parser.add_option('-d', action='count', dest='debug', default=1)
- parser.add_option('-q', action='store_const', dest='debug', const=0)
-
- parser.add_option('-m', action='store_true', dest='domods', default=False)
- parser.add_option('-x', action='append', dest='excludes', default=[])
- parser.add_option('-p', action='append', dest='addpath', default=[])
-
- parser.add_option('-g', action='store_const', dest='output', const='dot')
- parser.add_option('-h', action='store_const', dest='output', const='html')
- opts, args = parser.parse_args()
-
- if not args:
- print("No script specified", file=sys.stderr)
- print(usage, file=sys.stderr)
- sys.exit(1)
-
- script = args[0]
-
- # Set the path based on sys.path and the script directory
- path = sys.path[:]
- path[0] = os.path.dirname(script)
- path = opts.addpath + path
- if opts.debug > 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=opts.excludes, debug=opts.debug)
- for arg in args:
- if opts.domods:
- if arg[-2:] == '.*':
- mf.import_hook(arg[:-2], None, ["*"])
- else:
- mf.import_hook(arg)
- else:
- mf.run_script(arg)
- if opts.output == 'dot':
- mf.graphreport()
- elif opts.output == 'html':
- mf.create_xref()
- else:
- mf.report()
- sys.exit(0)
-
-
-if __name__ == '__main__':
- try:
- main()
- except KeyboardInterrupt:
- print("\n[interrupt]")

Powered by Google App Engine
This is Rietveld 408576698