##// END OF EJS Templates
ZMQHistoryManager made to work with testing KernelClient which has no history method
Doug Blank -
Show More
@@ -45,19 +45,21 b' class ZMQHistoryManager(HistoryAccessorBase):'
45 45 Load the history over ZMQ from the kernel. Wraps the history
46 46 messaging with loop to wait to get history results.
47 47 """
48 msg_id = self.client.history(raw=raw, output=output,
49 hist_access_type=hist_access_type,
50 **kwargs)
51 48 history = []
52 while True:
53 try:
54 reply = self.client.get_shell_msg(timeout=1)
55 except Empty:
56 break
57 else:
58 if reply['parent_header'].get('msg_id') == msg_id:
59 history = reply['content'].get('history', [])
49 if hasattr(self.client, "history"):
50 ## In tests, KernelClient may not have a history method
51 msg_id = self.client.history(raw=raw, output=output,
52 hist_access_type=hist_access_type,
53 **kwargs)
54 while True:
55 try:
56 reply = self.client.get_shell_msg(timeout=1)
57 except Empty:
60 58 break
59 else:
60 if reply['parent_header'].get('msg_id') == msg_id:
61 history = reply['content'].get('history', [])
62 break
61 63 return history
62 64
63 65 def get_tail(self, n=10, raw=True, output=False, include_latest=False):
General Comments 0
You need to be logged in to leave comments. Login now