Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/jupyter_client/clientabc.py: 68%

44 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-07-01 06:54 +0000

1"""Abstract base class for kernel clients""" 

2# ----------------------------------------------------------------------------- 

3# Copyright (c) The Jupyter Development Team 

4# 

5# Distributed under the terms of the BSD License. The full license is in 

6# the file COPYING, distributed as part of this software. 

7# ----------------------------------------------------------------------------- 

8# ----------------------------------------------------------------------------- 

9# Imports 

10# ----------------------------------------------------------------------------- 

11import abc 

12 

13# ----------------------------------------------------------------------------- 

14# Main kernel client class 

15# ----------------------------------------------------------------------------- 

16 

17 

18class KernelClientABC(metaclass=abc.ABCMeta): 

19 """KernelManager ABC. 

20 

21 The docstrings for this class can be found in the base implementation: 

22 

23 `jupyter_client.client.KernelClient` 

24 """ 

25 

26 @abc.abstractproperty 

27 def kernel(self): 

28 pass 

29 

30 @abc.abstractproperty 

31 def shell_channel_class(self): 

32 pass 

33 

34 @abc.abstractproperty 

35 def iopub_channel_class(self): 

36 pass 

37 

38 @abc.abstractproperty 

39 def hb_channel_class(self): 

40 pass 

41 

42 @abc.abstractproperty 

43 def stdin_channel_class(self): 

44 pass 

45 

46 @abc.abstractproperty 

47 def control_channel_class(self): 

48 pass 

49 

50 # -------------------------------------------------------------------------- 

51 # Channel management methods 

52 # -------------------------------------------------------------------------- 

53 

54 @abc.abstractmethod 

55 def start_channels(self, shell=True, iopub=True, stdin=True, hb=True, control=True): 

56 """Start the channels for the client.""" 

57 pass 

58 

59 @abc.abstractmethod 

60 def stop_channels(self): 

61 """Stop the channels for the client.""" 

62 pass 

63 

64 @abc.abstractproperty 

65 def channels_running(self): 

66 """Get whether the channels are running.""" 

67 pass 

68 

69 @abc.abstractproperty 

70 def shell_channel(self): 

71 pass 

72 

73 @abc.abstractproperty 

74 def iopub_channel(self): 

75 pass 

76 

77 @abc.abstractproperty 

78 def stdin_channel(self): 

79 pass 

80 

81 @abc.abstractproperty 

82 def hb_channel(self): 

83 pass 

84 

85 @abc.abstractproperty 

86 def control_channel(self): 

87 pass