nsarchive 1.2.2__py3-none-any.whl → 1.2.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
nsarchive/__init__.py CHANGED
@@ -126,7 +126,7 @@ class EntityInstance:
126
126
  for member in entity.members:
127
127
  _member = {
128
128
  'id': NSID(member.id),
129
- 'permissions': member.permissions.__dict__.copy()
129
+ 'permissions': member.group_permissions.__dict__.copy()
130
130
  }
131
131
 
132
132
  _data['members'] += [_member]
@@ -166,7 +166,7 @@ class EntityInstance:
166
166
  query: `dict`
167
167
  La requête pour filtrer les entités.
168
168
  listquery: `dict | None`
169
- Requête secondaire pour n'afficher que les listes contenant un certain élément.
169
+ OBSOLÈTE
170
170
 
171
171
  ## Renvoie
172
172
  - `list[Entity | User | Organization]`
@@ -174,11 +174,8 @@ class EntityInstance:
174
174
 
175
175
  _res = self.base.fetch(query).items
176
176
 
177
- if listquery is not None:
178
- for item in _res:
179
- for target, value in listquery.items():
180
- if value not in item[target]:
181
- _res.remove(item)
177
+ if listquery:
178
+ print("\033[1;33mAvertissement\033[0m Listquery n'est plus pris en charge et sera retiré en version 1.3.0")
182
179
 
183
180
  return [ self.get_entity(NSID(entity['key'])) for entity in _res ]
184
181
 
@@ -195,9 +192,16 @@ class EntityInstance:
195
192
  """
196
193
 
197
194
  id = NSID(id)
198
- groups = self.fetch_entities({'_type': 'organization'}, {'members': id})
195
+ groups = self.fetch_entities({'_type': 'organization'})
199
196
  groups.extend(self.fetch_entities({'_type': 'organization', 'owner_id': id}))
200
-
197
+
198
+ for group in groups:
199
+ for member in group.members:
200
+ if member.id == id:
201
+ break
202
+ else:
203
+ groups.remove(group)
204
+
201
205
  return [ group for group in groups if group is not None ]
202
206
 
203
207
  def get_position(self, id: str) -> Position:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nsarchive
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Summary:
5
5
  License: GPL-3.0
6
6
  Author: happex
@@ -1,4 +1,4 @@
1
- nsarchive/__init__.py,sha256=PKkuM-tow8WrT4zig8_8ikcpCW4RvBE7BwF2ZzPXx3k,25211
1
+ nsarchive/__init__.py,sha256=k1-bS7GjHggQ1nacx_fv9qZnqt365p5WCMzQ9rnoljA,25242
2
2
  nsarchive/assets/default_avatar.png,sha256=n-4vG_WPke8LvbY3ZU6oA-H-OtRoIu7woKnRq9DCIlI,51764
3
3
  nsarchive/cls/archives.py,sha256=Nmt3C0Zq9oGQdCXSzm_wo70VbNq89SY3dx9KKqEpoCg,2182
4
4
  nsarchive/cls/base.py,sha256=DGDm0uD96M00-qvdKsltU9kAfAOBr85Ov0b18gTnoIM,714
@@ -7,7 +7,7 @@ nsarchive/cls/entities.py,sha256=LcL0Ky19lqYQdnYqtF_84-CdlVS1sie05l8vV2yJLyw,601
7
7
  nsarchive/cls/exceptions.py,sha256=QN6Qn7cxTkGoC4lO50hBAq4gZCgo7scQvCkb-xKl6Xs,692
8
8
  nsarchive/cls/republic.py,sha256=6eut6OsFoOm9TVhA41fM3NlMEA3Uhg9TCuXgl46vFko,1985
9
9
  nsarchive/utils/assets.py,sha256=hd0STSpa0yT-OJlUyI_wCYXJqcBiUMQds2pZTXNNg9c,382
10
- nsarchive-1.2.2.dist-info/LICENSE,sha256=aFLFZg6LEJFpTlNQ8su3__jw4GfV-xWBmC1cePkKZVw,35802
11
- nsarchive-1.2.2.dist-info/METADATA,sha256=-67Gdxg5XgVsF2G8TQnurJk7PPBRNWA4jqDguzrseI4,5629
12
- nsarchive-1.2.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
13
- nsarchive-1.2.2.dist-info/RECORD,,
10
+ nsarchive-1.2.4.dist-info/LICENSE,sha256=aFLFZg6LEJFpTlNQ8su3__jw4GfV-xWBmC1cePkKZVw,35802
11
+ nsarchive-1.2.4.dist-info/METADATA,sha256=Y3txY5dAnebMeKDCiv9VKXSrWUz94yWW6F7Z_5CYz-Q,5629
12
+ nsarchive-1.2.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
13
+ nsarchive-1.2.4.dist-info/RECORD,,