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:
 
   63                 self.
_widget.windowTitle() + (
' (%d)' % context.serial_number()))
 
   72             self.
_widget.setWindowTitle(
'SpyderConsole')
 
   75             self.
_widget.setWindowTitle(
'PyConsole')
 
   76         if self.
_context.serial_number() > 1:
 
   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(