kisa-utils 0.42.2__py3-none-any.whl → 0.42.4__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.
@@ -203,13 +203,13 @@ class Permissions:
203
203
  # print('xxx')
204
204
  self.__lastModified = dates.currentTimestamp()
205
205
  data = encrypt(encodeJSON(self.export()), password=self.__id)
206
- with Handle(self.__dbFilePath, tables=Permissions.__dbTables, readonly=False, useWALMode=True) as handle:
207
- if not (response := handle.insert(self.__dbTableName, [
206
+ with Handle(self.__dbFilePath, tables=Permissions.__dbTables, readonly=False, useWALMode=True, returnKISAResponse=True) as handle:
207
+ if not (resp := handle.insert(self.__dbTableName, [
208
208
  dates.currentTimestamp(),
209
209
  data
210
210
  ])):
211
- print(f'permissions save error: {response["log"]}')
212
- Error(response['log'])
211
+ print(f'permissions save error: {resp.log}')
212
+ return resp
213
213
 
214
214
  return Ok()
215
215
 
@@ -217,12 +217,15 @@ class Permissions:
217
217
  '''
218
218
  load the permissions instance from disk
219
219
  '''
220
- with Handle(self.__dbFilePath, tables=Permissions.__dbTables, readonly=True) as handle:
221
- data = handle.fetch(Permissions.__dbTableName, ['details'],'1 order by rowid desc',[], limit=1)
222
- if not data:
220
+ with Handle(self.__dbFilePath, tables=Permissions.__dbTables, readonly=True, returnKISAResponse=True) as handle:
221
+ resp = handle.fetch(Permissions.__dbTableName, ['details'],'1 order by rowid desc',[], limit=1)
222
+ if not resp:
223
+ return resp
224
+
225
+ if not resp.data:
223
226
  return Error('no-saved-data')
224
227
 
225
- data = data[0][0]
228
+ data = resp.data[0][0]
226
229
 
227
230
  try:
228
231
  data = decrypt(data, password=self.__id)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kisa-utils
3
- Version: 0.42.2
3
+ Version: 0.42.4
4
4
  Summary: Utility functions and modules for KISA Developers
5
5
  Author: Tom Bukenya
6
6
  Author-email: glayn2bukman@gmail.com
@@ -16,7 +16,7 @@ kisa_utils/storage.py,sha256=6NdEVrHMS7WB_vmCwiGigIinu-EjxalFJhk1kj-_vWs,5990
16
16
  kisa_utils/threads.py,sha256=qQqsf64YHMyLpboq5AEXKxYqf3iXUhxiJe6Ymg-vlxI,12840
17
17
  kisa_utils/token.py,sha256=Y2qglWYWpmHxoXBh-TH0r1as0uPV5LLqMNcunLvM4vM,7850
18
18
  kisa_utils/permissions/__config__.py,sha256=i3ELkOydDnjKx2ozQTxLZdZ8DXSeUncnl2kRxANjFmM,613
19
- kisa_utils/permissions/__init__.py,sha256=q7LGl26f-MPXkLS6nxBKDotW3xdB8y7pI5S_Oo5fPOw,47976
19
+ kisa_utils/permissions/__init__.py,sha256=iAsGEf5Ktw3gPJ5ZKL8BnuqX8e_S4QgsCVgfaRYi4Qg,48068
20
20
  kisa_utils/queues/__init__.py,sha256=VvhceyN5qeiMel1JFQwLRuVk48oBXaWvDtriCubDOms,48
21
21
  kisa_utils/queues/persistent.py,sha256=e4s2SK0Wvqq8wVcqPm1Gr_4ip0-0l25WKcMUNTSK_QY,6665
22
22
  kisa_utils/queues/callables/__init__.py,sha256=OJL3AQnaAS1Eek4H6WBH3WefA2wf-x03cwFmRSK8hoU,141
@@ -27,7 +27,7 @@ kisa_utils/servers/flask.py,sha256=XZYY1pWnP1mSvaS5Uv8G3EFJV5BJBQtU2gDbO8suvLc,4
27
27
  kisa_utils/structures/__init__.py,sha256=JBU1j3A42jQ62ALKnsS1Hav9YXcYwjDw1wQJtohXPbU,83
28
28
  kisa_utils/structures/utils.py,sha256=665rXIapGwFqejizeJwy3DryeskCQOdgP25BCdLkGvk,2898
29
29
  kisa_utils/structures/validator.py,sha256=JhD9jcfbjTwBr_7OfuNaJd_cYr7wR2emFhsCEo5MCHQ,4323
30
- kisa_utils-0.42.2.dist-info/METADATA,sha256=LQ23FZcJPYknC1FVxA5zJGCnNK8gqHlB13iJymAbU4k,477
31
- kisa_utils-0.42.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
32
- kisa_utils-0.42.2.dist-info/top_level.txt,sha256=GFOLXZYqpBG9xtscGa2uGJAEiZ5NwsqHBH9NylnB29M,11
33
- kisa_utils-0.42.2.dist-info/RECORD,,
30
+ kisa_utils-0.42.4.dist-info/METADATA,sha256=zPsxgOPL6JSpSJ235A0R0I2r0toVt-4E-jIoUXt_B90,477
31
+ kisa_utils-0.42.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
32
+ kisa_utils-0.42.4.dist-info/top_level.txt,sha256=GFOLXZYqpBG9xtscGa2uGJAEiZ5NwsqHBH9NylnB29M,11
33
+ kisa_utils-0.42.4.dist-info/RECORD,,