viur-scriptor-api 1.2.0__tar.gz → 1.3.0__tar.gz

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.
Files changed (21) hide show
  1. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/PKG-INFO +12 -10
  2. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/README.md +9 -8
  3. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/pyproject.toml +2 -1
  4. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/viur/scriptor/__init__.py +1 -1
  5. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/viur/scriptor/dialog.py +6 -1
  6. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/viur/scriptor/module_parts.py +11 -11
  7. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/.gitignore +0 -0
  8. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/LICENSE +0 -0
  9. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/Pipfile +0 -0
  10. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/Pipfile.lock +0 -0
  11. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/tox.ini +0 -0
  12. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/viur/scriptor/_utils.py +0 -0
  13. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/viur/scriptor/directory_handler.py +0 -0
  14. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/viur/scriptor/export_import.py +0 -0
  15. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/viur/scriptor/file.py +0 -0
  16. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/viur/scriptor/http_errors.py +0 -0
  17. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/viur/scriptor/logger.py +0 -0
  18. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/viur/scriptor/module.py +0 -0
  19. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/viur/scriptor/progressbar.py +0 -0
  20. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/viur/scriptor/requests.py +0 -0
  21. {viur_scriptor_api-1.2.0 → viur_scriptor_api-1.3.0}/viur/scriptor/utils.py +0 -0
@@ -1,8 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: viur-scriptor-api
3
- Version: 1.2.0
3
+ Version: 1.3.0
4
4
  Summary: This is the internal Scriptor library that the viur-scriptor utilizes. The API includes components for networking as well as parts related to the Scriptor's files.
5
- Project-URL: Homepage, https://github.com/viur-framework/viur-scriptor-api
5
+ Project-URL: Documentation, https://viur-scriptor-api.readthedocs.io
6
+ Project-URL: Repository, https://github.com/viur-framework/viur-scriptor-api
6
7
  Project-URL: Bug Tracker, https://github.com/viur-framework/viur-scriptor-api/issues
7
8
  Author-email: Mausbrand Informationssysteme GmbH <devs@viur.dev>
8
9
  License-Expression: MIT
@@ -24,12 +25,13 @@ Description-Content-Type: text/markdown
24
25
  <div align="center">
25
26
  <img src="https://github.com/viur-framework/viur-artwork/raw/main/icons/icon-scriptor.svg" height="196" alt="A hexagonal logo of Scriptor" title="Scriptor logo">
26
27
  <h1>viur-scriptor-api</h1>
27
- <!--
28
- <a href="https://github.com/viur-framework/viur-scriptor/actions/workflows/test.yml">
29
- <img src="https://github.com/viur-framework/viur-scriptor/actions/workflows/test.yml/badge.svg" alt="Badge displaying the test status" title="Test badge">
28
+ <a href="https://pypi.org/project/viur-scriptor-api/">
29
+ <img alt="Badge showing current PyPI version" title="PyPI" src="https://img.shields.io/pypi/v/viur-scriptor-api">
30
30
  </a>
31
- -->
32
- <a href="https://github.com/viur-framework/viur-scriptor/LICENSE">
31
+ <a href="https://viur-scriptor-api.readthedocs.io/en/latest/?badge=latest">
32
+ <img src="https://readthedocs.org/projects/viur-scriptor-api/badge/?version=latest" alt="Documentation Status">
33
+ </a>
34
+ <a href="LICENSE">
33
35
  <img src="https://img.shields.io/github/license/viur-framework/viur-scriptor-api" alt="Badge displaying the license" title="License badge">
34
36
  </a>
35
37
  <br>
@@ -48,12 +50,12 @@ You can use it either in the Pyodide-based scriptor as well as in native Python
48
50
 
49
51
  ## Documentation
50
52
 
51
- ReadTheDocs link follows soon, a gread documentation is already available in the source code!
53
+ - [viur-scriptor-api.readthedocs.io](https://viur-scriptor-api.readthedocs.io/en/latest/)
52
54
 
53
55
  ## License
54
56
 
55
- Copyright © 2024 by Mausbrand Informationssysteme GmbH.<br>
57
+ Copyright © 2025 by Mausbrand Informationssysteme GmbH.<br>
56
58
  Mausbrand and ViUR are registered trademarks of Mausbrand Informationssysteme GmbH.
57
59
 
58
- Logics is free software under the MIT license.<br>
60
+ viur-scriptor-api is free software under the MIT license.<br>
59
61
  Please see the LICENSE file for details.
@@ -1,12 +1,13 @@
1
1
  <div align="center">
2
2
  <img src="https://github.com/viur-framework/viur-artwork/raw/main/icons/icon-scriptor.svg" height="196" alt="A hexagonal logo of Scriptor" title="Scriptor logo">
3
3
  <h1>viur-scriptor-api</h1>
4
- <!--
5
- <a href="https://github.com/viur-framework/viur-scriptor/actions/workflows/test.yml">
6
- <img src="https://github.com/viur-framework/viur-scriptor/actions/workflows/test.yml/badge.svg" alt="Badge displaying the test status" title="Test badge">
4
+ <a href="https://pypi.org/project/viur-scriptor-api/">
5
+ <img alt="Badge showing current PyPI version" title="PyPI" src="https://img.shields.io/pypi/v/viur-scriptor-api">
7
6
  </a>
8
- -->
9
- <a href="https://github.com/viur-framework/viur-scriptor/LICENSE">
7
+ <a href="https://viur-scriptor-api.readthedocs.io/en/latest/?badge=latest">
8
+ <img src="https://readthedocs.org/projects/viur-scriptor-api/badge/?version=latest" alt="Documentation Status">
9
+ </a>
10
+ <a href="LICENSE">
10
11
  <img src="https://img.shields.io/github/license/viur-framework/viur-scriptor-api" alt="Badge displaying the license" title="License badge">
11
12
  </a>
12
13
  <br>
@@ -25,12 +26,12 @@ You can use it either in the Pyodide-based scriptor as well as in native Python
25
26
 
26
27
  ## Documentation
27
28
 
28
- ReadTheDocs link follows soon, a gread documentation is already available in the source code!
29
+ - [viur-scriptor-api.readthedocs.io](https://viur-scriptor-api.readthedocs.io/en/latest/)
29
30
 
30
31
  ## License
31
32
 
32
- Copyright © 2024 by Mausbrand Informationssysteme GmbH.<br>
33
+ Copyright © 2025 by Mausbrand Informationssysteme GmbH.<br>
33
34
  Mausbrand and ViUR are registered trademarks of Mausbrand Informationssysteme GmbH.
34
35
 
35
- Logics is free software under the MIT license.<br>
36
+ viur-scriptor-api is free software under the MIT license.<br>
36
37
  Please see the LICENSE file for details.
@@ -45,5 +45,6 @@ packages = ["viur"]
45
45
  path = "viur/scriptor/__init__.py"
46
46
 
47
47
  [project.urls]
48
- "Homepage" = "https://github.com/viur-framework/viur-scriptor-api"
48
+ "Documentation" = "https://viur-scriptor-api.readthedocs.io"
49
+ "Repository" = "https://github.com/viur-framework/viur-scriptor-api"
49
50
  "Bug Tracker" = "https://github.com/viur-framework/viur-scriptor-api/issues"
@@ -11,7 +11,7 @@ from requests.exceptions import ConnectionError
11
11
  from .directory_handler import DirectoryHandler
12
12
  from .progressbar import ProgressBar
13
13
 
14
- __version__ = '1.2.0'
14
+ __version__ = '1.3.0'
15
15
 
16
16
 
17
17
  def version():
@@ -655,7 +655,12 @@ class Dialog:
655
655
 
656
656
  if is_pyodide_context():
657
657
  @staticmethod
658
- async def multiple(title: str, components: list, send_button_text: str, reuse: bool = False):
658
+ async def multiple(
659
+ title: str,
660
+ components: list[dict] | dict[str, dict],
661
+ send_button_text: str,
662
+ reuse: bool = False
663
+ ):
659
664
  """
660
665
  :param title: the header of the component
661
666
  :param components: list of components
@@ -147,7 +147,7 @@ class SingletonModule(BaseModule):
147
147
 
148
148
 
149
149
  class ExtendedModule(BaseModule):
150
- async def list(self, params: dict = None, group: str = "", skel_type: str = "", **kwargs):
150
+ async def list(self, params: dict = None, group: str = "", skel_type: str = "", limit: int = None, **kwargs):
151
151
  if not params:
152
152
  params = {}
153
153
 
@@ -162,10 +162,6 @@ class ExtendedModule(BaseModule):
162
162
  _url.append(group)
163
163
  _url = join_url(_url)
164
164
 
165
- limit = None
166
- if "limit" in params:
167
- limit = params["limit"]
168
-
169
165
  batch = []
170
166
  cursor = None
171
167
  fetched = False
@@ -175,8 +171,8 @@ class ExtendedModule(BaseModule):
175
171
  for i in batch:
176
172
  yield i
177
173
  counter += 1
178
- if limit and counter >= limit:
179
- return
174
+ if limit and counter >= limit:
175
+ return
180
176
  if fetched and not cursor:
181
177
  return
182
178
  if cursor:
@@ -275,16 +271,18 @@ class ListModule(ExtendedModule):
275
271
  """
276
272
  return await super().add_or_edit(key=key, params=params, group=group, **kwargs)
277
273
 
278
- async def list(self, params: dict = None, group: str = "", **kwargs):
274
+ async def list(self, params: dict = None, group: str = "", limit: int = None, **kwargs):
279
275
  """
280
276
  retrieves multiple records from the database (all if called without parameters)
281
277
 
282
278
  :param params: parameters to pass to the database
283
279
  :param group: the group the records belong to
280
+ :param limit: maximum amount of entries that should be fetched.
281
+ Note: The amount of entries per request/batch must be specified as "limit" in the params.
284
282
  :param kwargs: additional keyword-arguments
285
283
  :return: an asynchronous generator yielding the retrieved records
286
284
  """
287
- async for i in super().list(params=params, group=group, **kwargs):
285
+ async for i in super().list(params=params, group=group, limit=limit, **kwargs):
288
286
  yield i
289
287
 
290
288
  async def add(self, params: dict = None, group: str = "", **kwargs):
@@ -409,16 +407,18 @@ class TreeModule(ExtendedModule):
409
407
  """
410
408
  return await super().edit(key=key, params=params, skel_type=skel_type, **kwargs)
411
409
 
412
- async def list(self, params: dict = None, skel_type: str = "", **kwargs):
410
+ async def list(self, params: dict = None, skel_type: str = "", limit: int = None, **kwargs):
413
411
  """
414
412
  retrieves multiple records from the database (all if called without parameters)
415
413
 
416
414
  :param params: parameters to pass to the database
417
415
  :param skel_type: the skel_type of the record (either "node" or "leaf")
416
+ :param limit: maximum amount of entries that should be fetched.
417
+ Note: The amount of entries per request/batch must be specified as "limit" in the params.
418
418
  :param kwargs: additional keyword-arguments
419
419
  :return: an asynchronous generator yielding the retrieved records
420
420
  """
421
- async for i in super().list(params=params, skel_type=skel_type, **kwargs):
421
+ async for i in super().list(params=params, skel_type=skel_type, limit=limit, **kwargs):
422
422
  yield i
423
423
 
424
424
  async def add(self, params: dict = None, skel_type: str = "", **kwargs):