|
2 | 2 |
|
3 | 3 | import logging |
4 | 4 |
|
5 | | -class FavoriteGroup(BaseObject): |
6 | | - def __init__(self, client, obj, loop=None): |
7 | | - super().__init__(client, loop) |
8 | | - |
9 | | - self.required.update({ |
10 | | - "display_name": { |
11 | | - "dict_key": "displayName", |
12 | | - "type": str |
13 | | - }, |
14 | | - "id": { |
15 | | - "dict_key": "id", |
16 | | - "type": str |
17 | | - }, |
18 | | - "name": { |
19 | | - "dict_key": "name", |
20 | | - "type": str |
21 | | - }, |
22 | | - "owner_display_name": { |
23 | | - "dict_key": "ownerDisplayName", |
24 | | - "type": str |
25 | | - }, |
26 | | - "owner_id": { |
27 | | - "dict_key": "ownerId", |
28 | | - "type": str |
29 | | - }, |
30 | | - "tags": { |
31 | | - "dict_key": "tags", |
32 | | - "type": list |
33 | | - }, |
34 | | - "type": { |
35 | | - "dict_key": "type", |
36 | | - "type": str |
37 | | - }, |
38 | | - "visibility": { |
39 | | - "dict_key": "visibility", |
40 | | - "type": str |
41 | | - } |
42 | | - }) |
43 | | - |
44 | | - self._assign(obj) |
45 | | - |
46 | 5 | class BaseFavorite(BaseObject): |
47 | 6 | def __init__(self, client, obj, loop=None): |
48 | 7 | super().__init__(client, loop) |
@@ -80,6 +39,39 @@ async def unfavorite(self): |
80 | 39 | await self.client.request.delete("/favorites/"+self.id) |
81 | 40 | logging.debug("Unfavorited %s %s" % (self.type, self.id)) |
82 | 41 |
|
| 42 | +class FavoriteGroup(BaseFavorite): |
| 43 | + def __init__(self, client, obj, loop=None): |
| 44 | + super().__init__(client, loop) |
| 45 | + |
| 46 | + self.required.update({ |
| 47 | + "display_name": { |
| 48 | + "dict_key": "displayName", |
| 49 | + "type": str |
| 50 | + }, |
| 51 | + "name": { |
| 52 | + "dict_key": "name", |
| 53 | + "type": str |
| 54 | + }, |
| 55 | + "owner_display_name": { |
| 56 | + "dict_key": "ownerDisplayName", |
| 57 | + "type": str |
| 58 | + }, |
| 59 | + "owner_id": { |
| 60 | + "dict_key": "ownerId", |
| 61 | + "type": str |
| 62 | + }, |
| 63 | + "tags": { |
| 64 | + "dict_key": "tags", |
| 65 | + "type": list |
| 66 | + }, |
| 67 | + "visibility": { |
| 68 | + "dict_key": "visibility", |
| 69 | + "type": str |
| 70 | + } |
| 71 | + }) |
| 72 | + |
| 73 | + del self.unfavorite |
| 74 | + self._assign(obj) |
83 | 75 |
|
84 | 76 | class WorldFavorite(BaseFavorite): |
85 | 77 | def __init__(self, client, obj, loop=None): |
|
0 commit comments