Fix `KeyError: 'detail_level' with IPython 3.0

Some more problems with inspect_request messages that I thought I fixed
in earlier commits.

Also some typo fixin' and link correctin'.
This commit is contained in:
John Miller 2015-03-17 20:41:31 -05:00
parent 68e14af9ea
commit f41549cd2e
2 changed files with 25 additions and 18 deletions

View file

@ -38,10 +38,10 @@ Other notebook features:
Links:
* `Online Documentation
<http://tkf.github.com/emacs-ipython-notebook/>`_
<http://millejoh.github.io/emacs-ipython-notebook/>`_
* `Wiki
<https://github.com/tkf/emacs-ipython-notebook/wiki>`_
<https://github.com/millejoh/emacs-ipython-notebook/wiki>`_
+ `Screenshots
<https://github.com/tkf/emacs-ipython-notebook/wiki/Screenshots>`_
@ -49,11 +49,11 @@ Links:
<https://github.com/tkf/emacs-ipython-notebook/wiki/Tips>`_
* `Downloads
<https://github.com/tkf/emacs-ipython-notebook/tags>`_
<https://github.com/millejoh/emacs-ipython-notebook/tags>`_
* `Repository at GitHub
<https://github.com/tkf/emacs-ipython-notebook>`_
<https://github.com/millejoh/emacs-ipython-notebook>`_
* `Issue Tracker at GitHub
<https://github.com/tkf/emacs-ipython-notebook/issues>`_
<https://github.com/millejoh/emacs-ipython-notebook/issues>`_
.. [#] You need to setup :el:symbol:`ein:console-args` properly
.. [#] Use the command :el:symbol:`ein:connect-to-notebook-command`.
@ -319,7 +319,7 @@ Misc
.. el:function:: anything-ein-notebook-buffers
.. el:package:: ein
.. It is better to remove el:package from eldomain??
.. Is it better to remove el:package from eldomain??
Org-mode integration
@ -498,8 +498,8 @@ web client. See `emacslisp.py`_ for more details.
https://github.com/tkf/emacs-ipython-notebook/blob/master/tools/emacslisp.py
Reporting issue
---------------
Reporting issues
----------------
Please use ``M-x ein:dev-bug-report-template`` to write a bug report.
It pops up a buffer containing some system information and instruction
@ -509,7 +509,7 @@ for bug report.
Logging
^^^^^^^
Sometime more information that the ``*Message*`` buffer provides is
Sometime more information than provided in the ``*Message*`` is
needed to debug.
1. Execute ``(ein:log-set-level 'debug)``

View file

@ -357,19 +357,24 @@ Call signature::
(`funcall' FUNCTION ARGUMENT CONTENT METADATA)
CONTENT and METADATA are given by `object_into_reply' message.
CONTENT and METADATA are given by `object_info_reply' message.
`object_into_reply' message is documented here:
`object_info_reply' message is documented here:
http://ipython.org/ipython-doc/dev/development/messaging.html#object-information
"
(assert (ein:kernel-live-p kernel) nil "object_info_reply: Kernel is not active.")
(when objname
(let* ((content (list :oname (format "%s" objname)))
(msg (ein:kernel--get-msg kernel "object_info_request" content))
(msg-id (plist-get (plist-get msg :header) :msg_id)))
(let ((content (list :oname (format "%s" objname)))
msg
msg-id)
(if (>= (ein:$kernel-api-version kernel) 3)
(setf msg (ein:kernel--get-msg kernel "inspect_request"
(append content (list :detail_level 1)))
msg-id (plist-get (plist-get msg :header) :msg_id))
(setf msg (ein:kernel--get-msg kernel "object_info_request" content)
msg-id (plist-get (plist-get msg :header) :msg_id)))
(ein:websocket-send-shell-channel kernel msg)
(ein:kernel-set-callbacks-for-msg kernel msg-id callbacks)
msg-id)))
(ein:kernel-set-callbacks-for-msg kernel msg-id callbacks))))
(defun* ein:kernel-execute (kernel code &optional callbacks
@ -631,7 +636,7 @@ Example::
(defun ein:kernel--handle-channels-reply (kernel packet)
(ein:log 'debug "KERNEL--HANDLE_CHANNELS-REPLY")
(let ((channel (plist-get (ein:json-read-from-string packet) :channel)))
(let ((channel (plist-get es(ein:json-read-from-string packet) :channel)))
(cond ((string-equal channel "iopub")
(ein:kernel--handle-iopub-reply kernel packet))
((string-equal channel "shell")
@ -697,7 +702,7 @@ Example::
(if (and (not (equal msg-type "status")) (null callbacks))
(ein:log 'verbose "Got message not from this notebook.")
(ein:case-equal msg-type
(("stream" "display_data" "pyout" "pyerr" "execute_result")
(("stream" "display_data" "pyout" "pyerr" "error" "execute_result")
(ein:aif (plist-get callbacks :output)
(ein:funcall-packed it msg-type content metadata)))
(("status")
@ -709,6 +714,8 @@ Example::
(("dead")
(ein:kernel-stop-channels kernel)
(ein:events-trigger events 'status_dead.Kernel))))
(("data_pub")
(ein:log 'verbose (format "Received data_pub message w/content %s" packet)))
(("clear_output")
(ein:aif (plist-get callbacks :clear_output)
(ein:funcall-packed it content metadata)))))))