Ejemplo n.º 1
0
    def create_application(self):
        """
        Create an `Application` instance for use in a `CommandLineInterface`.
        """
        buffers = {
            'docstring': Buffer(read_only=True),
        }
        buffers.update(self._extra_buffers or {})

        return Application(
            layout=create_layout(
                self,
                self.key_bindings_manager, self._python_prompt_control,
                lexer=self._lexer,
                input_buffer_height=self._input_buffer_height,
                extra_buffer_processors=self._extra_buffer_processors,
                extra_body=self._extra_layout_body,
                extra_toolbars=self._extra_toolbars),
            buffer=self._create_buffer(),
            buffers=buffers,
            key_bindings_registry=self.key_bindings_registry,
            paste_mode=Condition(lambda cli: self.paste_mode),
            on_abort=AbortAction.RETRY,
            on_exit=self._on_exit,
            get_style=lambda: self._current_style,
            get_title=lambda: self.terminal_title,
            on_start=self._on_start,
            on_input_timeout=Callback(self._on_input_timeout))
Ejemplo n.º 2
0
    def create_application(self):
        """
        Create an `Application` instance for use in a `CommandLineInterface`.
        """
        buffers = {
            'docstring': Buffer(read_only=True),
        }
        buffers.update(self._extra_buffers or {})

        return Application(
            layout=create_layout(
                self,
                self.key_bindings_manager,
                lexer=self._lexer,
                input_buffer_height=self._input_buffer_height,
                extra_buffer_processors=self._extra_buffer_processors,
                extra_body=self._extra_layout_body,
                extra_toolbars=self._extra_toolbars),
            buffer=self._create_buffer(),
            buffers=buffers,
            key_bindings_registry=self.key_bindings_registry,
            paste_mode=Condition(lambda cli: self.paste_mode),
            mouse_support=Condition(lambda cli: self.enable_mouse_support),
            on_abort=AbortAction.RETRY,
            on_exit=self._on_exit,
            style=DynamicStyle(lambda: self._current_style),
            get_title=lambda: self.terminal_title,
            on_start=self._on_start,
            on_input_timeout=Callback(self._on_input_timeout))
Ejemplo n.º 3
0
 def _create_layout(self):
     """
     Generate new layout.
     """
     return create_layout(
         self.settings, self.key_bindings_manager, self.python_prompt_control,
         lexer=self._lexer,
         extra_buffer_processors=self._extra_buffer_processors,
         extra_sidebars=self._extra_sidebars)
Ejemplo n.º 4
0
 def _update_layout(self):
     """
     Generate new layout.
     (To be done when we add/remove buffers.)
     """
     self.cli.layout = create_layout(self.cli.buffers,
                                     self.settings,
                                     self.key_bindings_manager,
                                     self.python_prompt_control,
                                     extra_sidebars=self._extra_sidebars)
Ejemplo n.º 5
0
 def _update_layout(self):
     """
     Generate new layout.
     (To be done when we add/remove buffers.)
     """
     self.cli.layout = create_layout(
         self.cli.buffers, self.settings, self.key_bindings_manager, self.python_prompt_control,
         lexer=self._lexer,
         extra_buffer_processors=self._extra_buffer_processors,
         extra_sidebars=self._extra_sidebars)
Ejemplo n.º 6
0
 def _create_layout(self):
     """
     Generate new layout.
     """
     return create_layout(
         self.settings,
         self.key_bindings_manager,
         self.python_prompt_control,
         lexer=self._lexer,
         extra_buffer_processors=self._extra_buffer_processors,
         extra_sidebars=self._extra_sidebars)