1
1
""" ZMQ Kernel History accessor and manager. """
2
- #-----------------------------------------------------------------------------
2
+ # -----------------------------------------------------------------------------
3
3
# Copyright (C) 2010-2011 The IPython Development Team.
4
4
#
5
5
# Distributed under the terms of the BSD License.
6
6
#
7
- # The full license is in the file COPYING.txt , distributed with this software.
8
- #-----------------------------------------------------------------------------
7
+ # The full license is in the file LICENSE , distributed with this software.
8
+ # -----------------------------------------------------------------------------
9
9
10
- #-----------------------------------------------------------------------------
10
+ # -----------------------------------------------------------------------------
11
11
# Imports
12
- #-----------------------------------------------------------------------------
12
+ # -----------------------------------------------------------------------------
13
13
14
14
from IPython .core .history import HistoryAccessorBase
15
15
from traitlets import Dict , List
16
16
17
17
from queue import Empty # Py 3
18
18
19
+
19
20
class ZMQHistoryManager (HistoryAccessorBase ):
20
21
"""History accessor and manager for ZMQ-based kernels"""
21
22
input_hist_parsed = List (["" ])
@@ -44,7 +45,7 @@ def _load_history(self, raw=True, output=False, hist_access_type='range',
44
45
"""
45
46
history = []
46
47
if hasattr (self .client , "history" ):
47
- ## In tests, KernelClient may not have a history method
48
+ # In tests, KernelClient may not have a history method
48
49
msg_id = self .client .history (raw = raw , output = output ,
49
50
hist_access_type = hist_access_type ,
50
51
** kwargs )
@@ -69,7 +70,7 @@ def search(self, pattern="*", raw=True, search_raw=True,
69
70
raw = raw , search_raw = search_raw ,
70
71
output = output , n = n , unique = unique )
71
72
72
- def get_range (self , session , start = 1 , stop = None , raw = True ,output = False ):
73
+ def get_range (self , session , start = 1 , stop = None , raw = True , output = False ):
73
74
return self ._load_history (hist_access_type = 'range' , raw = raw ,
74
75
output = output , start = start , stop = stop ,
75
76
session = session )
@@ -89,4 +90,3 @@ def reset(self, new_session=True):
89
90
Nothing to do for ZMQ-based histories.
90
91
"""
91
92
pass
92
-
0 commit comments