##// END OF EJS Templates
PR: Unassigned allowed commands (#14564)...
PR: Unassigned allowed commands (#14564) From git git: > Modify binding mechanism to allow binding to one of a set of whitelisted commands, Add five such commands ("beginning_of_buffer", "end_of_buffer", "end_of_line", "forward_word", "unix_line_discard"). Currently, only commands which are assigned by default are allowed to be reassigned: ```python known_commands = { create_identifier(binding.command): binding.command for binding in KEY_BINDINGS } ... if command_id not in known_commands: ... raise ValueError( f"{command_id} is not a known shortcut command." f" Allowed commands are: \n - {allowed_commands}" ) ``` This PR adds a List UNASSIGNED_ALLOWED_COMMANDS and updates `known_commands` (now renamed to be more clear as `allowed_commands`): ```python allowed_commands.update({ create_identifier(command): command for command in UNASSIGNED_ALLOWED_COMMANDS }) ``` The five unassigned allowed commands are: ```python UNASSIGNED_ALLOWED_COMMANDS = [ nc.beginning_of_buffer, nc.end_of_buffer, nc.end_of_line, nc.forward_word, nc.unix_line_discard, ] ``` Motivation tldr: Until now, it is not possible to bind eg the common keybindng `ctrl+e` to prompt_toolkit's `end_of_line` (because it is not bound by default). Full motivation: https://github.com/ipython/ipython/issues/14369

File last commit:

r28856:18934670
r28945:08be4c99 merge
Show More
mypy.yml
38 lines | 810 B | text/x-yaml | YamlLexer
Matthias Bussonnier
run mypy on github action...
r26158 name: Run MyPy
on:
push:
Jarrod Millman
Rename master to main
r27712 branches: [ main, 7.x]
Matthias Bussonnier
run mypy on github action...
r26158 pull_request:
Jarrod Millman
Rename master to main
r27712 branches: [ main, 7.x]
Matthias Bussonnier
run mypy on github action...
r26158
Matthias Bussonnier
SEC: force workflows to be read-only....
r27782 permissions:
contents: read
Matthias Bussonnier
run mypy on github action...
r26158 jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
Matthias Bussonnier
Test on more recent Python versions.
r27973 python-version: ["3.x"]
Matthias Bussonnier
run mypy on github action...
r26158
steps:
Brigitta Sipőcz
CI: update actions version
r28856 - uses: actions/checkout@v4
Matthias Bussonnier
run mypy on github action...
r26158 - name: Set up Python ${{ matrix.python-version }}
Brigitta Sipőcz
CI: update actions version
r28856 uses: actions/setup-python@v5
Matthias Bussonnier
run mypy on github action...
r26158 with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Matthias Bussonnier
MAINT: refactor/please mypy....
r28167 pip install mypy pyflakes flake8 types-decorator
Matthias Bussonnier
run mypy on github action...
r26158 - name: Lint with mypy
run: |
krassowski
Fix mypy job, fix issues detected by mypy
r28011 set -e
Matthias Bussonnier
MAINT: refactor/please mypy....
r28167 mypy IPython
Matthias Bussonnier
pyflakes to avoid missing imports
r26208 - name: Lint with pyflakes
run: |
krassowski
Fix mypy job, fix issues detected by mypy
r28011 set -e
Matthias Bussonnier
pyflakes to avoid missing imports
r26208 flake8 IPython/core/magics/script.py
Matthias Bussonnier
update
r26485 flake8 IPython/core/magics/packaging.py