Skip to content

Commit

Permalink
Merge branch 'group_config_calls' into spyder_kernels_server
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Peter committed Sep 18, 2023
2 parents c41460d + c3fb452 commit d4efe98
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 12 deletions.
18 changes: 12 additions & 6 deletions external-deps/spyder-kernels/spyder_kernels/console/kernel.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions external-deps/spyder-kernels/spyder_kernels/console/start.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions spyder/config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
'greedy_completer': False,
'jedi_completer': False,
'autocall': 0,
'autoreload': False,
'symbolic_math': False,
'in_prompt': '',
'out_prompt': '',
Expand Down
22 changes: 21 additions & 1 deletion spyder/plugins/ipythonconsole/confpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,26 @@ def setup_page(self):
autocall_layout.addWidget(autocall_label)
autocall_layout.addWidget(autocall_box)
autocall_group.setLayout(autocall_layout)

# Autoreload group
autoreload_group = QGroupBox(_("Autoreload"))
autoreload_label = QLabel(_(
"Autoreload reloads modules automatically every time before "
"executing the Python code typed.<br>"
"This is a different mechanism than the UMR.<br>"
"It can be slow on windows because of the NTFS file system."
))
autoreload_label.setWordWrap(True)

autoreload_box = newcb(_("Use autoreload"), "autoreload",
tip=_("This option enables the autoreload kernel "
"extension.<br>Please refer to its documentation "
"to learn how to use it."))

autoreload_layout = QVBoxLayout()
autoreload_layout.addWidget(autoreload_label)
autoreload_layout.addWidget(autoreload_box)
autoreload_group.setLayout(autoreload_layout)

# Sympy group
sympy_group = QGroupBox(_("Symbolic mathematics"))
Expand Down Expand Up @@ -369,7 +389,7 @@ def setup_page(self):
self.tabs.addTab(self.create_tab(
run_lines_group, run_file_group), _("Startup"))
self.tabs.addTab(self.create_tab(
jedi_group, greedy_group, autocall_group,
jedi_group, greedy_group, autocall_group, autoreload_group,
sympy_group, prompts_group,
windows_group), _("Advanced settings"))

Expand Down
5 changes: 3 additions & 2 deletions spyder/plugins/ipythonconsole/widgets/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,9 @@ def send_spyder_kernel_configuration(self):
# Does not work if the external kernel is on windows
self.set_kernel_configuration("wurlitzer", True)

# Enable autoreload_magic
self.set_kernel_configuration("autoreload_magic", True)
if self.get_conf('autoreload'):
# Enable autoreload_magic
self.set_kernel_configuration("autoreload_magic", True)

self.call_kernel(
interrupt=self.is_debugging(),
Expand Down

0 comments on commit d4efe98

Please sign in to comment.