Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-curtsies for openSUSE:Factory 
checked in at 2022-10-29 20:17:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-curtsies (Old)
 and      /work/SRC/openSUSE:Factory/.python-curtsies.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-curtsies"

Sat Oct 29 20:17:36 2022 rev:14 rq:1032184 version:0.4.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-curtsies/python-curtsies.changes  
2022-09-12 19:08:23.658560968 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-curtsies.new.2275/python-curtsies.changes    
    2022-10-29 20:18:42.846724500 +0200
@@ -1,0 +2,7 @@
+Thu Oct 27 22:48:11 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com>
+
+- Update to 0.4.1 
+  * Unbreak process suspension with blessed
+  * Remove xforms
+
+-------------------------------------------------------------------

Old:
----
  curtsies-0.4.0.tar.gz

New:
----
  curtsies-0.4.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-curtsies.spec ++++++
--- /var/tmp/diff_new_pack.vWi09n/_old  2022-10-29 20:18:43.326727057 +0200
+++ /var/tmp/diff_new_pack.vWi09n/_new  2022-10-29 20:18:43.334727100 +0200
@@ -20,7 +20,7 @@
 %define         skip_python2 1
 %define         skip_python36 1
 Name:           python-curtsies
-Version:        0.4.0
+Version:        0.4.1
 Release:        0
 Summary:        Curses-like terminal wrapper, with colored strings!
 License:        MIT

++++++ curtsies-0.4.0.tar.gz -> curtsies-0.4.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/curtsies-0.4.0/PKG-INFO new/curtsies-0.4.1/PKG-INFO
--- old/curtsies-0.4.0/PKG-INFO 2022-08-28 22:39:27.821959300 +0200
+++ new/curtsies-0.4.1/PKG-INFO 2022-10-05 23:47:31.333721000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: curtsies
-Version: 0.4.0
+Version: 0.4.1
 Summary: Curses-like terminal wrapper, with colored strings!
 Home-page: https://github.com/bpython/curtsies
 Author: Thomas Ballinger
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/curtsies-0.4.0/curtsies/__init__.py 
new/curtsies-0.4.1/curtsies/__init__.py
--- old/curtsies-0.4.0/curtsies/__init__.py     2022-08-28 22:39:24.000000000 
+0200
+++ new/curtsies-0.4.1/curtsies/__init__.py     2022-10-05 23:47:27.000000000 
+0200
@@ -1,5 +1,5 @@
 """Terminal-formatted strings"""
-__version__ = "0.4.0"
+__version__ = "0.4.1"
 
 from .window import FullscreenWindow, CursorAwareWindow
 from .input import Input
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/curtsies-0.4.0/curtsies/events.py 
new/curtsies-0.4.1/curtsies/events.py
--- old/curtsies-0.4.0/curtsies/events.py       2022-08-28 22:39:24.000000000 
+0200
+++ new/curtsies-0.4.1/curtsies/events.py       2022-10-05 23:47:27.000000000 
+0200
@@ -3,7 +3,7 @@
 import itertools
 import sys
 from enum import Enum, auto
-from typing import Dict, Optional, List, Union
+from typing import Optional, List, Sequence, Union
 
 from .termhelpers import Termmode
 from .curtsieskeys import CURTSIES_NAMES as special_curtsies_names
@@ -12,9 +12,7 @@
 chr_uni = chr
 
 
-CURTSIES_NAMES: Dict[bytes, str] = {}
-control_chars = {chr_byte(i): "<Ctrl-%s>" % chr(i + 0x60) for i in range(0x00, 
0x1B)}
-CURTSIES_NAMES.update(control_chars)
+CURTSIES_NAMES = {chr_byte(i): "<Ctrl-%s>" % chr(i + 0x60) for i in 
range(0x00, 0x1B)}
 for i in range(0x00, 0x80):
     CURTSIES_NAMES[b"\x1b" + chr_byte(i)] = "<Esc+%s>" % chr(i)
 for i in range(0x00, 0x1B):  # Overwrite the control keys with better labels
@@ -164,8 +162,41 @@
         return True
 
 
+def _key_name(seq: bytes, encoding: str, keynames: Keynames) -> str:
+    if keynames == Keynames.CURSES:
+        # may not be here (and still not decodable) curses names incomplete
+        if seq in CURSES_NAMES:
+            return CURSES_NAMES[seq]
+
+        # Otherwise, there's no special curses name for this
+        try:
+            # for normal decodable text or a special curtsies sequence with 
bytes that can be decoded
+            return seq.decode(encoding)
+        except UnicodeDecodeError:
+            # this sequence can't be decoded with this encoding, so we need to 
represent the bytes
+            if len(seq) == 1:
+                return "x%02X" % ord(seq)
+                # TODO figure out a better thing to return here
+            else:
+                raise NotImplementedError(
+                    "are multibyte unnameable sequences possible?"
+                )
+                return "bytes: " + "-".join(
+                    "x%02X" % ord(seq[i : i + 1]) for i in range(len(seq))
+                )
+                # TODO if this isn't possible, return multiple meta keys as a 
paste event if paste events enabled
+    elif keynames == Keynames.CURTSIES:
+        if seq in CURTSIES_NAMES:
+            return CURTSIES_NAMES[seq]
+        # assumes that curtsies names are a subset of curses ones
+        return seq.decode(encoding)
+    else:
+        assert keynames == Keynames.BYTES
+        return seq  # type: ignore
+
+
 def get_key(
-    bytes_: List[bytes],
+    bytes_: Sequence[bytes],
     encoding: str,
     keynames: Keynames = Keynames.CURTSIES,
     full: bool = False,
@@ -208,47 +239,14 @@
     if len(seq) > MAX_KEYPRESS_SIZE:
         raise ValueError("unable to decode bytes %r" % seq)
 
-    def key_name() -> str:
-        if keynames == Keynames.CURSES:
-            # may not be here (and still not decodable) curses names incomplete
-            if seq in CURSES_NAMES:
-                return CURSES_NAMES[seq]
-
-            # Otherwise, there's no special curses name for this
-            try:
-                # for normal decodable text or a special curtsies sequence 
with bytes that can be decoded
-                return seq.decode(encoding)
-            except UnicodeDecodeError:
-                # this sequence can't be decoded with this encoding, so we 
need to represent the bytes
-                if len(seq) == 1:
-                    return "x%02X" % ord(seq)
-                    # TODO figure out a better thing to return here
-                else:
-                    raise NotImplementedError(
-                        "are multibyte unnameable sequences possible?"
-                    )
-                    return "bytes: " + "-".join(
-                        "x%02X" % ord(seq[i : i + 1]) for i in range(len(seq))
-                    )
-                    # TODO if this isn't possible, return multiple meta keys 
as a paste event if paste events enabled
-        elif keynames == Keynames.CURTSIES:
-            if seq in CURTSIES_NAMES:
-                return CURTSIES_NAMES[seq]
-            return seq.decode(
-                encoding
-            )  # assumes that curtsies names are a subset of curses ones
-        else:
-            assert keynames == Keynames.BYTES
-            return seq  # type: ignore
-
     key_known = seq in CURTSIES_NAMES or seq in CURSES_NAMES or decodable(seq, 
encoding)
 
     if full and key_known:
-        return key_name()
+        return _key_name(seq, encoding, keynames)
     elif seq in KEYMAP_PREFIXES or could_be_unfinished_char(seq, encoding):
         return None  # need more input to make up a full keypress
     elif key_known:
-        return key_name()
+        return _key_name(seq, encoding, keynames)
     else:
         # this will raise a unicode error (they're annoying to raise ourselves)
         seq.decode(encoding)
@@ -271,16 +269,14 @@
 
 def could_be_unfinished_utf8(seq: bytes) -> bool:
     # http://en.wikipedia.org/wiki/UTF-8#Description
-
-    # fmt: off
-    if   ord(seq[0:1]) & 0b10000000 == 0b10000000 and len(seq) < 1: return True
-    elif ord(seq[0:1]) & 0b11100000 == 0b11000000 and len(seq) < 2: return True
-    elif ord(seq[0:1]) & 0b11110000 == 0b11100000 and len(seq) < 3: return True
-    elif ord(seq[0:1]) & 0b11111000 == 0b11110000 and len(seq) < 4: return True
-    elif ord(seq[0:1]) & 0b11111100 == 0b11111000 and len(seq) < 5: return True
-    elif ord(seq[0:1]) & 0b11111110 == 0b11111100 and len(seq) < 6: return True
-    else: return False
-    # fmt: on
+    o = ord(seq[0:1])
+    return (
+        (o & 0b11100000 == 0b11000000 and len(seq) < 2)
+        or (o & 0b11110000 == 0b11100000 and len(seq) < 3)
+        or (o & 0b11111000 == 0b11110000 and len(seq) < 4)
+        or (o & 0b11111100 == 0b11111000 and len(seq) < 5)
+        or (o & 0b11111110 == 0b11111100 and len(seq) < 6)
+    )
 
 
 def pp_event(seq: Union[Event, str]) -> Union[str, bytes]:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/curtsies-0.4.0/curtsies/formatstring.py 
new/curtsies-0.4.1/curtsies/formatstring.py
--- old/curtsies-0.4.0/curtsies/formatstring.py 2022-08-28 22:39:24.000000000 
+0200
+++ new/curtsies-0.4.1/curtsies/formatstring.py 2022-10-05 23:47:27.000000000 
+0200
@@ -69,11 +69,6 @@
     "bg": lambda s, v: seq(v) + s + seq(RESET_BG),
 }
 
-# TODO unused, remove this in next major release
-xforms: MutableMapping[str, Union[Callable[[str], str], Callable[[str, int], 
str]]] = {}
-xforms.update(one_arg_xforms)
-xforms.update(two_arg_xforms)
-
 
 class FrozenAttributes(Dict[str, Union[int, bool]]):
     """Immutable dictionary class for format string attributes"""
@@ -147,15 +142,14 @@
         s = self._s
         for k, v in sorted(self._atts.items()):
             # (self.atts sorted for the sake of always acting the same.)
-            if k not in xforms:
+            if k not in one_arg_xforms and k not in two_arg_xforms:
                 # Unsupported SGR code
                 continue
             elif v is False:
                 continue
-            elif v is True:
+            elif k in one_arg_xforms:
                 s = one_arg_xforms[k](s)
             else:
-                # TODO: What's the purpose of this code? It will never be 
executed.
                 s = two_arg_xforms[k](s, v)
         return s
 
@@ -296,8 +290,8 @@
         self._s: Optional[str] = None
         self._width: Optional[int] = None
 
-    @classmethod
-    def from_str(cls, s: str) -> "FmtStr":
+    @staticmethod
+    def from_str(s: str) -> "FmtStr":
         r"""
         Return a FmtStr representing input.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/curtsies-0.4.0/curtsies/window.py 
new/curtsies-0.4.1/curtsies/window.py
--- old/curtsies-0.4.0/curtsies/window.py       2022-08-28 22:39:24.000000000 
+0200
+++ new/curtsies-0.4.1/curtsies/window.py       2022-10-05 23:47:27.000000000 
+0200
@@ -272,9 +272,6 @@
         self._last_cursor_column: Optional[int] = None
         self._last_cursor_row: Optional[int] = None
         self.keep_last_line = keep_last_line
-        self.cbreak = (
-            Cbreak(self.in_stream) if not self._use_blessed else 
self.t.cbreak()
-        )
         self.extra_bytes_callback = extra_bytes_callback
 
         # whether another SIGWINCH is queued up
@@ -284,6 +281,9 @@
         self.in_get_cursor_diff = False
 
     def __enter__(self) -> "CursorAwareWindow":
+        self.cbreak = (
+            Cbreak(self.in_stream) if not self._use_blessed else 
self.t.cbreak()
+        )
         self.cbreak.__enter__()
         self.top_usable_row, _ = self.get_cursor_position()
         self._orig_top_usable_row = self.top_usable_row
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/curtsies-0.4.0/curtsies.egg-info/PKG-INFO 
new/curtsies-0.4.1/curtsies.egg-info/PKG-INFO
--- old/curtsies-0.4.0/curtsies.egg-info/PKG-INFO       2022-08-28 
22:39:27.000000000 +0200
+++ new/curtsies-0.4.1/curtsies.egg-info/PKG-INFO       2022-10-05 
23:47:31.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: curtsies
-Version: 0.4.0
+Version: 0.4.1
 Summary: Curses-like terminal wrapper, with colored strings!
 Home-page: https://github.com/bpython/curtsies
 Author: Thomas Ballinger

Reply via email to