MCPcopy Index your code
hub / github.com/prompt-toolkit/ptpython / _create_application

Method _create_application

src/ptpython/python_input.py:900–937  ·  view source on GitHub ↗

Create an `Application` instance.

(
        self, input: Input | None, output: Output | None
    )

Source from the content-addressed store, hash-verified

898 ]
899
900 def _create_application(
901 self, input: Input | None, output: Output | None
902 ) -> Application[str]:
903 """
904 Create an `Application` instance.
905 """
906 return Application(
907 layout=self.ptpython_layout.layout,
908 key_bindings=merge_key_bindings(
909 [
910 load_python_bindings(self),
911 load_auto_suggest_bindings(),
912 load_sidebar_bindings(self),
913 load_confirm_exit_bindings(self),
914 ConditionalKeyBindings(
915 load_open_in_editor_bindings(),
916 Condition(lambda: self.enable_open_in_editor),
917 ),
918 # Extra key bindings should not be active when the sidebar is visible.
919 ConditionalKeyBindings(
920 self.extra_key_bindings,
921 Condition(lambda: not self.show_sidebar),
922 ),
923 ]
924 ),
925 color_depth=lambda: self.color_depth,
926 paste_mode=Condition(lambda: self.paste_mode),
927 mouse_support=Condition(lambda: self.enable_mouse_support),
928 style=DynamicStyle(lambda: self._current_style),
929 style_transformation=self.style_transformation,
930 include_default_pygments_style=False,
931 reverse_vi_search_direction=True,
932 cursor=DynamicCursorShapeConfig(
933 lambda: self.all_cursor_shape_configs[self.cursor_shape_config]
934 ),
935 input=input,
936 output=output,
937 )
938
939 def _create_buffer(self) -> Buffer:
940 """

Callers 1

__init__Method · 0.95

Calls 3

load_python_bindingsFunction · 0.85
load_sidebar_bindingsFunction · 0.85

Tested by

no test coverage detected