atk: use -D for all meson options
[kiss-trunc88.git] / exfalso / patches / quodlibet-4.4.0-collections.patch
blobe4e3ce0f2aea39999cc4be6575127bd2249dd03b
1 diff -ruN a/quodlibet/packages/raven/context.py b/quodlibet/packages/raven/context.py
2 --- a/quodlibet/packages/raven/context.py 2021-02-28 20:26:26.003186000 +0100
3 +++ b/quodlibet/packages/raven/context.py 2021-12-04 11:59:34.974753115 +0100
4 @@ -7,7 +7,10 @@
5 """
6 from __future__ import absolute_import
8 -from collections import Mapping, Iterable
9 +try:
10 + from collections import abc
11 +except ImportError:
12 + import collections as abc # type: ignore
13 from threading import local
14 from weakref import ref as weakref
16 @@ -30,7 +33,7 @@
17 return []
20 -class Context(local, Mapping, Iterable):
21 +class Context(local, abc.Mapping, abc.Iterable):
22 """
23 Stores context until cleared.
25 diff -ruN a/quodlibet/player/gstbe/util.py b/quodlibet/player/gstbe/util.py
26 --- a/quodlibet/player/gstbe/util.py 2021-02-28 20:26:26.007186000 +0100
27 +++ b/quodlibet/player/gstbe/util.py 2021-12-04 11:59:34.978086457 +0100
28 @@ -6,7 +6,10 @@
29 # the Free Software Foundation; either version 2 of the License, or
30 # (at your option) any later version.
32 -import collections
33 +try:
34 + from collections import abc
35 +except ImportError:
36 + import collections as abc # type: ignore
37 import subprocess
38 from enum import Enum
39 from typing import Iterable, Tuple
40 @@ -183,7 +186,7 @@
41 return pipe, pipeline_desc
44 -class TagListWrapper(collections.Mapping):
45 +class TagListWrapper(abc.Mapping):
46 def __init__(self, taglist, merge=False):
47 self._list = taglist
48 self._merge = merge
49 diff -ruN a/quodlibet/util/collection.py b/quodlibet/util/collection.py
50 --- a/quodlibet/util/collection.py 2021-02-28 20:26:26.015186000 +0100
51 +++ b/quodlibet/util/collection.py 2021-12-04 12:01:23.532557722 +0100
52 @@ -24,7 +24,10 @@
53 AudioFile)
54 from quodlibet.formats._audio import PEOPLE as _PEOPLE
55 from quodlibet.pattern import Pattern
56 -from collections import Iterable
57 +try:
58 + from collections import abc
59 +except ImportError:
60 + import collections as abc # type: ignore
62 from quodlibet.util import is_windows
63 from quodlibet.util.path import escape_filename, unescape_filename, limit_path
64 @@ -332,7 +335,7 @@
66 @hashable
67 @total_ordering
68 -class Playlist(Collection, Iterable):
69 +class Playlist(Collection, abc.Iterable):
70 """A Playlist is a `Collection` that has list-like features
71 Songs can appear more than once.
72 """
73 @@ -340,7 +343,7 @@
74 __instances: Set["Playlist"] = set()
76 @classmethod
77 - def playlists_featuring(cls, song: AudioFile) -> Iterable[Playlist]:
78 + def playlists_featuring(cls, song: AudioFile) -> abc.Iterable[Playlist]:
79 """Returns a generator yielding playlists in which this song appears"""
80 return (pl for pl in cls.__instances if song in pl._list)
82 diff -ruN a/quodlibet/util/collections.py b/quodlibet/util/collections.py
83 --- a/quodlibet/util/collections.py 2021-02-28 20:26:26.015186000 +0100
84 +++ b/quodlibet/util/collections.py 2021-12-04 12:03:18.200303036 +0100
85 @@ -9,7 +9,11 @@
87 from __future__ import absolute_import
89 -from collections import MutableSequence, defaultdict
90 +try:
91 + from collections import abc
92 +except ImportError:
93 + import collections as abc # type: ignore
94 +from collections import defaultdict
96 from .misc import total_ordering
98 @@ -139,7 +143,7 @@
99 return self.__dict.keys()
102 -class HashedList(MutableSequence):
103 +class HashedList(abc.MutableSequence):
104 """A list-like collection that can only take hashable items
105 and provides fast membership tests.
107 diff -ruN a/quodlibet/util/http.py b/quodlibet/util/http.py
108 --- a/quodlibet/util/http.py 2021-02-28 20:26:26.015186000 +0100
109 +++ b/quodlibet/util/http.py 2021-12-04 12:13:21.410973754 +0100
110 @@ -7,7 +7,7 @@
111 # (at your option) any later version.
113 import json
114 -from collections import Callable
115 +from collections.abc import Callable
116 from typing import Optional, Any
118 from gi.repository import Soup, Gio, GLib, GObject