managerabc.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. """Abstract base class for kernel managers."""
  2. # Copyright (c) Jupyter Development Team.
  3. # Distributed under the terms of the Modified BSD License.
  4. import abc
  5. from ipython_genutils.py3compat import with_metaclass
  6. class KernelManagerABC(with_metaclass(abc.ABCMeta, object)):
  7. """KernelManager ABC.
  8. The docstrings for this class can be found in the base implementation:
  9. `jupyter_client.kernelmanager.KernelManager`
  10. """
  11. @abc.abstractproperty
  12. def kernel(self):
  13. pass
  14. #--------------------------------------------------------------------------
  15. # Kernel management
  16. #--------------------------------------------------------------------------
  17. @abc.abstractmethod
  18. def start_kernel(self, **kw):
  19. pass
  20. @abc.abstractmethod
  21. def shutdown_kernel(self, now=False, restart=False):
  22. pass
  23. @abc.abstractmethod
  24. def restart_kernel(self, now=False, **kw):
  25. pass
  26. @abc.abstractproperty
  27. def has_kernel(self):
  28. pass
  29. @abc.abstractmethod
  30. def interrupt_kernel(self):
  31. pass
  32. @abc.abstractmethod
  33. def signal_kernel(self, signum):
  34. pass
  35. @abc.abstractmethod
  36. def is_alive(self):
  37. pass