mirror of https://github.com/dbcli/pgcli
For Python >= 3.11 directly use packaging to compare package versions (#1416)
* For Python >= 3.11 directly use packaging to compare package versions * Improve prompt-toolkit check to test for feature explicitly
This commit is contained in:
parent
69dcceb5f6
commit
ed89c154ee
1
AUTHORS
1
AUTHORS
|
@ -127,6 +127,7 @@ Contributors:
|
|||
* Anna Glasgall (annathyst)
|
||||
* Andy Schoenberger (andyscho)
|
||||
* Damien Baty (dbaty)
|
||||
* blag
|
||||
|
||||
Creator:
|
||||
--------
|
||||
|
|
|
@ -24,6 +24,7 @@ Bug fixes:
|
|||
* Fix 'invalid connection option "dsn"' ([issue 1373](https://github.com/dbcli/pgcli/issues/1373)).
|
||||
* Fix explain mode when used with `expand`, `auto_expand`, or `--explain-vertical-output` ([issue 1393](https://github.com/dbcli/pgcli/issues/1393)).
|
||||
* Fix sql-insert format emits NULL as 'None' ([issue 1408](https://github.com/dbcli/pgcli/issues/1408)).
|
||||
* Improve check for prompt-toolkit 3.0.6 ([issue 1416](https://github.com/dbcli/pgcli/issues/1416)).
|
||||
|
||||
3.5.0 (2022/09/15):
|
||||
===================
|
||||
|
|
|
@ -1,18 +1,14 @@
|
|||
from pkg_resources import packaging
|
||||
|
||||
import prompt_toolkit
|
||||
from prompt_toolkit.key_binding.vi_state import InputMode
|
||||
from prompt_toolkit.application import get_app
|
||||
|
||||
parse_version = packaging.version.parse
|
||||
|
||||
vi_modes = {
|
||||
InputMode.INSERT: "I",
|
||||
InputMode.NAVIGATION: "N",
|
||||
InputMode.REPLACE: "R",
|
||||
InputMode.INSERT_MULTIPLE: "M",
|
||||
}
|
||||
if parse_version(prompt_toolkit.__version__) >= parse_version("3.0.6"):
|
||||
# REPLACE_SINGLE is available in prompt_toolkit >= 3.0.6
|
||||
if "REPLACE_SINGLE" in {e.name for e in InputMode}:
|
||||
vi_modes[InputMode.REPLACE_SINGLE] = "R"
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue