MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / main

Function main

tools/python-3.11.9-amd64/Lib/compileall.py:308–458  ·  view source on GitHub ↗

Script main program.

()

Source from the content-addressed store, hash-verified

306
307
308def main():
309 """Script main program."""
310 import argparse
311
312 parser = argparse.ArgumentParser(
313 description='Utilities to support installing Python libraries.')
314 parser.add_argument('-l', action='store_const', const=0,
315 default=None, dest='maxlevels',
316 help="don't recurse into subdirectories")
317 parser.add_argument('-r', type=int, dest='recursion',
318 help=('control the maximum recursion level. '
319 'if `-l` and `-r` options are specified, '
320 'then `-r` takes precedence.'))
321 parser.add_argument('-f', action='store_true', dest='force',
322 help='force rebuild even if timestamps are up to date')
323 parser.add_argument('-q', action='count', dest='quiet', default=0,
324 help='output only error messages; -qq will suppress '
325 'the error messages as well.')
326 parser.add_argument('-b', action='store_true', dest='legacy',
327 help='use legacy (pre-PEP3147) compiled file locations')
328 parser.add_argument('-d', metavar='DESTDIR', dest='ddir', default=None,
329 help=('directory to prepend to file paths for use in '
330 'compile-time tracebacks and in runtime '
331 'tracebacks in cases where the source file is '
332 'unavailable'))
333 parser.add_argument('-s', metavar='STRIPDIR', dest='stripdir',
334 default=None,
335 help=('part of path to left-strip from path '
336 'to source file - for example buildroot. '
337 '`-d` and `-s` options cannot be '
338 'specified together.'))
339 parser.add_argument('-p', metavar='PREPENDDIR', dest='prependdir',
340 default=None,
341 help=('path to add as prefix to path '
342 'to source file - for example / to make '
343 'it absolute when some part is removed '
344 'by `-s` option. '
345 '`-d` and `-p` options cannot be '
346 'specified together.'))
347 parser.add_argument('-x', metavar='REGEXP', dest='rx', default=None,
348 help=('skip files matching the regular expression; '
349 'the regexp is searched for in the full path '
350 'of each file considered for compilation'))
351 parser.add_argument('-i', metavar='FILE', dest='flist',
352 help=('add all the files and directories listed in '
353 'FILE to the list considered for compilation; '
354 'if "-", names are read from stdin'))
355 parser.add_argument('compile_dest', metavar='FILE|DIR', nargs='*',
356 help=('zero or more file and directory names '
357 'to compile; if no arguments given, defaults '
358 'to the equivalent of -l sys.path'))
359 parser.add_argument('-j', '--workers', default=1,
360 type=int, help='Run compileall concurrently')
361 invalidation_modes = [mode.name.lower().replace('_', '-')
362 for mode in py_compile.PycInvalidationMode]
363 parser.add_argument('--invalidation-mode',
364 choices=sorted(invalidation_modes),
365 help=('set .pyc invalidation mode; defaults to '

Callers 1

compileall.pyFile · 0.70

Calls 15

parse_argsMethod · 0.95
errorMethod · 0.95
sortedFunction · 0.85
compile_fileFunction · 0.85
compile_dirFunction · 0.85
compile_pathFunction · 0.85
stripMethod · 0.80
upperMethod · 0.80
openFunction · 0.70
printFunction · 0.50
add_argumentMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected