Skip to content

Commit

Permalink
Preferences: Sort plugins in Plugins page for non-English languages
Browse files Browse the repository at this point in the history
We need to use the Pyuca package for that, so I added it as a new
dependency.
  • Loading branch information
ccordoba12 committed Jul 24, 2023
1 parent 5dcb6b9 commit 77ff71b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies:
- pyqtwebengine <5.16
- python-lsp-black >=1.2.0,<3.0.0
- python-lsp-server >=1.7.4,<1.8.0
- pyuca >=1.2
- pyxdg >=0.26
- pyzmq >=22.1.0
- qdarkstyle >=3.0.2,<3.2.0
Expand Down
1 change: 1 addition & 0 deletions requirements/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dependencies:
- pyqtwebengine <5.16
- python-lsp-black >=1.2.0,<3.0.0
- python-lsp-server >=1.7.4,<1.8.0
- pyuca >=1.2
- pyzmq >=22.1.0
- qdarkstyle >=3.0.2,<3.2.0
- qstylizer >=0.2.2
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,12 @@ def run(self):
'pygments>=2.0',
'pylint>=2.5.0,<3.0',
'pylint-venv>=3.0.2',
'python-lsp-black>=1.2.0,<3.0.0',
'pyls-spyder>=0.4.0',
'pyqt5<5.16',
'pyqtwebengine<5.16',
'python-lsp-black>=1.2.0,<3.0.0',
'python-lsp-server[all]>=1.7.4,<1.8.0',
'pyuca>=1.2',
'pyxdg>=0.26;platform_system=="Linux"',
'pyzmq>=22.1.0',
'qdarkstyle>=3.0.2,<3.2.0',
Expand Down
6 changes: 4 additions & 2 deletions spyder/api/plugin_registration/_confpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""Plugin registry configuration page."""

# Third party imports
from pyuca import Collator
from qtpy.QtWidgets import QVBoxLayout, QLabel

# Local imports
Expand Down Expand Up @@ -88,8 +89,9 @@ def setup_page(self):
self.plugins_checkboxes[plugin_name] = (cb, plugin_state)

# Sort elements by title for easy searching
internal_elements.sort(key=lambda e: e['title'])
external_elements.sort(key=lambda e: e['title'])
collator = Collator()
internal_elements.sort(key=lambda e: collator.sort_key(e['title']))
external_elements.sort(key=lambda e: collator.sort_key(e['title']))

# Build plugins table, showing external plugins first.
plugins_table = ElementsTable(
Expand Down
5 changes: 5 additions & 0 deletions spyder/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
PYLSP_REQVER = '>=1.7.4,<1.8.0'
PYLSP_BLACK_REQVER = '>=1.2.0,<3.0.0'
PYLS_SPYDER_REQVER = '>=0.4.0'
PYUCA_REQVER = '>=1.2'
PYXDG_REQVER = '>=0.26'
PYZMQ_REQVER = '>=22.1.0'
QDARKSTYLE_REQVER = '>=3.0.2,<3.2.0'
Expand Down Expand Up @@ -194,6 +195,10 @@
'package_name': 'pyls-spyder',
'features': _('Spyder plugin for the Python LSP Server'),
'required_version': PYLS_SPYDER_REQVER},
{'modname': 'pyuca',
'package_name': 'pyuca',
'features': _('Properly sort lists of non-English strings'),
'required_version': PYUCA_REQVER},
{'modname': "xdg",
'package_name': "pyxdg",
'features': _("Parse desktop files on Linux"),
Expand Down

0 comments on commit 77ff71b

Please sign in to comment.