You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
805 B
39 lines
805 B
6 years ago
|
from __future__ import unicode_literals
|
||
|
|
||
|
from prompt_toolkit.filters import Filter
|
||
|
|
||
|
__all__ = (
|
||
|
'HasSignature',
|
||
|
'ShowSidebar',
|
||
|
'ShowSignature',
|
||
|
'ShowDocstring',
|
||
|
)
|
||
|
|
||
|
|
||
|
class PythonInputFilter(Filter):
|
||
|
def __init__(self, python_input):
|
||
|
self.python_input = python_input
|
||
|
|
||
|
def __call__(self):
|
||
|
raise NotImplementedError
|
||
|
|
||
|
|
||
|
class HasSignature(PythonInputFilter):
|
||
|
def __call__(self):
|
||
|
return bool(self.python_input.signatures)
|
||
|
|
||
|
|
||
|
class ShowSidebar(PythonInputFilter):
|
||
|
def __call__(self):
|
||
|
return self.python_input.show_sidebar
|
||
|
|
||
|
|
||
|
class ShowSignature(PythonInputFilter):
|
||
|
def __call__(self):
|
||
|
return self.python_input.show_signature
|
||
|
|
||
|
|
||
|
class ShowDocstring(PythonInputFilter):
|
||
|
def __call__(self):
|
||
|
return self.python_input.show_docstring
|