##// END OF EJS Templates
Add history_tail method to ConsoleWidget for retreiving the local history.
epatters -
Show More
@@ -88,9 +88,9 b' class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin):'
88 custom_restart = Bool(False)
88 custom_restart = Bool(False)
89 custom_restart_kernel_died = QtCore.Signal(float)
89 custom_restart_kernel_died = QtCore.Signal(float)
90 custom_restart_requested = QtCore.Signal()
90 custom_restart_requested = QtCore.Signal()
91
91
92 # Emitted when an 'execute_reply' has been received from the kernel and
92 # Emitted when a user-visible 'execute_reply' has been received from the
93 # processed by the FrontendWidget.
93 # kernel and processed by the FrontendWidget. Contains the response message.
94 executed = QtCore.Signal(object)
94 executed = QtCore.Signal(object)
95
95
96 # Emitted when an exit request has been received from the kernel.
96 # Emitted when an exit request has been received from the kernel.
@@ -152,6 +152,16 b' class HistoryConsoleWidget(ConsoleWidget):'
152 history = prefix
152 history = prefix
153 self.input_buffer = history
153 self.input_buffer = history
154
154
155 def history_tail(self, n=10):
156 """ Get the local history list.
157
158 Parameters
159 ----------
160 n : int
161 The (maximum) number of history items to get.
162 """
163 return self._history[-n:]
164
155 #---------------------------------------------------------------------------
165 #---------------------------------------------------------------------------
156 # 'HistoryConsoleWidget' protected interface
166 # 'HistoryConsoleWidget' protected interface
157 #---------------------------------------------------------------------------
167 #---------------------------------------------------------------------------
General Comments 0
You need to be logged in to leave comments. Login now