##// END OF EJS Templates
Fixes for Qt console
Thomas Kluyver -
Show More
@@ -106,7 +106,7 b' class AnsiCodeProcessor(object):'
106 self.actions = []
106 self.actions = []
107 start = match.end()
107 start = match.end()
108
108
109 groups = filter(lambda x: x is not None, match.groups())
109 groups = [g for g in match.groups() if (g is not None)]
110 g0 = groups[0]
110 g0 = groups[0]
111 if g0 == '\a':
111 if g0 == '\a':
112 self.actions.append(BeepAction('beep'))
112 self.actions.append(BeepAction('beep'))
@@ -129,7 +129,7 b' class AnsiCodeProcessor(object):'
129 if g0.startswith('['):
129 if g0.startswith('['):
130 # Case 1: CSI code.
130 # Case 1: CSI code.
131 try:
131 try:
132 params = map(int, params)
132 params = list(map(int, params))
133 except ValueError:
133 except ValueError:
134 # Silently discard badly formed codes.
134 # Silently discard badly formed codes.
135 pass
135 pass
@@ -21,7 +21,6 b' from IPython.config.configurable import LoggingConfigurable'
21 from IPython.core.inputsplitter import ESC_SEQUENCES
21 from IPython.core.inputsplitter import ESC_SEQUENCES
22 from IPython.qt.rich_text import HtmlExporter
22 from IPython.qt.rich_text import HtmlExporter
23 from IPython.qt.util import MetaQObjectHasTraits, get_font
23 from IPython.qt.util import MetaQObjectHasTraits, get_font
24 from IPython.utils.py3compat import with_metaclass
25 from IPython.utils.text import columnize
24 from IPython.utils.text import columnize
26 from IPython.utils.traitlets import Bool, Enum, Integer, Unicode
25 from IPython.utils.traitlets import Bool, Enum, Integer, Unicode
27 from .ansi_code_processor import QtAnsiCodeProcessor
26 from .ansi_code_processor import QtAnsiCodeProcessor
@@ -70,7 +69,7 b' def is_letter_or_number(char):'
70 # Classes
69 # Classes
71 #-----------------------------------------------------------------------------
70 #-----------------------------------------------------------------------------
72
71
73 class ConsoleWidget(with_metaclass(MetaQObjectHasTraits, type('NewBase', (LoggingConfigurable, QtGui.QWidget), {}))):
72 class ConsoleWidget(MetaQObjectHasTraits('NewBase', (LoggingConfigurable, QtGui.QWidget), {})):
74 """ An abstract base class for console-type widgets. This class has
73 """ An abstract base class for console-type widgets. This class has
75 functionality for:
74 functionality for:
76
75
@@ -221,9 +220,9 b" class ConsoleWidget(with_metaclass(MetaQObjectHasTraits, type('NewBase', (Loggin"
221
220
222 # The shortcuts defined by this widget. We need to keep track of these to
221 # The shortcuts defined by this widget. We need to keep track of these to
223 # support 'override_shortcuts' above.
222 # support 'override_shortcuts' above.
224 _shortcuts = set(_ctrl_down_remap.keys() +
223 _shortcuts = set(_ctrl_down_remap.keys()) | \
225 [ QtCore.Qt.Key_C, QtCore.Qt.Key_G, QtCore.Qt.Key_O,
224 { QtCore.Qt.Key_C, QtCore.Qt.Key_G, QtCore.Qt.Key_O,
226 QtCore.Qt.Key_V ])
225 QtCore.Qt.Key_V }
227
226
228 _temp_buffer_filled = False
227 _temp_buffer_filled = False
229
228
General Comments 0
You need to be logged in to leave comments. Login now