MCPcopy Index your code
hub / github.com/pymupdf/PyMuPDF / run

Function run

pipcl.py:2281–2416  ·  view source on GitHub ↗

Runs a command using `subprocess.run()`. Args: command: A string, the command to run. Multiple lines in `command` are treated as a single command. * If a line starts with `#` it is discarded. * If a line contains ` #`, the trailing

(
        command,
        *,
        capture=False,
        check=1,
        verbose=1,
        env=None,
        env_extra=None,
        timeout=None,
        caller=1,
        prefix=None,
        encoding=None,  # System default.
        errors='backslashreplace',
        )

Source from the content-addressed store, hash-verified

2279
2280
2281def run(
2282 command,
2283 *,
2284 capture=False,
2285 check=1,
2286 verbose=1,
2287 env=None,
2288 env_extra=None,
2289 timeout=None,
2290 caller=1,
2291 prefix=None,
2292 encoding=None, # System default.
2293 errors='backslashreplace',
2294 ):
2295 '''
2296 Runs a command using `subprocess.run()`.
2297
2298 Args:
2299 command:
2300 A string, the command to run.
2301
2302 Multiple lines in `command` are treated as a single command.
2303
2304 * If a line starts with `#` it is discarded.
2305 * If a line contains ` #`, the trailing text is discarded.
2306
2307 When running the command on Windows, newlines are replaced by
2308 spaces; otherwise each line is terminated by a backslash character.
2309 capture:
2310 If true, we include the command's output in our return value.
2311 check:
2312 If true we raise an exception on error; otherwise we include the
2313 command's returncode in our return value.
2314 verbose:
2315 If true we show the command.
2316 env:
2317 None or dict to use instead of <os.environ>.
2318 env_extra:
2319 None or dict to add to <os.environ> or <env>.
2320 timeout:
2321 If not None, timeout in seconds; passed directly to
2322 subprocess.run(). Note that on MacOS subprocess.run() seems to
2323 leave processes running if timeout expires.
2324 prefix:
2325 String prefix for each line of output.
2326
2327 If true:
2328 * We run command with stdout=subprocess.PIPE and
2329 stderr=subprocess.STDOUT, repetaedly reading the command&#x27;s output
2330 and writing it to stdout with <prefix>.
2331 * We do not support <timeout>, which must be None.
2332 Returns:
2333 check capture Return
2334 --------------------------
2335 false false returncode
2336 false true (returncode, output)
2337 true false None or raise exception
2338 true true output or raise exception

Callers 12

build_wheelMethod · 0.70
git_infoFunction · 0.70
do_updateFunction · 0.70
git_getFunction · 0.70
__init__Method · 0.70
run_ifFunction · 0.70
swig_getFunction · 0.70
macos_add_brew_pathFunction · 0.70
venv_runFunction · 0.70
git_patchFunction · 0.70
get_mupdf_internalFunction · 0.70
buildFunction · 0.70

Calls 8

_command_linesFunction · 0.85
log1Function · 0.85
windowsFunction · 0.85
copyMethod · 0.80
flushMethod · 0.80
updateMethod · 0.45
writeMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected