OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python37
/
lib
/
python3.7
/
site-packages
/
click
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
09/05/2025 09:36:16 AM
rwxr-xr-x
📄
__init__.py
3.06 KB
03/16/2023 12:56:53 PM
rw-r--r--
📁
__pycache__
-
03/16/2023 12:56:53 PM
rwxr-xr-x
📄
_compat.py
18.37 KB
03/16/2023 12:56:53 PM
rw-r--r--
📄
_termui_impl.py
22.9 KB
03/16/2023 12:56:53 PM
rw-r--r--
📄
_textwrap.py
1.32 KB
03/16/2023 12:56:53 PM
rw-r--r--
📄
_winconsole.py
7.68 KB
03/16/2023 12:56:53 PM
rw-r--r--
📄
core.py
110.14 KB
03/16/2023 12:56:53 PM
rw-r--r--
📄
decorators.py
15.97 KB
03/16/2023 12:56:53 PM
rw-r--r--
📄
exceptions.py
8.95 KB
03/16/2023 12:56:53 PM
rw-r--r--
📄
formatting.py
9.48 KB
03/16/2023 12:56:53 PM
rw-r--r--
📄
globals.py
1.92 KB
03/16/2023 12:56:53 PM
rw-r--r--
📄
parser.py
18.6 KB
03/16/2023 12:56:53 PM
rw-r--r--
📄
py.typed
0 bytes
03/16/2023 12:56:53 PM
rw-r--r--
📄
shell_completion.py
17.6 KB
03/16/2023 12:56:53 PM
rw-r--r--
📄
termui.py
27.69 KB
03/16/2023 12:56:53 PM
rw-r--r--
📄
testing.py
15.69 KB
03/16/2023 12:56:53 PM
rw-r--r--
📄
types.py
34.97 KB
03/16/2023 12:56:53 PM
rw-r--r--
📄
utils.py
18.24 KB
03/16/2023 12:56:53 PM
rw-r--r--
Editing: globals.py
Close
import typing as t from threading import local if t.TYPE_CHECKING: import typing_extensions as te from .core import Context _local = local() @t.overload def get_current_context(silent: "te.Literal[False]" = False) -> "Context": ... @t.overload def get_current_context(silent: bool = ...) -> t.Optional["Context"]: ... def get_current_context(silent: bool = False) -> t.Optional["Context"]: """Returns the current click context. This can be used as a way to access the current context object from anywhere. This is a more implicit alternative to the :func:`pass_context` decorator. This function is primarily useful for helpers such as :func:`echo` which might be interested in changing its behavior based on the current context. To push the current context, :meth:`Context.scope` can be used. .. versionadded:: 5.0 :param silent: if set to `True` the return value is `None` if no context is available. The default behavior is to raise a :exc:`RuntimeError`. """ try: return t.cast("Context", _local.stack[-1]) except (AttributeError, IndexError) as e: if not silent: raise RuntimeError("There is no active click context.") from e return None def push_context(ctx: "Context") -> None: """Pushes a new context to the current stack.""" _local.__dict__.setdefault("stack", []).append(ctx) def pop_context() -> None: """Removes the top level from the stack.""" _local.stack.pop() def resolve_color_default(color: t.Optional[bool] = None) -> t.Optional[bool]: """Internal helper to get the default value of the color flag. If a value is passed it's returned unchanged, otherwise it's looked up from the current context. """ if color is not None: return color ctx = get_current_context(silent=True) if ctx is not None: return ctx.color return None