Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ***************************************************************************
- IPython post-mortem report
- {'commit_hash': '464280a',
- 'commit_source': 'installation',
- 'ipython_path': '/usr/local/lib/python2.6/dist-packages/ipython-0.11-py2.6.egg/IPython',
- 'ipython_version': '0.11',
- 'os_name': 'posix',
- 'platform': 'Linux-2.6.32-33-generic-i686-with-Ubuntu-10.04-lucid',
- 'sys_executable': '/usr/bin/python',
- 'sys_platform': 'linux2',
- 'sys_version': '2.6.5 (r265:79063, Apr 16 2010, 13:09:56) \n[GCC 4.4.3]'}
- ***************************************************************************
- ***************************************************************************
- Crash traceback:
- ---------------------------------------------------------------------------
- TypeError Python 2.6.5: /usr/bin/python
- Mon Aug 8 12:58:21 2011
- A problem occured executing Python code. Here is the sequence of function
- calls leading up to the error, with the most recent (innermost) call last.
- /usr/local/lib/python2.6/dist-packages/ipython-0.11-py2.6.egg/IPython/frontend/qt/base_frontend_mixin.pyc in _dispatch(self=<IPython.frontend.qt.console.rich_ipython_widget.RichIPythonWidget object>, msg={'buffers': [], 'content': {'data': {'text/html': [4.5, 2], 'text/plain': '<__main__.HH at 0x9789fcc>'}, 'execution_count': 20}, 'header': {'date': datetime.datetime(2011, 8, 8, 12, 58, 20, 773830), 'msg_id': 'bbc08546-44c3-42fd-940f-44605799885b', 'msg_type': 'pyout', 'session': 'ee3860fa-4dfb-4123-8db0-4bb2f03bf6e3', 'username': 'kernel'}, 'msg_type': 'pyout', 'parent_header': {'date': datetime.datetime(2011, 8, 8, 12, 58, 20, 753494), 'msg_id': '05026e67-abb0-4b42-ac29-4010ed133db2', 'msg_type': 'execute_request', 'session': '980b2da7-7026-4708-90d4-95e215aee5cc', 'username': 'ritz'}})
- 87 """ Called when the KernelManager channels have stopped listening or
- 88 when a listening KernelManager is removed from the frontend.
- 89 """
- 90
- 91 #---------------------------------------------------------------------------
- 92 # 'BaseFrontendMixin' protected interface
- 93 #---------------------------------------------------------------------------
- 94
- 95 def _dispatch(self, msg):
- 96 """ Calls the frontend handler associated with the message type of the
- 97 given message.
- 98 """
- 99 msg_type = msg['msg_type']
- 100 handler = getattr(self, '_handle_' + msg_type, None)
- 101 if handler:
- --> 102 handler(msg)
- 103
- 104 def _is_from_this_session(self, msg):
- 105 """ Returns whether a reply from the kernel originated from a request
- 106 from this frontend.
- 107 """
- 108 session = self._kernel_manager.session.session
- 109 return msg['parent_header']['session'] == session
- /usr/local/lib/python2.6/dist-packages/ipython-0.11-py2.6.egg/IPython/frontend/qt/console/rich_ipython_widget.pyc in _handle_pyout(self=<IPython.frontend.qt.console.rich_ipython_widget.RichIPythonWidget object>, msg={'buffers': [], 'content': {'data': {'text/html': [4.5, 2], 'text/plain': '<__main__.HH at 0x9789fcc>'}, 'execution_count': 20}, 'header': {'date': datetime.datetime(2011, 8, 8, 12, 58, 20, 773830), 'msg_id': 'bbc08546-44c3-42fd-940f-44605799885b', 'msg_type': 'pyout', 'session': 'ee3860fa-4dfb-4123-8db0-4bb2f03bf6e3', 'username': 'kernel'}, 'msg_type': 'pyout', 'parent_header': {'date': datetime.datetime(2011, 8, 8, 12, 58, 20, 753494), 'msg_id': '05026e67-abb0-4b42-ac29-4010ed133db2', 'msg_type': 'execute_request', 'session': '980b2da7-7026-4708-90d4-95e215aee5cc', 'username': 'ritz'}})
- 75 data = content['data']
- 76 if data.has_key('image/svg+xml'):
- 77 self._append_plain_text(self.output_sep, True)
- 78 self._append_html(self._make_out_prompt(prompt_number), True)
- 79 self._append_svg(data['image/svg+xml'], True)
- 80 self._append_html(self.output_sep2, True)
- 81 elif data.has_key('image/png'):
- 82 self._append_plain_text(self.output_sep, True)
- 83 self._append_html(self._make_out_prompt(prompt_number), True)
- 84 # This helps the output to look nice.
- 85 self._append_plain_text('\n', True)
- 86 self._append_png(decodestring(data['image/png']), True)
- 87 self._append_html(self.output_sep2, True)
- 88 else:
- 89 # Default back to the plain text representation.
- ---> 90 return super(RichIPythonWidget, self)._handle_pyout(msg)
- 91
- 92 def _handle_display_data(self, msg):
- 93 """ Overridden to handle rich data types, like SVG.
- 94 """
- 95 if not self._hidden and self._is_from_this_session(msg):
- 96 source = msg['content']['source']
- 97 data = msg['content']['data']
- 98 metadata = msg['content']['metadata']
- 99 # Try to use the svg or html representations.
- 100 # FIXME: Is this the right ordering of things to try?
- 101 if data.has_key('image/svg+xml'):
- 102 svg = data['image/svg+xml']
- 103 self._append_svg(svg, True)
- 104 elif data.has_key('image/png'):
- 105 # PNG data is base64 encoded as it passes over the network
- /usr/local/lib/python2.6/dist-packages/ipython-0.11-py2.6.egg/IPython/frontend/qt/console/ipython_widget.pyc in _handle_pyout(self=<IPython.frontend.qt.console.rich_ipython_widget.RichIPythonWidget object>, msg={'buffers': [], 'content': {'data': {'text/html': [4.5, 2], 'text/plain': '<__main__.HH at 0x9789fcc>'}, 'execution_count': 20}, 'header': {'date': datetime.datetime(2011, 8, 8, 12, 58, 20, 773830), 'msg_id': 'bbc08546-44c3-42fd-940f-44605799885b', 'msg_type': 'pyout', 'session': 'ee3860fa-4dfb-4123-8db0-4bb2f03bf6e3', 'username': 'kernel'}, 'msg_type': 'pyout', 'parent_header': {'date': datetime.datetime(2011, 8, 8, 12, 58, 20, 753494), 'msg_id': '05026e67-abb0-4b42-ac29-4010ed133db2', 'msg_type': 'execute_request', 'session': '980b2da7-7026-4708-90d4-95e215aee5cc', 'username': 'ritz'}})
- 179 items = [ line.rstrip() for _, _, line in history_items ]
- 180 self._set_history(items)
- 181
- 182 def _handle_pyout(self, msg):
- 183 """ Reimplemented for IPython-style "display hook".
- 184 """
- 185 if not self._hidden and self._is_from_this_session(msg):
- 186 content = msg['content']
- 187 prompt_number = content['execution_count']
- 188 data = content['data']
- 189 if data.has_key('text/html'):
- 190 self._append_plain_text(self.output_sep, True)
- 191 self._append_html(self._make_out_prompt(prompt_number), True)
- 192 html = data['text/html']
- 193 self._append_plain_text('\n', True)
- --> 194 self._append_html(html + self.output_sep2, True)
- 195 elif data.has_key('text/plain'):
- 196 self._append_plain_text(self.output_sep, True)
- 197 self._append_html(self._make_out_prompt(prompt_number), True)
- 198 text = data['text/plain']
- 199 # If the repr is multiline, make sure we start on a new line,
- 200 # so that its lines are aligned.
- 201 if "\n" in text and not self.output_sep.endswith("\n"):
- 202 self._append_plain_text('\n', True)
- 203 self._append_plain_text(text + self.output_sep2, True)
- 204
- 205 def _handle_display_data(self, msg):
- 206 """ The base handler for the ``display_data`` message.
- 207 """
- 208 # For now, we don't display data from other frontends, but we
- 209 # eventually will as this allows all frontends to monitor the display
- TypeError: can only concatenate list (not "unicode") to list
- ***************************************************************************
- History of session input:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement