From 1a4ef9752a39ac3ede98d2c4e08f715746e8b17a Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Tue, 22 May 2018 11:34:06 +0100 Subject: [PATCH] Changed history name --- spyder/app/mainwindow.py | 2 +- spyder/app/tests/test_mainwindow.py | 2 +- spyder/plugins/ipythonconsole.py | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py index 5a6d59149da..2a19bccb753 100644 --- a/spyder/app/mainwindow.py +++ b/spyder/app/mainwindow.py @@ -1262,7 +1262,7 @@ def post_visible_setup(self): # Show history file if no console is visible if not self.ipyconsole.isvisible: self.historylog.add_history( - "iPython history", + self.ipyconsole.history_title, self.ipyconsole.get_current_shellwidget()._history) if self.open_project: diff --git a/spyder/app/tests/test_mainwindow.py b/spyder/app/tests/test_mainwindow.py index e39a2d7e21a..ada15a12602 100644 --- a/spyder/app/tests/test_mainwindow.py +++ b/spyder/app/tests/test_mainwindow.py @@ -1600,7 +1600,7 @@ def test_history(main_window, qtbot): commands_text = ''.join(commands) - index = main_window.historylog.filenames.index("iPython history") + index = main_window.historylog.filenames.index(main_window.ipyconsole.history_title) assert index == 0 text = main_window.historylog.editors[index].toPlainText()[-len(commands_text):] history = main_window.historylog.histories[index][-len(clients):] diff --git a/spyder/plugins/ipythonconsole.py b/spyder/plugins/ipythonconsole.py index 9c53b2e2511..10fd0166b6e 100644 --- a/spyder/plugins/ipythonconsole.py +++ b/spyder/plugins/ipythonconsole.py @@ -648,6 +648,7 @@ def __init__(self, parent, testing=False, test_dir=TEMPDIR, self.tabwidget = None self.menu_actions = None + self.history_title = "History" self.help = None # Help plugin self.historylog = None # History log plugin @@ -1310,16 +1311,16 @@ def register_client(self, client, give_focus=True): # Connect client to our history log if self.historylog is not None: self.historylog.add_history( - "iPython history", + self.history_title, shellwidget.history_tail( self.historylog.get_option('max_entries'))) # To save history shellwidget.sig_new_history.connect( lambda history: self.historylog.set_history( - "iPython history", history)) + self.history_title, history)) shellwidget.executing.connect( lambda command: self.historylog.append_to_history( - "iPython history", command)) + self.history_title, command)) # Set font for client