Philipp Hörist pushed to branch master at gajim / gajim


Commits:
0e463d18 by lovetox at 2021-12-28T11:42:13+01:00
EmojiData: Add type annotations

- - - - -
62ba43df by lovetox at 2021-12-28T11:42:48+01:00
Styling: Define name attribute on BaseUri

- - - - -
9e503a29 by lovetox at 2021-12-28T11:44:12+01:00
PlainWidget: Fix type erros

- - - - -


4 changed files:

- gajim/common/styling.py
- gajim/gtk/conversation/plain_widget.py
- gajim/gtk/emoji_data.pyi
- pyrightconfig.json


Changes:

=====================================
gajim/common/styling.py
=====================================
@@ -65,7 +65,7 @@ class StyleObject:
 
 @dataclass
 class BaseUri(StyleObject):
-
+    name: str
     start_byte: int
     end_byte: int
 


=====================================
gajim/gtk/conversation/plain_widget.py
=====================================
@@ -13,7 +13,6 @@
 # along with Gajim. If not, see <http://www.gnu.org/licenses/>.
 
 from typing import Any
-from typing import Dict
 
 import logging
 import os
@@ -27,7 +26,6 @@
 from gajim.common import app
 from gajim.common.const import StyleAttr
 from gajim.common.helpers import open_uri
-from gajim.common.helpers import reduce_chars_newlines
 from gajim.common.helpers import parse_uri
 from gajim.common.structs import URI
 from gajim.common.styling import PlainBlock
@@ -136,7 +134,7 @@ def __init__(self, account: str) -> None:
         self.set_cursor_visible(False)
         self.set_wrap_mode(Gtk.WrapMode.WORD_CHAR)
 
-        self._handlers: Dict[int, MessageTextview] = {}
+        self._handlers: dict[int, MessageTextview] = {}
 
         id_ = self.connect('query-tooltip', self._query_tooltip)
         self._handlers[id_] = self
@@ -221,7 +219,7 @@ def print_text_with_styling(self, block: PlainBlock) -> 
None:
                 else:
                     pixbuf = pixbuf.copy()
                     anchor = buffer_.create_child_anchor(end_iter)
-                    anchor.plaintext = emoji.text
+                    anchor.plaintext = emoji.text  # type: ignore
                     img = Gtk.Image.new_from_pixbuf(pixbuf)
                     img.show()
                     self.add_child_at_anchor(img, anchor)


=====================================
gajim/gtk/emoji_data.pyi
=====================================
@@ -16,6 +16,7 @@ from enum import IntEnum
 from collections import OrderedDict
 
 from gi.repository import GdkPixbuf
+from gi.repository import Gtk
 
 class Emoji(IntEnum):
     ...
@@ -27,10 +28,17 @@ class EmojiData(OrderedDict):
     def get_regex(self) -> str: ...
 
 class EmojiPixbufs(dict):
-    ...
-
-emoji_pixbufs = EmojiPixbufs()
-
+    @property
+    def complete(self) -> bool: ...
+    @complete.setter
+    def complete(self, value: bool) -> None: ...
+    def clear(self) -> None: ...
+    def append_marks(self,
+                     textview: Gtk.TextView,
+                     start: Gtk.TextMark,
+                     end: Gtk.TextMark,
+                     codepoint: str) -> None: ...
+
+emoji_pixbufs: EmojiPixbufs
 emoji_ascii_data: dict[str, str]
-
-emoji_data = EmojiData()
+emoji_data: EmojiData


=====================================
pyrightconfig.json
=====================================
@@ -1,14 +1,4 @@
 {
-    "ignore": [
-        "setup.py",
-        "test",
-        ".gitlab"
-        "data",
-        "flatpak",
-        "mac",
-        "scripts",
-        "win",
-    ],
     "pythonPlatform": "All",
     "pythonVersion": "3.9",
     "typeCheckingMode": "strict",
@@ -31,6 +21,7 @@
         "gajim/gtk/chat_page.py",
         "gajim/gtk/conversation/code_widget.py",
         "gajim/gtk/conversation/jump_to_end_button.py",
+        "gajim/gtk/conversation/plain_widget.py",
         "gajim/gtk/conversation/quote_widget.py",
         "gajim/gtk/conversation/rows/command_output.py",
         "gajim/gtk/conversation/rows/date.py",



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/8e99da675e8ee7b90d80ec5bd9e714344f0c914f...9e503a29e1f82c34bfe5633fc2d03ef128990953

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/8e99da675e8ee7b90d80ec5bd9e714344f0c914f...9e503a29e1f82c34bfe5633fc2d03ef128990953
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to