MCPcopy Index your code
hub / github.com/pyinvoke/invoke / sudo

Function sudo

invoke/__init__.py:55–72  ·  view source on GitHub ↗

Run ``command`` in a ``sudo`` subprocess and return a `.Result` object. See `.Context.sudo` for API details, such as the ``password`` kwarg. .. note:: This function is a convenience wrapper around Invoke's `.Context` and `.Runner` APIs. Specifically, it create

(command: str, **kwargs: Any)

Source from the content-addressed store, hash-verified

53
54
55def sudo(command: str, **kwargs: Any) -> Result:
56 """
57 Run ``command`` in a ``sudo`` subprocess and return a `.Result` object.
58
59 See `.Context.sudo` for API details, such as the ``password`` kwarg.
60
61 .. note::
62 This function is a convenience wrapper around Invoke's `.Context` and
63 `.Runner` APIs.
64
65 Specifically, it creates an anonymous `.Context` instance and calls its
66 `~.Context.sudo` method, which in turn defaults to using a `.Local`
67 runner subclass for command execution (plus sudo-related bits &
68 pieces).
69
70 .. versionadded:: 1.4
71 """
72 return Context().sudo(command, **kwargs)

Callers

nothing calls this directly

Calls 2

ContextClass · 0.85
sudoMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…