nsarchive 1.1.0__py3-none-any.whl → 1.1.2__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
@@ -55,7 +55,11 @@ class EntityInstance:
55
55
 
56
56
  entity.xp = _data['xp']
57
57
  entity.boosts = _data['boosts']
58
- entity.votes = [ NSID(vote) for vote in _votes['votes'] ]
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
- _base.put(_data, entity.id, expire_in = 3 * 31536000) # Données supprimées tous les trois ans
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
  """
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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nsarchive
3
- Version: 1.1.0
3
+ Version: 1.1.2
4
4
  Summary:
5
5
  License: GPL-3.0
6
6
  Author: happex
@@ -1,13 +1,13 @@
1
- nsarchive/__init__.py,sha256=Y_vhFVEURz-14rePh35a_zHLvCJQOwGJODKBfPRAS44,23986
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=P3xOg7D7og-Vnf3VQWeIwmJRD9g7dVQBYChvMIMM6i8,2008
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=FphoO9TBE9hyfdjcePjQHqBw7NFT74f-avE9T5qTTuE,1750
8
+ nsarchive/cls/republic.py,sha256=6eut6OsFoOm9TVhA41fM3NlMEA3Uhg9TCuXgl46vFko,1985
9
9
  nsarchive/utils/assets.py,sha256=hd0STSpa0yT-OJlUyI_wCYXJqcBiUMQds2pZTXNNg9c,382
10
- nsarchive-1.1.0.dist-info/LICENSE,sha256=aFLFZg6LEJFpTlNQ8su3__jw4GfV-xWBmC1cePkKZVw,35802
11
- nsarchive-1.1.0.dist-info/METADATA,sha256=7ve5bI2eEPMGbr_MFVbQ4ihc8_pKtnbQ7yLTEPy21jA,5629
12
- nsarchive-1.1.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
13
- nsarchive-1.1.0.dist-info/RECORD,,
10
+ nsarchive-1.1.2.dist-info/LICENSE,sha256=aFLFZg6LEJFpTlNQ8su3__jw4GfV-xWBmC1cePkKZVw,35802
11
+ nsarchive-1.1.2.dist-info/METADATA,sha256=m_crv4Xg4lKbrS9-refA88uHRDJce82mw4lqAGehzLU,5629
12
+ nsarchive-1.1.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
13
+ nsarchive-1.1.2.dist-info/RECORD,,