flexablelib-tui 3.5.3__tar.gz → 3.5.4__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 (24) hide show
  1. {flexablelib_tui-3.5.3/flexablelib_tui.egg-info → flexablelib_tui-3.5.4}/PKG-INFO +2 -2
  2. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/flexablelib_tui/__init__.py +1 -1
  3. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/flexablelib_tui/keys.py +21 -3
  4. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4/flexablelib_tui.egg-info}/PKG-INFO +2 -2
  5. flexablelib_tui-3.5.4/flexablelib_tui.egg-info/requires.txt +1 -0
  6. flexablelib_tui-3.5.3/flexablelib_tui.egg-info/requires.txt +0 -1
  7. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/LICENSE +0 -0
  8. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/MANIFEST.in +0 -0
  9. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/README.md +0 -0
  10. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/flexablelib_tui/accessibility.py +0 -0
  11. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/flexablelib_tui/app.py +0 -0
  12. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/flexablelib_tui/capabilities.py +0 -0
  13. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/flexablelib_tui/graphics.py +0 -0
  14. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/flexablelib_tui/keymap.py +0 -0
  15. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/flexablelib_tui/py.typed +0 -0
  16. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/flexablelib_tui/screen.py +0 -0
  17. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/flexablelib_tui/terminal.py +0 -0
  18. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/flexablelib_tui/widgets.py +0 -0
  19. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/flexablelib_tui/wincon.py +0 -0
  20. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/flexablelib_tui.egg-info/SOURCES.txt +0 -0
  21. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/flexablelib_tui.egg-info/dependency_links.txt +0 -0
  22. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/flexablelib_tui.egg-info/top_level.txt +0 -0
  23. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/setup.cfg +0 -0
  24. {flexablelib_tui-3.5.3 → flexablelib_tui-3.5.4}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flexablelib-tui
3
- Version: 3.5.3
3
+ Version: 3.5.4
4
4
  Summary: Terminal interfaces for flexablelib: widgets, full-screen layout, diff redraw, keyboard input, focus and key bindings.
5
5
  Home-page: https://github.com/Opus-Perpetuus/flexablelib
6
6
  Author: Benjamin Ramirez
@@ -17,7 +17,7 @@ Classifier: Topic :: Software Development :: User Interfaces
17
17
  Requires-Python: >=3.8
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
- Requires-Dist: flexablelib>=3.5.3
20
+ Requires-Dist: flexablelib>=3.5.4
21
21
  Dynamic: author
22
22
  Dynamic: author-email
23
23
  Dynamic: classifier
@@ -12,7 +12,7 @@ Everything here is also reachable as ``flexablelib.ProgressBar``,
12
12
  ``flexablelib.App`` and so on once installed.
13
13
  """
14
14
 
15
- __version__ = '3.5.3'
15
+ __version__ = '3.5.4'
16
16
 
17
17
  from .widgets import (ProgressBar, Sparkline, BarChart, StatusBar, KeyHints,
18
18
  LogView, Text, Rule)
@@ -95,6 +95,11 @@ class Key(str):
95
95
  return Key(name, self.char, self.mouse, self.event, self.data,
96
96
  self.raw)
97
97
 
98
+ def __reduce__(self):
99
+ # copy, deepcopy and pickle keep char, mouse, event, data and raw.
100
+ return (Key, (str(self), self.char, self.mouse, self.event,
101
+ self.data, self.raw))
102
+
98
103
  def __repr__(self):
99
104
  return 'Key({0!r})'.format(str(self))
100
105
 
@@ -128,6 +133,10 @@ class MouseEvent(tuple):
128
133
  return MouseEvent(self[0], self[1] - dx, self[2] - dy, self[3],
129
134
  self.action, self.mods)
130
135
 
136
+ def __reduce__(self):
137
+ return (MouseEvent, (self[0], self[1], self[2], self[3], self.action,
138
+ self.mods))
139
+
131
140
  def __repr__(self):
132
141
  return 'MouseEvent({0}, {1}, {2}, {3}, {4!r})'.format(
133
142
  self[0], self[1], self[2], self[3], self.action)
@@ -354,7 +363,7 @@ def _char_key(code, mods, shifted=None, text=None):
354
363
  ch = chr(code)
355
364
  except (ValueError, OverflowError):
356
365
  return None
357
- if 'shift' in mods and shifted:
366
+ if 'shift' in mods and shifted and shifted < 0x110000:
358
367
  ch = chr(shifted)
359
368
  mods.remove('shift')
360
369
  if code < 32:
@@ -532,10 +541,18 @@ class KeyParser(object):
532
541
  if nxt == ESC:
533
542
  # ESC + a sequence is that key with Alt (meta sends escape);
534
543
  # otherwise an Escape press followed by whatever comes next.
535
- if i + 2 < n and buf[i + 2] in '[O':
544
+ if i + 2 >= n:
545
+ return 0, None # which one is decided by more input
546
+ if buf[i + 2] in '[O':
547
+ in_paste = self._paste is not None
536
548
  consumed, key = self._escape(buf, i + 1)
537
549
  if consumed == 0:
538
550
  return 0, None
551
+ if self._paste is not None and not in_paste:
552
+ # Escape, then a bracketed paste: the paste starts at
553
+ # the second ESC, parsed again on the next step.
554
+ self._paste = None
555
+ return 1, Key('escape')
539
556
  if (key is not None and str(key) not in
540
557
  ('paste', 'response', 'focusin', 'focusout')
541
558
  and key.mouse is None and self._paste is None):
@@ -686,7 +703,8 @@ class KeyParser(object):
686
703
  mods = _mods(_first(fields, 1, 1), kitty=True)
687
704
  text = None
688
705
  if len(fields) > 2:
689
- text = ''.join(chr(c) for c in fields[2] if c)
706
+ text = ''.join(chr(c) for c in fields[2]
707
+ if c and c < 0x110000) or None
690
708
  key = _char_key(code, mods, shifted, text)
691
709
  if key is None:
692
710
  return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flexablelib-tui
3
- Version: 3.5.3
3
+ Version: 3.5.4
4
4
  Summary: Terminal interfaces for flexablelib: widgets, full-screen layout, diff redraw, keyboard input, focus and key bindings.
5
5
  Home-page: https://github.com/Opus-Perpetuus/flexablelib
6
6
  Author: Benjamin Ramirez
@@ -17,7 +17,7 @@ Classifier: Topic :: Software Development :: User Interfaces
17
17
  Requires-Python: >=3.8
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
- Requires-Dist: flexablelib>=3.5.3
20
+ Requires-Dist: flexablelib>=3.5.4
21
21
  Dynamic: author
22
22
  Dynamic: author-email
23
23
  Dynamic: classifier
@@ -0,0 +1 @@
1
+ flexablelib>=3.5.4
@@ -1 +0,0 @@
1
- flexablelib>=3.5.3
File without changes