##// END OF EJS Templates
Minor cleanup.
epatters -
Show More
@@ -54,6 +54,14 b' class FrontendHighlighter(PygmentsHighlighter):'
54
54
55 PygmentsHighlighter.highlightBlock(self, qstring)
55 PygmentsHighlighter.highlightBlock(self, qstring)
56
56
57 def rehighlightBlock(self, block):
58 """ Reimplemented to temporarily enable highlighting if disabled.
59 """
60 old = self.highlighting_on
61 self.highlighting_on = True
62 super(FrontendHighlighter, self).rehighlightBlock(block)
63 self.highlighting_on = old
64
57 def setFormat(self, start, count, format):
65 def setFormat(self, start, count, format):
58 """ Reimplemented to highlight selectively.
66 """ Reimplemented to highlight selectively.
59 """
67 """
@@ -155,12 +155,9 b' class IPythonWidget(FrontendWidget):'
155 self._prompt = self._insert_html_fetching_plain_text(
155 self._prompt = self._insert_html_fetching_plain_text(
156 cursor, prompt)
156 cursor, prompt)
157
157
158 # XXX: When the HTML is inserted, Qt blows away the syntax
158 # When the HTML is inserted, Qt blows away the syntax
159 # highlighting for the line. I cannot for the life of me
159 # highlighting for the line, so we need to rehighlight it.
160 # determine how to preserve the existing formatting.
161 self._highlighter.highlighting_on = True
162 self._highlighter.rehighlightBlock(cursor.block())
160 self._highlighter.rehighlightBlock(cursor.block())
163 self._highlighter.highlighting_on = False
164
161
165 self._previous_prompt_obj = None
162 self._previous_prompt_obj = None
166
163
@@ -86,7 +86,7 b' class Kernel(Configurable):'
86 If true, an 'import *' is done from numpy and pylab.
86 If true, an 'import *' is done from numpy and pylab.
87 """
87 """
88 # FIXME: This is adapted from IPython.lib.pylabtools.pylab_activate.
88 # FIXME: This is adapted from IPython.lib.pylabtools.pylab_activate.
89 # Common funtionality should be refactored.
89 # Common functionality should be refactored.
90
90
91 # We must set the desired backend before importing pylab.
91 # We must set the desired backend before importing pylab.
92 import matplotlib
92 import matplotlib
@@ -118,7 +118,6 b' class Kernel(Configurable):'
118 def start(self):
118 def start(self):
119 """ Start the kernel main loop.
119 """ Start the kernel main loop.
120 """
120 """
121
122 while True:
121 while True:
123 ident = self.reply_socket.recv()
122 ident = self.reply_socket.recv()
124 assert self.reply_socket.rcvmore(), "Missing message part."
123 assert self.reply_socket.rcvmore(), "Missing message part."
General Comments 0
You need to be logged in to leave comments. Login now