nsarchive 1.0.1__py3-none-any.whl → 1.1.1__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 +12 -2
- nsarchive/cls/archives.py +6 -0
- nsarchive/cls/republic.py +6 -1
- {nsarchive-1.0.1.dist-info → nsarchive-1.1.1.dist-info}/METADATA +1 -1
- {nsarchive-1.0.1.dist-info → nsarchive-1.1.1.dist-info}/RECORD +7 -7
- {nsarchive-1.0.1.dist-info → nsarchive-1.1.1.dist-info}/LICENSE +0 -0
- {nsarchive-1.0.1.dist-info → nsarchive-1.1.1.dist-info}/WHEEL +0 -0
nsarchive/__init__.py
CHANGED
@@ -55,7 +55,11 @@ class EntityInstance:
|
|
55
55
|
|
56
56
|
entity.xp = _data['xp']
|
57
57
|
entity.boosts = _data['boosts']
|
58
|
-
|
58
|
+
|
59
|
+
if _votes is None:
|
60
|
+
entity.votes = []
|
61
|
+
else:
|
62
|
+
entity.votes = [ NSID(vote) for vote in _votes['votes'] ]
|
59
63
|
elif _data['_type'] == 'organization':
|
60
64
|
entity = Organization(id)
|
61
65
|
|
@@ -117,7 +121,12 @@ class EntityInstance:
|
|
117
121
|
_data['xp'] = entity.xp
|
118
122
|
_data['boosts'] = entity.boosts
|
119
123
|
|
120
|
-
|
124
|
+
_votes = []
|
125
|
+
for vote in entity.votes:
|
126
|
+
_votes.append(NSID(vote))
|
127
|
+
|
128
|
+
self.electors.put(_votes, entity.id, expire_in = 112 * 84600) # Données supprimées après 16 semaines d'inactivité
|
129
|
+
_base.put(_data, entity.id, expire_in = 3 * 31536000) # Pareil après 3 ans
|
121
130
|
|
122
131
|
def delete_entity(self, entity: Entity) -> None:
|
123
132
|
"""
|
@@ -170,6 +179,7 @@ class EntityInstance:
|
|
170
179
|
|
171
180
|
id = NSID(id)
|
172
181
|
groups = self.fetch_entities({'_type': 'organization'}, {'members': id})
|
182
|
+
groups.extend(self.fetch_entities({'_type': 'organization', 'owner_id': id}))
|
173
183
|
|
174
184
|
return groups
|
175
185
|
|
nsarchive/cls/archives.py
CHANGED
@@ -29,6 +29,12 @@ class AdminAction(Action):
|
|
29
29
|
self.details: str = ""
|
30
30
|
self.new_state: str | int | bool = None
|
31
31
|
|
32
|
+
class Report(Action):
|
33
|
+
def __init__(self, author: str | NSID, target: str | NSID) -> None:
|
34
|
+
super().__init__(author, target)
|
35
|
+
|
36
|
+
self.details: str = ""
|
37
|
+
|
32
38
|
|
33
39
|
# Community
|
34
40
|
|
nsarchive/cls/republic.py
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
from nsarchive.cls.entities import NSID
|
1
2
|
from .entities import *
|
2
3
|
|
3
4
|
# Votes
|
@@ -11,10 +12,14 @@ class Vote:
|
|
11
12
|
self.startDate: int = 0
|
12
13
|
self.endDate: int = 0
|
13
14
|
|
14
|
-
class ClosedVote(Vote):
|
15
|
+
class ClosedVote(Vote): # Meilleur nom pour cette classe en v2
|
15
16
|
def __init__(self, id: str | NSID, title: str) -> None:
|
16
17
|
super().__init__(id, title, ('yes', 'no', 'blank'))
|
17
18
|
|
19
|
+
class Lawsuit(Vote):
|
20
|
+
def __init__(self, id: str | NSID, title: str) -> None:
|
21
|
+
super().__init__(id, title, ('innocent', 'guilty', 'blank'))
|
22
|
+
|
18
23
|
|
19
24
|
# Institutions (defs)
|
20
25
|
|
@@ -1,13 +1,13 @@
|
|
1
|
-
nsarchive/__init__.py,sha256=
|
1
|
+
nsarchive/__init__.py,sha256=VQPDgD-xYXTe3K5-vFuDjfH13Eyw8s2QSucyeTx1BHQ,24306
|
2
2
|
nsarchive/assets/default_avatar.png,sha256=n-4vG_WPke8LvbY3ZU6oA-H-OtRoIu7woKnRq9DCIlI,51764
|
3
|
-
nsarchive/cls/archives.py,sha256=
|
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
6
|
nsarchive/cls/entities.py,sha256=zz0JTphgtXpCIVH8dgb3hxc55nxwvXF3m2yIXgp_Q9k,5743
|
7
7
|
nsarchive/cls/exceptions.py,sha256=QN6Qn7cxTkGoC4lO50hBAq4gZCgo7scQvCkb-xKl6Xs,692
|
8
|
-
nsarchive/cls/republic.py,sha256=
|
8
|
+
nsarchive/cls/republic.py,sha256=6eut6OsFoOm9TVhA41fM3NlMEA3Uhg9TCuXgl46vFko,1985
|
9
9
|
nsarchive/utils/assets.py,sha256=hd0STSpa0yT-OJlUyI_wCYXJqcBiUMQds2pZTXNNg9c,382
|
10
|
-
nsarchive-1.
|
11
|
-
nsarchive-1.
|
12
|
-
nsarchive-1.
|
13
|
-
nsarchive-1.
|
10
|
+
nsarchive-1.1.1.dist-info/LICENSE,sha256=aFLFZg6LEJFpTlNQ8su3__jw4GfV-xWBmC1cePkKZVw,35802
|
11
|
+
nsarchive-1.1.1.dist-info/METADATA,sha256=u1lJvlYZr62rImnxsmDgaMv5qV1tb4vjGzdwPpNMjSQ,5629
|
12
|
+
nsarchive-1.1.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
13
|
+
nsarchive-1.1.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|