Show More
@@ -135,6 +135,8 b' class IPythonWidget(FrontendWidget):' | |||||
135 | else: |
|
135 | else: | |
136 | self.set_default_style() |
|
136 | self.set_default_style() | |
137 |
|
137 | |||
|
138 | self._guiref_loaded = False | |||
|
139 | ||||
138 | #--------------------------------------------------------------------------- |
|
140 | #--------------------------------------------------------------------------- | |
139 | # 'BaseFrontendMixin' abstract interface |
|
141 | # 'BaseFrontendMixin' abstract interface | |
140 | #--------------------------------------------------------------------------- |
|
142 | #--------------------------------------------------------------------------- | |
@@ -258,10 +260,21 b' class IPythonWidget(FrontendWidget):' | |||||
258 | # This newline seems to be needed for text and html output. |
|
260 | # This newline seems to be needed for text and html output. | |
259 | self._append_plain_text(u'\n', True) |
|
261 | self._append_plain_text(u'\n', True) | |
260 |
|
262 | |||
|
263 | def _handle_kernel_info_reply(self, rep): | |||
|
264 | """ Handle kernel info replies. | |||
|
265 | """ | |||
|
266 | if not self._guiref_loaded: | |||
|
267 | if rep['content']['language'] == 'python': | |||
|
268 | self._load_guiref_magic() | |||
|
269 | self._guiref_loaded = True | |||
|
270 | ||||
261 | def _started_channels(self): |
|
271 | def _started_channels(self): | |
262 | """Reimplemented to make a history request and load %guiref.""" |
|
272 | """Reimplemented to make a history request and load %guiref.""" | |
263 | super(IPythonWidget, self)._started_channels() |
|
273 | super(IPythonWidget, self)._started_channels() | |
264 | self._load_guiref_magic() |
|
274 | ||
|
275 | # The reply will trigger %guiref load provided language=='python' | |||
|
276 | self.kernel_client.kernel_info() | |||
|
277 | ||||
265 | self.kernel_client.shell_channel.history(hist_access_type='tail', |
|
278 | self.kernel_client.shell_channel.history(hist_access_type='tail', | |
266 | n=1000) |
|
279 | n=1000) | |
267 |
|
280 |
General Comments 0
You need to be logged in to leave comments.
Login now