コード例 #1
0
    def init_environment(self):
        """Configure the user's environment.

        """
        env = os.environ
        # These two ensure 'ls' produces nice coloring on BSD-derived systems
        env['TERM'] = 'xterm-color'
        env['CLICOLOR'] = '1'
        # Since normal pagers don't work at all (over pexpect we don't have
        # single-key control of the subprocess), try to disable paging in
        # subprocesses as much as possible.
        env['PAGER'] = 'cat'
        env['GIT_PAGER'] = 'cat'

        # And install the payload version of page.
        install_payload_page()
コード例 #2
0
ファイル: zmqshell.py プロジェクト: jisqyv/ipython
    def init_environment(self):
        """Configure the user's environment.

        """
        env = os.environ
        # These two ensure 'ls' produces nice coloring on BSD-derived systems
        env['TERM'] = 'xterm-color'
        env['CLICOLOR'] = '1'
        # Since normal pagers don't work at all (over pexpect we don't have
        # single-key control of the subprocess), try to disable paging in
        # subprocesses as much as possible.
        env['PAGER'] = 'cat'
        env['GIT_PAGER'] = 'cat'
        
        # And install the payload version of page.
        install_payload_page()
コード例 #3
0
ファイル: zmqshell.py プロジェクト: pv/ipython
from IPython.utils import io
from IPython.utils.jsonutil import json_clean
from IPython.utils.path import get_py_filename
from IPython.utils.process import arg_split
from IPython.utils.traitlets import Instance, Type, Dict, CBool
from IPython.utils.warn import warn, error
from IPython.zmq.displayhook import ZMQShellDisplayHook, _encode_binary
from IPython.zmq.session import extract_header
from session import Session

#-----------------------------------------------------------------------------
# Globals and side-effects
#-----------------------------------------------------------------------------

# Install the payload version of page.
install_payload_page()

#-----------------------------------------------------------------------------
# Functions and classes
#-----------------------------------------------------------------------------

class ZMQDisplayPublisher(DisplayPublisher):
    """A display publisher that publishes data using a ZeroMQ PUB socket."""

    session = Instance(Session)
    pub_socket = Instance('zmq.Socket')
    parent_header = Dict({})

    def set_parent(self, parent):
        """Set the parent for outbound messages."""
        self.parent_header = extract_header(parent)
コード例 #4
0
from IPython.core.magic import MacroToEdit
from IPython.core.payloadpage import install_payload_page
from IPython.utils import io
from IPython.utils.path import get_py_filename
from IPython.utils.traitlets import Instance, Type, Dict, CBool
from IPython.utils.warn import warn
from IPython.zmq.displayhook import ZMQShellDisplayHook, _encode_png
from IPython.zmq.session import extract_header
from session import Session

#-----------------------------------------------------------------------------
# Globals and side-effects
#-----------------------------------------------------------------------------

# Install the payload version of page.
install_payload_page()

#-----------------------------------------------------------------------------
# Functions and classes
#-----------------------------------------------------------------------------


class ZMQDisplayPublisher(DisplayPublisher):
    """A display publisher that publishes data using a ZeroMQ PUB socket."""

    session = Instance(Session)
    pub_socket = Instance('zmq.Socket')
    parent_header = Dict({})

    def set_parent(self, parent):
        """Set the parent for outbound messages."""