Skip to content

Commit

Permalink
Merge pull request ipython#5042 from takluyver/remove-channelabc-dupl…
Browse files Browse the repository at this point in the history
…icates

Remove duplicated Channel ABC classes.
  • Loading branch information
minrk committed Feb 6, 2014
2 parents 3494dff + f17f8c3 commit bf59bef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 126 deletions.
8 changes: 0 additions & 8 deletions IPython/kernel/channelsabc.py
Expand Up @@ -7,18 +7,10 @@
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------

import abc

from IPython.utils.py3compat import with_metaclass

#-----------------------------------------------------------------------------
# Channels
#-----------------------------------------------------------------------------


class ChannelABC(with_metaclass(abc.ABCMeta, object)):
"""A base class for all channel ABCs."""
Expand Down
119 changes: 1 addition & 118 deletions IPython/kernel/managerabc.py
@@ -1,4 +1,4 @@
"""Abstract base classes for kernel manager and channels."""
"""Abstract base class for kernel managers."""

#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
Expand All @@ -7,127 +7,10 @@
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------

import abc

from IPython.utils.py3compat import with_metaclass

#-----------------------------------------------------------------------------
# Channels
#-----------------------------------------------------------------------------


class ChannelABC(with_metaclass(abc.ABCMeta, object)):
"""A base class for all channel ABCs."""

@abc.abstractmethod
def start(self):
pass

@abc.abstractmethod
def stop(self):
pass

@abc.abstractmethod
def is_alive(self):
pass


class ShellChannelABC(ChannelABC):
"""ShellChannel ABC.
The docstrings for this class can be found in the base implementation:
`IPython.kernel.kernelmanager.ShellChannel`
"""

@abc.abstractproperty
def allow_stdin(self):
pass

@abc.abstractmethod
def execute(self, code, silent=False, store_history=True,
user_variables=None, user_expressions=None, allow_stdin=None):
pass

@abc.abstractmethod
def complete(self, text, line, cursor_pos, block=None):
pass

@abc.abstractmethod
def object_info(self, oname, detail_level=0):
pass

@abc.abstractmethod
def history(self, raw=True, output=False, hist_access_type='range', **kwargs):
pass

@abc.abstractmethod
def kernel_info(self):
pass

@abc.abstractmethod
def shutdown(self, restart=False):
pass


class IOPubChannelABC(ChannelABC):
"""IOPubChannel ABC.
The docstrings for this class can be found in the base implementation:
`IPython.kernel.kernelmanager.IOPubChannel`
"""

@abc.abstractmethod
def flush(self, timeout=1.0):
pass


class StdInChannelABC(ChannelABC):
"""StdInChannel ABC.
The docstrings for this class can be found in the base implementation:
`IPython.kernel.kernelmanager.StdInChannel`
"""

@abc.abstractmethod
def input(self, string):
pass


class HBChannelABC(ChannelABC):
"""HBChannel ABC.
The docstrings for this class can be found in the base implementation:
`IPython.kernel.kernelmanager.HBChannel`
"""

@abc.abstractproperty
def time_to_dead(self):
pass

@abc.abstractmethod
def pause(self):
pass

@abc.abstractmethod
def unpause(self):
pass

@abc.abstractmethod
def is_beating(self):
pass


#-----------------------------------------------------------------------------
# Main kernel manager class
#-----------------------------------------------------------------------------

class KernelManagerABC(with_metaclass(abc.ABCMeta, object)):
"""KernelManager ABC.
Expand Down

0 comments on commit bf59bef

Please sign in to comment.