##// END OF EJS Templates
Reverse hscrollbar min-height hack on OS X...
Reverse hscrollbar min-height hack on OS X OS X has optional behavior to only draw scrollbars during scroll, which causes problems for CodeMirror's scrollbars. CodeMirror's solution is to set a minimum size for their scrollbars, which is always present. The trade is that the container overlays most of the last line, swallowing click events when there is scrolling to do, even when no scrollbar is visible. This reverses the trade, recovering the click events at the expense of never showing the horizontal scrollbar on OS X when this option is enabled.

File last commit:

r11130:de5468b5
r20298:2907e856
Show More
manager.py
62 lines | 2.1 KiB | text/x-python | PythonLexer
MinRK
split KernelManager into KernelManager + KernelClient
r10285 """A kernel manager with a tornado IOLoop"""
Brian Granger
Refactoring kernel restarting.
r10282
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from __future__ import absolute_import
from zmq.eventloop import ioloop
MinRK
cleanup boundaries of MultiKernelManager and KernelRestarter classes...
r10295 from zmq.eventloop.zmqstream import ZMQStream
Brian Granger
Refactoring kernel restarting.
r10282
from IPython.utils.traitlets import (
Instance
)
MinRK
split KernelManager into KernelManager + KernelClient
r10285 from IPython.kernel.manager import KernelManager
MinRK
update imports with new layout
r10284 from .restarter import IOLoopKernelRestarter
Brian Granger
Refactoring kernel restarting.
r10282
#-----------------------------------------------------------------------------
# Code
#-----------------------------------------------------------------------------
MinRK
cleanup boundaries of MultiKernelManager and KernelRestarter classes...
r10295
def as_zmqstream(f):
def wrapped(self, *args, **kwargs):
socket = f(self, *args, **kwargs)
return ZMQStream(socket, self.loop)
return wrapped
MinRK
split KernelManager into KernelManager + KernelClient
r10285 class IOLoopKernelManager(KernelManager):
Brian Granger
Refactoring kernel restarting.
r10282
loop = Instance('zmq.eventloop.ioloop.IOLoop', allow_none=False)
def _loop_default(self):
return ioloop.IOLoop.instance()
MinRK
update imports with new layout
r10284 _restarter = Instance('IPython.kernel.ioloop.IOLoopKernelRestarter')
Brian Granger
Refactoring kernel restarting.
r10282
def start_restarter(self):
if self.autorestart and self.has_kernel:
if self._restarter is None:
self._restarter = IOLoopKernelRestarter(
kernel_manager=self, loop=self.loop,
MinRK
use `parent=self` throughout IPython...
r11064 parent=self, log=self.log
Brian Granger
Refactoring kernel restarting.
r10282 )
self._restarter.start()
def stop_restarter(self):
if self.autorestart:
if self._restarter is not None:
self._restarter.stop()
MinRK
cleanup boundaries of MultiKernelManager and KernelRestarter classes...
r10295
connect_shell = as_zmqstream(KernelManager.connect_shell)
connect_iopub = as_zmqstream(KernelManager.connect_iopub)
connect_stdin = as_zmqstream(KernelManager.connect_stdin)
connect_hb = as_zmqstream(KernelManager.connect_hb)