Warning

This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: kernel.adapter

Adapters for IPython msg spec versions.

3 Classes

class IPython.kernel.adapter.Adapter

Bases: object

Base class for adapting messages

Override message_type(msg) methods to create adapters.

handle_reply_status_error(msg)

This will be called instead of the regular handler

on any reply with status != ok

class IPython.kernel.adapter.V5toV4

Bases: IPython.kernel.adapter.Adapter

Adapt msg protocol v5 to v4

object_info_reply(msg)

inspect_reply can’t be easily backward compatible

class IPython.kernel.adapter.V4toV5

Bases: IPython.kernel.adapter.Adapter

Convert msg spec V4 to V5

inspect_reply(msg)

inspect_reply can’t be easily backward compatible

2 Functions

IPython.kernel.adapter.code_to_line(code, cursor_pos)

Turn a multiline code block and cursor position into a single line and new cursor position.

For adapting complete_ and object_info_request.

IPython.kernel.adapter.adapt(msg, to_version=5)

Adapt a single message to a target version

Parameters:

msg : dict

An IPython message.

to_version : int, optional

The target major version. If unspecified, adapt to the current version for IPython.

Returns:

msg : dict

An IPython message appropriate in the new version.