33 from python_qt_binding.QtWidgets
import QVBoxLayout, QWidget
39 from spyder_console_widget
import SpyderConsoleWidget
42 _has_spyderlib =
False 48 Plugin providing an interactive Python console 52 super(PyConsole, self).
__init__(context)
53 self.setObjectName(
'PyConsole')
59 self._widget.setLayout(QVBoxLayout())
60 self._widget.layout().setContentsMargins(0, 0, 0, 0)
61 if context.serial_number() > 1:
62 self._widget.setWindowTitle(
63 self._widget.windowTitle() + (
' (%d)' % context.serial_number()))
64 self._context.add_widget(self.
_widget)
72 self._widget.setWindowTitle(
'SpyderConsole')
75 self._widget.setWindowTitle(
'PyConsole')
76 if self._context.serial_number() > 1:
77 self._widget.setWindowTitle(
78 self._widget.windowTitle() + (
' (%d)' % self._context.serial_number()))
87 instance_settings.value(
'use_spyderlib',
True)
in [
True,
'true'])
92 {
'title':
'SpyderConsole',
93 'description':
'Advanced Python console with tab-completion (needs spyderlib to be installed).',
'enabled': _has_spyderlib},
94 {
'title':
'PyConsole',
'description':
'Simple Python console.'},
97 dialog.add_exclusive_option_group(
98 title=
'Console Type', options=options, selected_index=int(
not self.
_use_spyderlib))
99 console_type = dialog.get_settings()[0]
100 new_use_spyderlib = {0:
True, 1:
False}.get(
108 self._console_widget.shutdown()
def trigger_configuration(self)
def save_settings(self, plugin_settings, instance_settings)
def _switch_console_widget(self)
def restore_settings(self, plugin_settings, instance_settings)
def shutdown_plugin(self)
def shutdown_console_widget(self)
def __init__(self, context)