Adding upstream version 3.0.16.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
51316093cf
commit
0014608abc
52 changed files with 7417 additions and 0 deletions
36
ptpython/filters.py
Normal file
36
ptpython/filters.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
from typing import TYPE_CHECKING
|
||||
|
||||
from prompt_toolkit.filters import Filter
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .python_input import PythonInput
|
||||
|
||||
__all__ = ["HasSignature", "ShowSidebar", "ShowSignature", "ShowDocstring"]
|
||||
|
||||
|
||||
class PythonInputFilter(Filter):
|
||||
def __init__(self, python_input: "PythonInput") -> None:
|
||||
self.python_input = python_input
|
||||
|
||||
def __call__(self) -> bool:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class HasSignature(PythonInputFilter):
|
||||
def __call__(self) -> bool:
|
||||
return bool(self.python_input.signatures)
|
||||
|
||||
|
||||
class ShowSidebar(PythonInputFilter):
|
||||
def __call__(self) -> bool:
|
||||
return self.python_input.show_sidebar
|
||||
|
||||
|
||||
class ShowSignature(PythonInputFilter):
|
||||
def __call__(self) -> bool:
|
||||
return self.python_input.show_signature
|
||||
|
||||
|
||||
class ShowDocstring(PythonInputFilter):
|
||||
def __call__(self) -> bool:
|
||||
return self.python_input.show_docstring
|
Loading…
Add table
Add a link
Reference in a new issue