Skip to content

Commit

Permalink
PR: Improve Variable Explorer UX (#20868)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Althviz Moré <d.althviz10@uniandes.edu.co>
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
  • Loading branch information
3 people committed Jul 14, 2023
1 parent 6efaff3 commit cf35639
Show file tree
Hide file tree
Showing 11 changed files with 161 additions and 43 deletions.
4 changes: 2 additions & 2 deletions external-deps/spyder-kernels/.gitrepo

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

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

10 changes: 6 additions & 4 deletions external-deps/spyder-kernels/spyder_kernels/utils/nsview.py

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

3 changes: 2 additions & 1 deletion spyder/config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@
'truncate': True,
'minmax': False,
'show_callable_attributes': True,
'show_special_attributes': False
'show_special_attributes': False,
'filter_on': True
}),
('debugger',
{
Expand Down
3 changes: 2 additions & 1 deletion spyder/plugins/ipythonconsole/comms/tests/test_comms.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def kernel(request):
'False_',
'True_'
],
'minmax': False}
'minmax': False,
'filter_on': True}

# Teardown
def reset_kernel():
Expand Down
3 changes: 2 additions & 1 deletion spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -1832,7 +1832,8 @@ def test_pdb_comprehension_namespace(ipyconsole, qtbot, tmpdir):
'excluded_names': [],
'minmax': False,
'show_callable_attributes': True,
'show_special_attributes': False}
'show_special_attributes': False,
'filter_on': True}

shell.call_kernel(
interrupt=True
Expand Down
11 changes: 6 additions & 5 deletions spyder/plugins/maininterpreter/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,12 @@ def set_custom_interpreter(self, interpreter):
def _open_interpreter_preferences(self):
"""Open the Preferences dialog in the main interpreter section."""
self._main.show_preferences()
preferences = self._main.preferences
container = preferences.get_container()
dlg = container.dialog
index = dlg.get_index_by_name("main_interpreter")
dlg.set_current_index(index)
preferences = self.get_plugin(Plugins.Preferences)
if preferences:
container = preferences.get_container()
dlg = container.dialog
index = dlg.get_index_by_name("main_interpreter")
dlg.set_current_index(index)

@Slot(str)
def _add_to_custom_interpreters(self, interpreter):
Expand Down
13 changes: 9 additions & 4 deletions spyder/plugins/variableexplorer/confpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@
from spyder.config.base import _
from spyder.api.preferences import PluginConfigPage


class VariableExplorerConfigPage(PluginConfigPage):

def setup_page(self):
filter_group = QGroupBox(_("Filter"))
filter_data = [
('exclude_private', _("Exclude private references")),
('exclude_capitalized', _("Exclude capitalized references")),
('exclude_uppercase', _("Exclude all-uppercase references")),
('exclude_unsupported', _("Exclude unsupported data types")),
('exclude_private',
_("Exclude private references")),
('exclude_capitalized',
_("Exclude capitalized references")),
('exclude_uppercase',
_("Exclude all-uppercase references")),
('exclude_unsupported',
_("Exclude unsupported data types")),
('exclude_callables_and_modules',
_("Exclude callables and modules"))
]
Expand Down
17 changes: 16 additions & 1 deletion spyder/plugins/variableexplorer/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ def get_icon(self):
return self.create_icon('dictedit')

def on_initialize(self):
pass
widget = self.get_widget()
widget.sig_open_preferences_requested.connect(
self._open_preferences
)

@on_plugin_available(plugin=Plugins.Preferences)
def on_preferences_available(self):
Expand All @@ -58,3 +61,15 @@ def on_preferences_available(self):
def on_preferences_teardown(self):
preferences = self.get_plugin(Plugins.Preferences)
preferences.deregister_plugin_preferences(self)

# ---- Private API
# -------------------------------------------------------------------------
def _open_preferences(self):
"""Open the Preferences dialog in the Variable Explorer section."""
self._main.show_preferences()
preferences = self.get_plugin(Plugins.Preferences)
if preferences:
container = preferences.get_container()
dlg = container.dialog
index = dlg.get_index_by_name(self.NAME)
dlg.set_current_index(index)
Loading

0 comments on commit cf35639

Please sign in to comment.