chemql-python 1.5.7__tar.gz → 1.5.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. {chemql_python-1.5.7 → chemql_python-1.5.8}/PKG-INFO +2 -2
  2. {chemql_python-1.5.7 → chemql_python-1.5.8}/README.md +1 -1
  3. {chemql_python-1.5.7 → chemql_python-1.5.8}/pyproject.toml +1 -1
  4. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/__init__.py +1 -1
  5. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/codecql.py +16 -6
  6. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql_python.egg-info/PKG-INFO +2 -2
  7. {chemql_python-1.5.7 → chemql_python-1.5.8}/LICENSE +0 -0
  8. {chemql_python-1.5.7 → chemql_python-1.5.8}/setup.cfg +0 -0
  9. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/__main__.py +0 -0
  10. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/colors.json +0 -0
  11. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/data/BondEnergies.json +0 -0
  12. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/data/MoleculeBonds.json +0 -0
  13. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/data/Molecules.json +0 -0
  14. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/data/PeriodicTableJSON.json +0 -0
  15. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/data/Reactions.json +0 -0
  16. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/data/THIRD_PARTY_LICENSES/PeriodicTableJSON.txt +0 -0
  17. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/data/THIRD_PARTY_LICENSES/RHEA.txt +0 -0
  18. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/html/periodic_table.html +0 -0
  19. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/stdlib/README.md +0 -0
  20. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/stdlib/collections.cql +0 -0
  21. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/stdlib/datetime.cql +0 -0
  22. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/stdlib/decimal.cql +0 -0
  23. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/stdlib/fractions.cql +0 -0
  24. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/stdlib/json.cql +0 -0
  25. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/stdlib/math/statistics.cql +0 -0
  26. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/stdlib/math.cql +0 -0
  27. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/stdlib/pathlib.cql +0 -0
  28. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/stdlib/random.cql +0 -0
  29. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql/stdlib/text.cql +0 -0
  30. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql_python.egg-info/SOURCES.txt +0 -0
  31. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql_python.egg-info/dependency_links.txt +0 -0
  32. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql_python.egg-info/entry_points.txt +0 -0
  33. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql_python.egg-info/requires.txt +0 -0
  34. {chemql_python-1.5.7 → chemql_python-1.5.8}/src/chemql_python.egg-info/top_level.txt +0 -0
  35. {chemql_python-1.5.7 → chemql_python-1.5.8}/tests/test_codecql.py +0 -0
  36. {chemql_python-1.5.7 → chemql_python-1.5.8}/tests/test_external_molecule_lookup.py +0 -0
  37. {chemql_python-1.5.7 → chemql_python-1.5.8}/tests/test_public_api.py +0 -0
  38. {chemql_python-1.5.7 → chemql_python-1.5.8}/tests/test_reactions.py +0 -0
  39. {chemql_python-1.5.7 → chemql_python-1.5.8}/tests/test_stdlib.py +0 -0
  40. {chemql_python-1.5.7 → chemql_python-1.5.8}/tests/test_structured_types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chemql-python
3
- Version: 1.5.7
3
+ Version: 1.5.8
4
4
  Summary: A chemistry-focused query language and REPL
5
5
  Author-email: Mohammad Rakibul Islam <rakibulofficial1017@gmail.com>
6
6
  Requires-Python: >=3.10
@@ -19,7 +19,7 @@ SQL-inspired syntax, inspect elements and molecules, look up reactions,
19
19
  balance equations, and combine chemistry queries with Python and shell
20
20
  commands.
21
21
 
22
- - **Version:** `1.5.7`
22
+ - **Version:** `1.5.8`
23
23
  - **PyPI distribution:** `chemql-python`
24
24
  - **Python import / CLI name:** `chemql`
25
25
  - **Author:** Mohammad Rakibul Islam
@@ -6,7 +6,7 @@ SQL-inspired syntax, inspect elements and molecules, look up reactions,
6
6
  balance equations, and combine chemistry queries with Python and shell
7
7
  commands.
8
8
 
9
- - **Version:** `1.5.7`
9
+ - **Version:** `1.5.8`
10
10
  - **PyPI distribution:** `chemql-python`
11
11
  - **Python import / CLI name:** `chemql`
12
12
  - **Author:** Mohammad Rakibul Islam
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "chemql-python"
7
- version = "1.5.7"
7
+ version = "1.5.8"
8
8
  authors = [
9
9
  { name = "Mohammad Rakibul Islam", email = "rakibulofficial1017@gmail.com" }
10
10
  ]
@@ -64,7 +64,7 @@ __all__ = [
64
64
  "__version__"
65
65
  ]
66
66
 
67
- __version__ = "1.5.7"
67
+ __version__ = "1.5.8"
68
68
 
69
69
  # Persistent preprocessor/function state for the current ChemQL session.
70
70
  DEFINITIONS = {}
@@ -10,7 +10,7 @@ import shutil
10
10
  import subprocess
11
11
  import time
12
12
 
13
- VERSION = "0.0.7"
13
+ VERSION = "0.0.8"
14
14
 
15
15
 
16
16
  def _write_system_clipboard(text):
@@ -79,7 +79,8 @@ def _decode_escape_sequence(sequence):
79
79
  else:
80
80
  return "\x1b"
81
81
  return "+".join((*modifiers, key)) if modifiers else key
82
- if final == b"u" and params and params[0] == "127":
82
+ if final == b"u" and params and params[0] in {"8", "127"}:
83
+ # CSI-u / Kitty keyboard protocol can encode Backspace as 8 or 127.
83
84
  key = "backspace"
84
85
  return "+".join((*modifiers, key)) if modifiers else key
85
86
  elif sequence.startswith(b"O") and sequence[-1:] in b"ABCDHF":
@@ -181,8 +182,16 @@ else:
181
182
  return _decode_escape_sequence(sequence)
182
183
  if sequence.startswith(b"O"):
183
184
  return _decode_escape_sequence(sequence)
185
+ if sequence in (b"\x7f", b"\x08"):
186
+ return "alt+backspace"
184
187
  if sequence:
185
- return "alt+" + sequence.decode("utf-8", errors="replace")
188
+ # ESC + one printable character is commonly Alt+<key>.
189
+ # Never insert an unknown multi-character escape sequence.
190
+ if len(sequence) == 1:
191
+ char = sequence.decode("utf-8", errors="replace")
192
+ if char.isprintable():
193
+ return "alt+" + char
194
+ return "\x1b"
186
195
  return "\x1b"
187
196
  if not first:
188
197
  return ""
@@ -598,7 +607,7 @@ class Editor:
598
607
  self._scroll_view(-1 if base_key == "arrow_up" else 1)
599
608
  else:
600
609
  self._move_cursor(base_key, shift=shift, wordwise=wordwise)
601
- elif key in ("\x08", "ctrl+backspace"):
610
+ elif key in ("\x08", "ctrl+backspace", "alt+backspace"):
602
611
  if os.name == "nt":
603
612
  if not self._delete_selection(): # For some reason on windows it is the opposit
604
613
  self._backspace() # I have no idea why just stick to it
@@ -610,7 +619,7 @@ class Editor:
610
619
  else:
611
620
  if not self._delete_selection():
612
621
  self._backspace()
613
- elif key in ("ctrl+delete",):
622
+ elif key in ("ctrl+delete", "alt+delete"):
614
623
  self._delete_word("right")
615
624
  elif key in ("delete", "\x1b[3~"):
616
625
  if not self._delete_selection():
@@ -619,7 +628,8 @@ class Editor:
619
628
  self._insert_newline()
620
629
  elif key == "\t":
621
630
  self._insert_text("\t")
622
- elif key and key.isprintable():
631
+ elif key and key.isprintable() and "+" not in key:
632
+ # Symbolic key names (e.g. "alt+delete") are control events, not text.
623
633
  self._insert_text(key)
624
634
  if key not in ("\x11",):
625
635
  self.quit_requested = False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chemql-python
3
- Version: 1.5.7
3
+ Version: 1.5.8
4
4
  Summary: A chemistry-focused query language and REPL
5
5
  Author-email: Mohammad Rakibul Islam <rakibulofficial1017@gmail.com>
6
6
  Requires-Python: >=3.10
@@ -19,7 +19,7 @@ SQL-inspired syntax, inspect elements and molecules, look up reactions,
19
19
  balance equations, and combine chemistry queries with Python and shell
20
20
  commands.
21
21
 
22
- - **Version:** `1.5.7`
22
+ - **Version:** `1.5.8`
23
23
  - **PyPI distribution:** `chemql-python`
24
24
  - **Python import / CLI name:** `chemql`
25
25
  - **Author:** Mohammad Rakibul Islam
File without changes
File without changes