Lines Matching +full:- +full:- +full:quiet
1 """Module/script to byte-compile all .py files to .pyc files.
4 given as arguments recursively; the -l option prevents it from
9 packages -- for now, you'll have to deal with packages separately.)
11 See module py_compile for details of the actual byte-compilation.
25 def _walk_dir(dir, maxlevels, quiet=0): argument
26 if quiet < 2 and isinstance(dir, os.PathLike):
28 if not quiet:
33 if quiet < 2:
45 yield from _walk_dir(fullname, maxlevels=maxlevels - 1,
46 quiet=quiet)
49 rx=None, quiet=0, legacy=False, optimize=-1, workers=1, argument
52 """Byte-compile all modules in the given directory tree.
56 dir: the directory to byte-compile
59 file as it is compiled into each byte-code file.
60 force: if True, force compilation, even if timestamps are up-to-date
61 quiet: full output with False or 0, errors only with 1,
64 optimize: int or list of optimization levels or -1 for level of
68 invalidation_mode: how the up-to-dateness of the pyc will be checked
69 stripdir: part of path to left-strip from source file path
97 files = _walk_dir(dir, quiet=quiet, maxlevels=maxlevels)
111 rx=rx, quiet=quiet,
124 if not compile_file(file, ddir, force, rx, quiet,
132 def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0, argument
133 legacy=False, optimize=-1,
136 """Byte-compile one file.
140 fullname: the file to byte-compile
142 byte-code file.
143 force: if True, force compilation, even if timestamps are up-to-date
144 quiet: full output with False or 0, errors only with 1,
147 optimize: int or list of optimization levels or -1 for level of
150 invalidation_mode: how the up-to-dateness of the pyc will be checked
151 stripdir: part of path to left-strip from source file path
178 if quiet < 2:
226 head, tail = name[:-3], name[-3:]
242 if not quiet:
251 previous_cfile = opt_cfiles[optimize[index - 1]]
257 if quiet >= 2:
259 elif quiet:
263 # escape non-printable characters in msg
269 if quiet >= 2:
271 elif quiet:
281 def compile_path(skip_curdir=1, maxlevels=0, force=False, quiet=0, argument
282 legacy=False, optimize=-1,
284 """Byte-compile all module on sys.path.
291 quiet: as for compile_dir() (default 0)
293 optimize: as for compile_dir() (default -1)
299 if quiet < 2:
307 quiet=quiet,
321 parser.add_argument('-l', action='store_const', const=0,
324 parser.add_argument('-r', type=int, dest='recursion',
326 'if `-l` and `-r` options are specified, '
327 'then `-r` takes precedence.'))
328 parser.add_argument('-f', action='store_true', dest='force',
330 parser.add_argument('-q', action='count', dest='quiet', default=0,
331 help='output only error messages; -qq will suppress '
333 parser.add_argument('-b', action='store_true', dest='legacy',
334 help='use legacy (pre-PEP3147) compiled file locations')
335 parser.add_argument('-d', metavar='DESTDIR', dest='ddir', default=None,
337 'compile-time tracebacks and in runtime '
340 parser.add_argument('-s', metavar='STRIPDIR', dest='stripdir',
342 help=('part of path to left-strip from path '
343 'to source file - for example buildroot. '
344 '`-d` and `-s` options cannot be '
346 parser.add_argument('-p', metavar='PREPENDDIR', dest='prependdir',
349 'to source file - for example / to make '
351 'by `-s` option. '
352 '`-d` and `-p` options cannot be '
354 parser.add_argument('-x', metavar='REGEXP', dest='rx', default=None,
358 parser.add_argument('-i', metavar='FILE', dest='flist',
361 'if "-", names are read from stdin'))
365 'to the equivalent of -l sys.path'))
366 parser.add_argument('-j', '--workers', default=1,
368 invalidation_modes = [mode.name.lower().replace('_', '-')
370 parser.add_argument('--invalidation-mode',
373 '"checked-hash" if the SOURCE_DATE_EPOCH '
376 parser.add_argument('-o', action='append', type=int, dest='opt_levels',
378 'Default is -1 which uses the optimization level '
379 'of the Python interpreter itself (see -O).'))
380 parser.add_argument('-e', metavar='DIR', dest='limit_sl_dest',
382 parser.add_argument('--hardlink-dupes', action='store_true',
402 args.opt_levels = [-1]
411 parser.error("-d cannot be used in combination with -s or -p")
416 with (sys.stdin if args.flist=='-' else
417 open(args.flist, encoding="utf-8")) as f:
421 if args.quiet < 2:
426 ivl_mode = args.invalidation_mode.replace('-', '_').upper()
437 args.quiet, args.legacy,
447 args.force, args.rx, args.quiet,
459 quiet=args.quiet,
462 if args.quiet < 2: