logs-py 3.0.9__py3-none-any.whl → 3.0.10__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.

Potentially problematic release.


This version of logs-py might be problematic. Click here for more details.

@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Optional
1
+ from typing import TYPE_CHECKING, Any, Callable, Optional, Tuple
2
2
 
3
3
  from LOGS.Auxiliary.MinimalModelGenerator import MinimalFromSingle
4
4
  from LOGS.Entity.SerializableContent import SerializableContent
@@ -16,6 +16,17 @@ class ProjectPersonPermission(SerializableContent):
16
16
  _add: Optional[bool] = None
17
17
  _read: Optional[bool] = None
18
18
 
19
+ def _fromRef(
20
+ self,
21
+ ref,
22
+ selfClass,
23
+ convertOtherType: Tuple[type, Callable[[Any], Any]] | None = None,
24
+ ):
25
+ if isinstance(ref, dict) and "read" in ref:
26
+ self._read = ref["read"]
27
+ del ref["read"]
28
+ return super()._fromRef(ref, selfClass, convertOtherType)
29
+
19
30
  @property
20
31
  def person(self) -> Optional["PersonMinimal"]:
21
32
  return self._person
@@ -39,6 +50,9 @@ class ProjectPersonPermission(SerializableContent):
39
50
  @administer.setter
40
51
  def administer(self, value):
41
52
  self._administer = self.checkAndConvertNullable(value, bool, "administer")
53
+ if self._administer:
54
+ self._edit = True
55
+ self._add = True
42
56
 
43
57
  @property
44
58
  def edit(self) -> Optional[bool]:
@@ -47,6 +61,10 @@ class ProjectPersonPermission(SerializableContent):
47
61
  @edit.setter
48
62
  def edit(self, value):
49
63
  self._edit = self.checkAndConvertNullable(value, bool, "edit")
64
+ if self._edit:
65
+ self._add = True
66
+ else:
67
+ self._administer = False
50
68
 
51
69
  @property
52
70
  def add(self) -> Optional[bool]:
@@ -55,11 +73,16 @@ class ProjectPersonPermission(SerializableContent):
55
73
  @add.setter
56
74
  def add(self, value):
57
75
  self._add = self.checkAndConvertNullable(value, bool, "add")
76
+ if not self._add:
77
+ self._edit = False
78
+ self._administer = False
58
79
 
59
80
  @property
60
81
  def read(self) -> Optional[bool]:
61
82
  return self._read
62
83
 
63
84
  @read.setter
64
- def read(self, value):
65
- self._read = self.checkAndConvertNullable(value, bool, "read")
85
+ def read(self, _):
86
+ raise Exception(
87
+ "Every person added to a project has automatically read permissions."
88
+ )
LOGS/Entities/__init__.py CHANGED
@@ -98,6 +98,7 @@ from .PersonRequestParameter import *
98
98
  from .Persons import *
99
99
  from .Project import *
100
100
  from .ProjectMinimal import *
101
+ from .ProjectPersonPermission import *
101
102
  from .ProjectRelations import *
102
103
  from .ProjectRequestParameter import *
103
104
  from .Projects import *
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: logs-py
3
- Version: 3.0.9
3
+ Version: 3.0.10
4
4
  Summary: A python interface for the LOGS public API
5
5
  Home-page: https://docs.logs-python.com
6
6
  Author: Sina Kazemi
@@ -150,7 +150,7 @@ LOGS/Entities/PersonRequestParameter.py,sha256=x40tZWowl5jvHlUrMok_H8FIC0miC5ai3
150
150
  LOGS/Entities/Persons.py,sha256=cj4SKaJZvitaIe7Fd1M9_qqNdAEEG38iuMPNiKPDPUA,413
151
151
  LOGS/Entities/Project.py,sha256=oySJq4IQLTAnqMm4xXSnkEKnCu1chJtJBnr_t_fLYbU,3136
152
152
  LOGS/Entities/ProjectMinimal.py,sha256=Xw8wnA2iSixEkVaisY_b4Z3Ujudum3MG6tBUfbiAk0s,246
153
- LOGS/Entities/ProjectPersonPermission.py,sha256=fLEBtwus4OxDiw_31l9benFrM36IGK6YmCtM0LvoZ9Q,1851
153
+ LOGS/Entities/ProjectPersonPermission.py,sha256=9CE6wdNjOLsRqK659kbhh3n57XSqM2ZoQGu2tmprtKk,2530
154
154
  LOGS/Entities/ProjectRelations.py,sha256=xHHx7B_TbJ5Qz9-bbtjZMPN5YnJyMCTchV2lfJeKYm0,1758
155
155
  LOGS/Entities/ProjectRequestParameter.py,sha256=nPrhuYi95N6vrwVk2JgZ-i2PJlZYriLxuNVKbHx3ktQ,1892
156
156
  LOGS/Entities/Projects.py,sha256=8xvaHUrH8Y8g8WOcRN0Sa7BXH1QJnPB39SrfP3GpXXE,425
@@ -178,7 +178,7 @@ LOGS/Entities/TrackXY.py,sha256=klLXkgK9hkXdSIiTPbpGxnWoBf-fymOxJ4BJtcc97Cc,1332
178
178
  LOGS/Entities/TrackXYComplex.py,sha256=Ts8UusoZY81P8OX4gWgHfSEKiUflT3cr8oUoqFXuc0I,1698
179
179
  LOGS/Entities/TrackXYComplexData.py,sha256=xWd3_jdXa347Gh53NYIMo66nFirA60Zd2KxaPs4KHaY,1368
180
180
  LOGS/Entities/TrackXYData.py,sha256=6AbwG2qa2HN858ROLaLpzkuIlwsb8tN8wznaiKplRdo,819
181
- LOGS/Entities/__init__.py,sha256=apyWeNZSUolKSJd3mnPv3wdspih3fwgVB_YfyCFwdn8,3761
181
+ LOGS/Entities/__init__.py,sha256=CxPw9F8WKDAn1z514YIJ_tZoq3oPHhC9TodDP7Kuz2g,3800
182
182
  LOGS/Entities/FormattedTable/DatatypeFormattedTable.py,sha256=M5rL0UZdXfylHANrTXKqAnnrML_rEUeMMBFyQEIyto4,3588
183
183
  LOGS/Entities/FormattedTable/DatatypeFormattedTableCell.py,sha256=1nBVgWqRecnUWHFwiO0oAqgChYtNSE3VQBxIAjPRjWk,2792
184
184
  LOGS/Entities/FormattedTable/DatatypeFormattedTableSettings.py,sha256=Eox_JyXtm6g29lt5kG_RBwD45ioWTg7F_5T36oZbPpY,308
@@ -254,7 +254,7 @@ LOGS/Parameters/ParameterElement.py,sha256=fr6AlO_flKRygZZFx1OILP4P-2lV2Tx4PAe6W
254
254
  LOGS/Parameters/ParameterList.py,sha256=ijukB1__iKI5cefmOIIWz0wKaPz9Cx8KpD7Y7Gz2Pn0,1478
255
255
  LOGS/Parameters/ParameterTable.py,sha256=7Lew4DPgWmKcpV1T-1Pvt00kEI05FB383QqO-LHAjds,1758
256
256
  LOGS/Parameters/__init__.py,sha256=KpMSuBPx964v2YMZ1BqVp8vjrgSpuiW9KYBm-aejRuc,312
257
- logs_py-3.0.9.dist-info/METADATA,sha256=C-jyeUN24wtHKYyrBuoJUlF7sNZWRA7_U4iXpu65vKQ,2339
258
- logs_py-3.0.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
259
- logs_py-3.0.9.dist-info/top_level.txt,sha256=Ckn2LiAmGaR7k3tdEnKAc04z_uboMD4gLreYghRNdCs,5
260
- logs_py-3.0.9.dist-info/RECORD,,
257
+ logs_py-3.0.10.dist-info/METADATA,sha256=fIkFhEJpvXtJ-ScAK7-6nE1JN_4O-tZqc4HZPP8E_rE,2340
258
+ logs_py-3.0.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
259
+ logs_py-3.0.10.dist-info/top_level.txt,sha256=Ckn2LiAmGaR7k3tdEnKAc04z_uboMD4gLreYghRNdCs,5
260
+ logs_py-3.0.10.dist-info/RECORD,,