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

Commits:

4 changed files:

Changes:

  • .ci/make_release.py
    ... ... @@ -44,7 +44,6 @@ def create_release(project: Project, version: str) -> None:
    44 44
         parser.add_argument('token', type=str, help='The API token')
    
    45 45
         args = parser.parse_args()
    
    46 46
     
    
    47
    -
    
    48 47
         api = Gitlab(GITLAB_INSTANCE_URL, private_token=args.token)
    
    49 48
         api.auth()
    
    50 49
         project = api.projects.get(PROJECT_ID)
    

  • gajim/gtk/avatar.py
    ... ... @@ -106,7 +106,7 @@ def generate_avatar(letters: str,
    106 106
         context.set_operator(cairo.Operator.OVER)
    
    107 107
         PangoCairo.show_layout(context, layout)
    
    108 108
     
    
    109
    -    return context.get_target()  # pyright: ignore
    
    109
    +    return context.get_target()
    
    110 110
     
    
    111 111
     
    
    112 112
     @lru_cache(maxsize=None)
    
    ... ... @@ -183,7 +183,7 @@ def add_status_to_avatar(surface: cairo.ImageSurface,
    183 183
             context.set_line_width(clip_radius / 4)
    
    184 184
             context.stroke()
    
    185 185
     
    
    186
    -    return context.get_target()  # pyright: ignore
    
    186
    +    return context.get_target()
    
    187 187
     
    
    188 188
     
    
    189 189
     @lru_cache(maxsize=128)
    
    ... ... @@ -220,7 +220,7 @@ def get_show_circle(show: Union[str, types.PresenceShowT],
    220 220
             context.set_line_width(size / 10)
    
    221 221
             context.stroke()
    
    222 222
     
    
    223
    -    return context.get_target()  # pyright: ignore
    
    223
    +    return context.get_target()
    
    224 224
     
    
    225 225
     
    
    226 226
     def fit(surface: cairo.ImageSurface, size: int) -> cairo.ImageSurface:
    
    ... ... @@ -243,7 +243,7 @@ def fit(surface: cairo.ImageSurface, size: int) -> cairo.ImageSurface:
    243 243
         context.scale(factor, factor)
    
    244 244
         context.set_source_surface(square_surface, 0, 0)
    
    245 245
         context.paint()
    
    246
    -    return context.get_target()  # pyright: ignore
    
    246
    +    return context.get_target()
    
    247 247
     
    
    248 248
     
    
    249 249
     def square(surface: cairo.ImageSurface, size: int) -> cairo.ImageSurface:
    
    ... ... @@ -267,7 +267,7 @@ def square(surface: cairo.ImageSurface, size: int) -> cairo.ImageSurface:
    267 267
     
    
    268 268
         context.set_source_surface(surface, x_pos, y_pos)
    
    269 269
         context.paint()
    
    270
    -    return context.get_target()  # pyright: ignore
    
    270
    +    return context.get_target()
    
    271 271
     
    
    272 272
     
    
    273 273
     def clip(surface: cairo.ImageSurface, mode: str) -> cairo.ImageSurface:
    
    ... ... @@ -297,7 +297,7 @@ def clip_circle(surface: cairo.ImageSurface) -> cairo.ImageSurface:
    297 297
         context.clip()
    
    298 298
         context.paint()
    
    299 299
     
    
    300
    -    return context.get_target()  # pyright: ignore
    
    300
    +    return context.get_target()
    
    301 301
     
    
    302 302
     
    
    303 303
     def round_corners(surface: cairo.ImageSurface) -> cairo.ImageSurface:
    
    ... ... @@ -328,7 +328,7 @@ def round_corners(surface: cairo.ImageSurface) -> cairo.ImageSurface:
    328 328
     
    
    329 329
         context.paint()
    
    330 330
     
    
    331
    -    return context.get_target()  # pyright: ignore
    
    331
    +    return context.get_target()
    
    332 332
     
    
    333 333
     
    
    334 334
     def convert_to_greyscale(surface: cairo.ImageSurface) -> cairo.ImageSurface:
    
    ... ... @@ -341,7 +341,7 @@ def convert_to_greyscale(surface: cairo.ImageSurface) -> cairo.ImageSurface:
    341 341
         context.set_source_rgba(1, 1, 1, 0.5)
    
    342 342
         context.rectangle(0, 0, surface.get_width(), surface.get_height())
    
    343 343
         context.fill()
    
    344
    -    return context.get_target()  # pyright: ignore
    
    344
    +    return context.get_target()
    
    345 345
     
    
    346 346
     
    
    347 347
     class AvatarStorage(metaclass=Singleton):
    

  • gajim/gtk/avatar_selector.py
    ... ... @@ -34,6 +34,7 @@
    34 34
     from gajim.common.i18n import _
    
    35 35
     from gajim.common.helpers import get_file_path_from_dnd_dropped_uri
    
    36 36
     
    
    37
    +from . import types
    
    37 38
     from .dialogs import ErrorDialog
    
    38 39
     from .filechoosers import AvatarChooserDialog
    
    39 40
     from .util import scale_with_ratio
    
    ... ... @@ -286,7 +287,11 @@ def get_pixbuf(self) -> Optional[GdkPixbuf.Pixbuf]:
    286 287
             return GdkPixbuf.Pixbuf.new_subpixbuf(
    
    287 288
                 self._browse_pixbuf, self._crop.x, self._crop.y, width, height)
    
    288 289
     
    
    289
    -    def _on_draw(self, _widget: Gtk.Widget, context: cairo.Context) -> bool:
    
    290
    +    def _on_draw(self,
    
    291
    +                 _widget: Gtk.Widget,
    
    292
    +                 context: cairo.Context[types.SomeSurface]
    
    293
    +                 ) -> bool:
    
    294
    +
    
    290 295
             if self._browse_pixbuf is None:
    
    291 296
                 return False
    
    292 297
     
    

  • gajim/gtk/types.py
    ... ... @@ -16,6 +16,9 @@
    16 16
     
    
    17 17
     from typing import Union
    
    18 18
     from typing import TYPE_CHECKING
    
    19
    +from typing import TypeVar
    
    20
    +
    
    21
    +import cairo
    
    19 22
     
    
    20 23
     
    
    21 24
     if TYPE_CHECKING:
    
    ... ... @@ -39,3 +42,5 @@
    39 42
     ControlT = Union['ChatControl']
    
    40 43
     
    
    41 44
     ConversationViewT = Union['ConversationView']
    
    45
    +
    
    46
    +SomeSurface = TypeVar('SomeSurface', bound=cairo.Surface)