hcs-core 0.1.303__tar.gz → 0.1.305__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.
- {hcs_core-0.1.303 → hcs_core-0.1.305}/PKG-INFO +1 -1
- hcs_core-0.1.305/hcs_core/__init__.py +1 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/util/query_util.py +17 -8
- hcs_core-0.1.303/hcs_core/__init__.py +0 -1
- {hcs_core-0.1.303 → hcs_core-0.1.305}/.gitignore +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/README.md +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/__init__.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/_init.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/built_in_cmds/__init__.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/built_in_cmds/_ut.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/built_in_cmds/context.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/built_in_cmds/profile.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/cli_options.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/cli_processor.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/cmd_util.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/config.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/context.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/data_util.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/dispatcher.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/duration.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/extension.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/fn_util.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/fstore.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/jsondot.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/logger.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/profile.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/profile_store.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/recent.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/state.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/task_schd.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/telemetry.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/template_util.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/timeutil.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/util.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/ctxp/var_template.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/plan/__init__.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/plan/actions.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/plan/base_provider.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/plan/context.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/plan/core.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/plan/dag.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/plan/helper.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/plan/kop.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/plan/provider/__init__.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/plan/provider/dev/__init__.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/plan/provider/dev/_prepare.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/plan/provider/dev/dummy.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/plan/provider/dev/fibonacci.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/sglib/__init__.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/sglib/auth.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/sglib/cli_options.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/sglib/client_util.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/sglib/csp.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/sglib/ez_client.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/sglib/hcs_client.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/sglib/init.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/sglib/login_support.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/sglib/payload_util.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/sglib/requtil.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/sglib/utils.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/util/__init__.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/util/check_license.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/util/duration.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/util/exit.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/util/hcs_constants.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/util/job_view.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/util/pki_util.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/util/scheduler.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/util/ssl_util.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/hcs_core/util/versions.py +0 -0
- {hcs_core-0.1.303 → hcs_core-0.1.305}/pyproject.toml +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.305"
|
|
@@ -40,7 +40,11 @@ def with_query(url: str, **kwargs: Any) -> str:
|
|
|
40
40
|
class PageRequest:
|
|
41
41
|
def __init__(self, fn_get_page: Callable, fn_filter: Callable = None, **kwargs):
|
|
42
42
|
limit = kwargs.get("limit")
|
|
43
|
-
|
|
43
|
+
if limit is None or limit == "":
|
|
44
|
+
limit = 10
|
|
45
|
+
else:
|
|
46
|
+
limit = int(limit)
|
|
47
|
+
self.limit = limit
|
|
44
48
|
self.fn_get_page = fn_get_page
|
|
45
49
|
self.fn_filter = fn_filter
|
|
46
50
|
self.query = _remove_none(dict(kwargs))
|
|
@@ -57,12 +61,14 @@ class PageRequest:
|
|
|
57
61
|
params["size"] = size
|
|
58
62
|
|
|
59
63
|
query_string = urlencode(params)
|
|
60
|
-
|
|
61
|
-
if not
|
|
64
|
+
page_data = self.fn_get_page(query_string)
|
|
65
|
+
if not page_data or not page_data.content:
|
|
62
66
|
return [], False
|
|
67
|
+
content = page_data.content
|
|
63
68
|
if self.fn_filter:
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
content = list(filter(self.fn_filter, content))
|
|
70
|
+
has_next = page_data.get("totalPages", 0) > page + 1
|
|
71
|
+
return content, has_next
|
|
66
72
|
|
|
67
73
|
def get(self) -> list:
|
|
68
74
|
ret = []
|
|
@@ -83,12 +89,15 @@ class PageRequest:
|
|
|
83
89
|
else:
|
|
84
90
|
content = page.content
|
|
85
91
|
ret += content
|
|
86
|
-
if len(ret) > self.limit:
|
|
92
|
+
if self.limit > 0 and len(ret) > self.limit:
|
|
87
93
|
ret = ret[: self.limit]
|
|
88
94
|
break
|
|
89
|
-
if len(page.content) < self.query["size"]:
|
|
90
|
-
|
|
95
|
+
# if len(page.content) < self.query["size"]:
|
|
96
|
+
# break # no more items
|
|
97
|
+
total_pages = page.get("totalPages", 0)
|
|
91
98
|
page_index += 1
|
|
99
|
+
if page_index >= total_pages:
|
|
100
|
+
break
|
|
92
101
|
|
|
93
102
|
return ret
|
|
94
103
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.303"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|