s3vaultlib.editor package¶
Submodules¶
s3vaultlib.editor.autosuggestions module¶
-
class
s3vaultlib.editor.autosuggestions.
AutosuggestFromDocumentData
(bottom_toolbar_attributes=None, mode='json', **kwargs)[source]¶ Bases:
prompt_toolkit.auto_suggest.AutoSuggest
-
get_suggestion
(buffer, document)[source]¶ Return None or a
Suggestion
instance.We receive both
Buffer
andDocument
. The reason is that auto suggestions are retrieved asynchronously. (Like completions.) The buffer text could be changed in the meantime, butdocument
contains the buffer document like it was at the start of the auto suggestion call. So, from here, don’t accessbuffer.text
, but usedocument.text
instead.Parameters: - buffer – The
Buffer
instance. - document – The
Document
instance.
- buffer – The
-
s3vaultlib.editor.completers module¶
-
class
s3vaultlib.editor.completers.
CompleteFromDocumentKeys
(bottom_toolbar_attributes=None, mode='json', **kwargs)[source]¶ Bases:
prompt_toolkit.completion.base.Completer
-
get_completions
(document, complete_event)[source]¶ This should be a generator that yields
Completion
instances.If the generation of completions is something expensive (that takes a lot of time), consider wrapping this Completer class in a ThreadedCompleter. In that case, the completer algorithm runs in a background thread and completions will be displayed as soon as they arrive.
Parameters: - document –
Document
instance. - complete_event –
CompleteEvent
instance.
- document –
-
s3vaultlib.editor.editor module¶
-
class
s3vaultlib.editor.editor.
Editor
(json_data, attributes=None, mode='json')[source]¶ Bases:
object
-
LEXERS
= {'json': <class 'pygments.lexers.data.JsonLexer'>, 'yaml': <class 'pygments.lexers.data.YamlLexer'>}¶
-
SUPPORTED_MODE
= ('json', 'yaml')¶
-
VALIDATORS
= {'json': <class 's3vaultlib.editor.validators.JSONValidator'>, 'yaml': <class 's3vaultlib.editor.validators.YAMLValidator'>}¶
-
data
¶
-
lexer_class
¶
-
result
¶
-
validator_class
¶
-