nsarchive 1.1.2__py3-none-any.whl → 1.1.3__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 +15 -4
- nsarchive/cls/entities.py +1 -0
- {nsarchive-1.1.2.dist-info → nsarchive-1.1.3.dist-info}/METADATA +1 -1
- {nsarchive-1.1.2.dist-info → nsarchive-1.1.3.dist-info}/RECORD +6 -6
- {nsarchive-1.1.2.dist-info → nsarchive-1.1.3.dist-info}/LICENSE +0 -0
- {nsarchive-1.1.2.dist-info → nsarchive-1.1.3.dist-info}/WHEEL +0 -0
nsarchive/__init__.py
CHANGED
@@ -223,6 +223,8 @@ class EntityInstance:
|
|
223
223
|
_data['type'] = "sanction"
|
224
224
|
elif type(archive) == AdminAction:
|
225
225
|
_data['type'] = "adminaction"
|
226
|
+
elif type(archive) == Report:
|
227
|
+
_data['type'] = "report"
|
226
228
|
else:
|
227
229
|
_data['type'] = "unknown"
|
228
230
|
|
@@ -257,9 +259,13 @@ class EntityInstance:
|
|
257
259
|
|
258
260
|
archive.details = _data['details']
|
259
261
|
archive.new_state = _data['new_state']
|
262
|
+
elif _data['type'] == "report": # Plainte
|
263
|
+
archive = Report(_data['author'], _data['target'])
|
264
|
+
|
265
|
+
archive.details = _data['details']
|
260
266
|
else:
|
261
267
|
archive = Action(_data['author'], _data['target'])
|
262
|
-
|
268
|
+
|
263
269
|
archive.id = id
|
264
270
|
archive.action = _data['action']
|
265
271
|
archive.date = _data['date']
|
@@ -279,7 +285,7 @@ class EntityInstance:
|
|
279
285
|
"""
|
280
286
|
|
281
287
|
_res = self.archives.fetch(query).items
|
282
|
-
|
288
|
+
|
283
289
|
return [ self._get_archive(archive['key']) for archive in _res ]
|
284
290
|
|
285
291
|
class RepublicInstance:
|
@@ -301,7 +307,7 @@ class RepublicInstance:
|
|
301
307
|
self.mandate = self.db.Base('mandate')
|
302
308
|
self.functions = self.db.Base('functions') # Liste des fonctionnaires
|
303
309
|
|
304
|
-
def get_vote(self, id: str | NSID) -> Vote | ClosedVote:
|
310
|
+
def get_vote(self, id: str | NSID) -> Vote | ClosedVote | Lawsuit:
|
305
311
|
"""
|
306
312
|
Récupère un vote spécifique.
|
307
313
|
|
@@ -323,6 +329,8 @@ class RepublicInstance:
|
|
323
329
|
vote = Vote(id, _data['title'], tuple(_data['choices'].keys()))
|
324
330
|
elif _data['_type'] == 'closed':
|
325
331
|
vote = ClosedVote(id, _data['title'])
|
332
|
+
elif _data['_type'] == 'lawsuit':
|
333
|
+
vote = Lawsuit(id, _data['title'])
|
326
334
|
else:
|
327
335
|
vote = Vote('0', 'Unknown Vote', ())
|
328
336
|
|
@@ -339,7 +347,10 @@ class RepublicInstance:
|
|
339
347
|
vote.id = NSID(vote.id)
|
340
348
|
|
341
349
|
_data = {
|
342
|
-
'_type':
|
350
|
+
'_type':'open' if type(vote) == Vote else\
|
351
|
+
'closed' if type(vote) == ClosedVote else\
|
352
|
+
'lawsuit' if type(vote) == Lawsuit else\
|
353
|
+
'unknown',
|
343
354
|
'title': vote.title,
|
344
355
|
'author': NSID(vote.author),
|
345
356
|
'startDate': vote.startDate,
|
nsarchive/cls/entities.py
CHANGED
@@ -20,6 +20,7 @@ class PositionPermissions:
|
|
20
20
|
self.edit_laws = False # Proposer une modification des différents textes de loi
|
21
21
|
self.manage_entities = False # Gérer les membres et les organisations
|
22
22
|
self.manage_national_channel = False # Prendre la parole sur la chaîne nationale et avoir une priorité de passage sur les autres chaînes
|
23
|
+
self.manage_reports = False # Accepter ou refuser une plainte
|
23
24
|
self.manage_state_budgets = False # Gérer les différents budgets de l'État
|
24
25
|
self.moderate_members = False # Envoyer des membres en garde à vue, en détention ou toute autre sanction non présente sur le client Discord
|
25
26
|
self.propose_new_laws = self.edit_constitution # Proposer un nouveau texte de loi pris en charge par la Constitution
|
@@ -1,13 +1,13 @@
|
|
1
|
-
nsarchive/__init__.py,sha256=
|
1
|
+
nsarchive/__init__.py,sha256=dOAMD-B5xeKLWM1u639Ptz4xtcvZZYySGiyF4MIkK1I,24738
|
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=z7NTvrtbeaUF1T_o-J7PL2N8axkmJek9EoKcQ8fTF9I,715
|
5
5
|
nsarchive/cls/economy.py,sha256=RjFu3VzNunazslbd4Ia5p1Jr-jJP5CvIcbVOzkDTwTU,549
|
6
|
-
nsarchive/cls/entities.py,sha256=
|
6
|
+
nsarchive/cls/entities.py,sha256=zKprr9dPojzlb4X6zUNRTDLQLNYZxRILH5qDl9ps3Ak,5814
|
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.1.
|
11
|
-
nsarchive-1.1.
|
12
|
-
nsarchive-1.1.
|
13
|
-
nsarchive-1.1.
|
10
|
+
nsarchive-1.1.3.dist-info/LICENSE,sha256=aFLFZg6LEJFpTlNQ8su3__jw4GfV-xWBmC1cePkKZVw,35802
|
11
|
+
nsarchive-1.1.3.dist-info/METADATA,sha256=sfSseQbrXzimXnbj0KXS4aUbYAsqIBG9NDmOjN8xb4w,5629
|
12
|
+
nsarchive-1.1.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
13
|
+
nsarchive-1.1.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|