nsarchive 0.1b1__py3-none-any.whl → 0.1b3__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 +14 -5
- nsarchive/cls/entities.py +3 -3
- {nsarchive-0.1b1.dist-info → nsarchive-0.1b3.dist-info}/METADATA +1 -1
- {nsarchive-0.1b1.dist-info → nsarchive-0.1b3.dist-info}/RECORD +6 -6
- {nsarchive-0.1b1.dist-info → nsarchive-0.1b3.dist-info}/LICENSE +0 -0
- {nsarchive-0.1b1.dist-info → nsarchive-0.1b3.dist-info}/WHEEL +0 -0
nsarchive/__init__.py
CHANGED
@@ -33,9 +33,10 @@ class EntityInstance:
|
|
33
33
|
entity = Organization(id)
|
34
34
|
|
35
35
|
entity.owner = self.get_entity(_data['owner_id'].upper())
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
|
37
|
+
for _member in _data['members']:
|
38
|
+
member = GroupMember(_member['id'])
|
39
|
+
member.permissions.__dict__ = _member['permissions']
|
39
40
|
|
40
41
|
entity.avatar = self.avatars.get(id).read()
|
41
42
|
|
@@ -60,9 +61,17 @@ class EntityInstance:
|
|
60
61
|
|
61
62
|
if type(entity) == Organization:
|
62
63
|
_data['owner_id'] = entity.owner.id.upper() if entity.owner else "0"
|
63
|
-
_data['members'] = [
|
64
|
+
_data['members'] = []
|
64
65
|
_data['certifications'] = entity.certifications
|
65
66
|
|
67
|
+
for member in entity.members:
|
68
|
+
_member = {
|
69
|
+
'id': member.id,
|
70
|
+
'permissions': member.permissions.__dict__.copy()
|
71
|
+
}
|
72
|
+
|
73
|
+
_data['members'] += _member
|
74
|
+
|
66
75
|
self.avatars.put(name = entity.id, data = entity.avatar)
|
67
76
|
elif type(entity) == User:
|
68
77
|
_data['xp'] = entity.xp
|
@@ -113,7 +122,7 @@ class EntityInstance:
|
|
113
122
|
def get_entity_groups(self, id: str) -> list[Organization]:
|
114
123
|
groups = self.fetch_entities({'_type': 'organization'}, {'members': id})
|
115
124
|
|
116
|
-
return
|
125
|
+
return groups
|
117
126
|
|
118
127
|
def _add_archive(self, archive: Action):
|
119
128
|
_data = archive.__dict__.copy()
|
nsarchive/cls/entities.py
CHANGED
@@ -56,11 +56,11 @@ class MemberPermissions:
|
|
56
56
|
for perm in permissions.values():
|
57
57
|
self.__setattr__(*perm)
|
58
58
|
|
59
|
-
class GroupMember(
|
59
|
+
class GroupMember():
|
60
60
|
def __init__(self, id: str) -> None:
|
61
|
-
|
62
|
-
|
61
|
+
self.id = id
|
63
62
|
self.permissions: MemberPermissions = MemberPermissions()
|
63
|
+
self.position: str = 'membre'
|
64
64
|
|
65
65
|
class FunctionalUser:
|
66
66
|
def __init__(self, id: str) -> None:
|
@@ -1,12 +1,12 @@
|
|
1
|
-
nsarchive/__init__.py,sha256=
|
1
|
+
nsarchive/__init__.py,sha256=2wELlOApcaP3RPByj_xr3JwQ8ngLSDWBzQIDp117HsM,15481
|
2
2
|
nsarchive/assets/default_avatar.png,sha256=n-4vG_WPke8LvbY3ZU6oA-H-OtRoIu7woKnRq9DCIlI,51764
|
3
3
|
nsarchive/cls/archives.py,sha256=5C66pXuXAANRXNDqNTvIepRtUrXIWOL7ymmYiBHsHAY,1720
|
4
4
|
nsarchive/cls/bank.py,sha256=OactEpRn8PGv7BwnBUbMpzgHqrvv4yx526AMzh9uBO8,220
|
5
|
-
nsarchive/cls/entities.py,sha256=
|
5
|
+
nsarchive/cls/entities.py,sha256=Gv6nNEmLXyUokQfoQgNUIjq0kLTTlPT0Wmdpw83z7gY,3499
|
6
6
|
nsarchive/cls/exceptions.py,sha256=UZ7G7AFUN5OkKAGpNl1OT7jauF1jC7WW8wWXVFt5sMs,539
|
7
7
|
nsarchive/cls/republic.py,sha256=aY79B5PZF5IErwzEjn9ito6T8gXA4trm6LmIeYu6XLM,1821
|
8
8
|
nsarchive/utils/assets.py,sha256=hd0STSpa0yT-OJlUyI_wCYXJqcBiUMQds2pZTXNNg9c,382
|
9
|
-
nsarchive-0.
|
10
|
-
nsarchive-0.
|
11
|
-
nsarchive-0.
|
12
|
-
nsarchive-0.
|
9
|
+
nsarchive-0.1b3.dist-info/LICENSE,sha256=aFLFZg6LEJFpTlNQ8su3__jw4GfV-xWBmC1cePkKZVw,35802
|
10
|
+
nsarchive-0.1b3.dist-info/METADATA,sha256=1KcsUxL-6mWvF4VJ42jYnNnL-wkkI8pBqYOtiZxscDI,5629
|
11
|
+
nsarchive-0.1b3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
12
|
+
nsarchive-0.1b3.dist-info/RECORD,,
|
File without changes
|
File without changes
|