-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implemented ReplContext class * updated dependencies * Added test cases for ReplContext * Moved ISATTY value to 'globals_' for global access * Fixed flake8 errors
- Loading branch information
1 parent
b2ef9d9
commit 95e252b
Showing
8 changed files
with
400 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from .core import ReplContext | ||
|
||
|
||
# To store the ReplContext objects generated throughout the Runtime. | ||
_context_stack: list[ReplContext] = [] | ||
|
||
|
||
def _push_context(ctx: ReplContext) -> None: | ||
""" | ||
Pushes a new REPL context onto the current stack. | ||
Parameters | ||
---------- | ||
ctx | ||
The :class:`~click_repl.core.ReplContext` object that should be | ||
added to the REPL context stack. | ||
""" | ||
_context_stack.append(ctx) | ||
|
||
|
||
def _pop_context() -> None: | ||
"""Removes the top-level REPL context from the stack.""" | ||
_context_stack.pop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.