python-terminusgps 28.2.0__py3-none-any.whl → 28.3.0__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.
- {python_terminusgps-28.2.0.dist-info → python_terminusgps-28.3.0.dist-info}/METADATA +1 -1
- {python_terminusgps-28.2.0.dist-info → python_terminusgps-28.3.0.dist-info}/RECORD +5 -5
- terminusgps/wialon/utils.py +31 -4
- {python_terminusgps-28.2.0.dist-info → python_terminusgps-28.3.0.dist-info}/WHEEL +0 -0
- {python_terminusgps-28.2.0.dist-info → python_terminusgps-28.3.0.dist-info}/licenses/COPYING +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-terminusgps
|
|
3
|
-
Version: 28.
|
|
3
|
+
Version: 28.3.0
|
|
4
4
|
Summary: Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more.
|
|
5
5
|
Project-URL: Documentation, https://app.terminusgps.com/docs/apps/python-terminusgps/index.html
|
|
6
6
|
Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
|
|
@@ -20,7 +20,7 @@ terminusgps/wialon/constants.py,sha256=n1ux68oWYWnzeZdN811Iw_Lk78KBM0YMJMoonn67u
|
|
|
20
20
|
terminusgps/wialon/flags.py,sha256=_NIL3mrEGhvI5YISVjimjYtUatdgOqhZPJX368MtKSU,13959
|
|
21
21
|
terminusgps/wialon/logger.py,sha256=nUBsaLMaffSaAHGHAM6mFXDzix9hbNecVtA3INVtii8,968
|
|
22
22
|
terminusgps/wialon/session.py,sha256=THl88yfVBfRH8daKh1lmLSR8ro8TbyOokHx1Cev-En8,9638
|
|
23
|
-
terminusgps/wialon/utils.py,sha256=
|
|
23
|
+
terminusgps/wialon/utils.py,sha256=qhfO8BtCctd5WtJ6qA5poSpNlefVNA2q2l3S6t5FfTc,7753
|
|
24
24
|
terminusgps/wialon/items/__init__.py,sha256=3BVthghekMvhMQSzQgBMlD_phxmKSmp3Zvmo-z0O8Bs,211
|
|
25
25
|
terminusgps/wialon/items/base.py,sha256=GCSzhDc3bk-jltWYNL60BEYCeSNRsPWos5aeFvgye8Y,7208
|
|
26
26
|
terminusgps/wialon/items/resource.py,sha256=vNR6hJmf23RxsqXpDhM0dODbQB8KKTKcy6ncjpEZty8,14610
|
|
@@ -29,7 +29,7 @@ terminusgps/wialon/items/route.py,sha256=8SzlqNmpYVdt-ZAY--B_KHoDIHgN0Zb7KBsBWAz
|
|
|
29
29
|
terminusgps/wialon/items/unit.py,sha256=i7sQiRu3N0XxyTHVN2RnmjYy9X48KdnZLSB18ic37w8,9363
|
|
30
30
|
terminusgps/wialon/items/unit_group.py,sha256=YsYh34l2DjSKcv5SIZkEVi5FSjveGB1gxU2fwdLyvl4,4101
|
|
31
31
|
terminusgps/wialon/items/user.py,sha256=PFYBie04F16YE2B5364PLxkmlTmQr4sZXpItvRBxsDc,7143
|
|
32
|
-
python_terminusgps-28.
|
|
33
|
-
python_terminusgps-28.
|
|
34
|
-
python_terminusgps-28.
|
|
35
|
-
python_terminusgps-28.
|
|
32
|
+
python_terminusgps-28.3.0.dist-info/METADATA,sha256=cIMJIuKTBl9MXOEdRUBo7bA613l1pIZW-2TmfqmUBFE,946
|
|
33
|
+
python_terminusgps-28.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
34
|
+
python_terminusgps-28.3.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
35
|
+
python_terminusgps-28.3.0.dist-info/RECORD,,
|
terminusgps/wialon/utils.py
CHANGED
|
@@ -7,6 +7,36 @@ from terminusgps.wialon.items.base import WialonBase
|
|
|
7
7
|
from terminusgps.wialon.session import WialonSession
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
def get_resource_ids(session: WialonSession) -> list[int] | None:
|
|
11
|
+
"""
|
|
12
|
+
Returns a list of all resource ids in Wialon.
|
|
13
|
+
|
|
14
|
+
:param session: A valid Wialon API session.
|
|
15
|
+
:type session: :py:obj:`~terminusgps.wialon.session.WialonSession`
|
|
16
|
+
:returns: A list of account ids.
|
|
17
|
+
:rtype: :py:obj:`list`
|
|
18
|
+
|
|
19
|
+
"""
|
|
20
|
+
results = session.wialon_api.core_search_items(
|
|
21
|
+
**{
|
|
22
|
+
"spec": {
|
|
23
|
+
"itemsType": "avl_resource",
|
|
24
|
+
"propName": "sys_id",
|
|
25
|
+
"propValueMask": "*",
|
|
26
|
+
"sortType": "sys_id",
|
|
27
|
+
"propType": "property",
|
|
28
|
+
"or_logic": False,
|
|
29
|
+
},
|
|
30
|
+
"force": 0,
|
|
31
|
+
"flags": 1,
|
|
32
|
+
"from": 0,
|
|
33
|
+
"to": 0,
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
if results:
|
|
37
|
+
return [int(item.get("id")) for item in results.get("items", [])]
|
|
38
|
+
|
|
39
|
+
|
|
10
40
|
def get_hw_type_id(name: str, session: WialonSession) -> int | None:
|
|
11
41
|
"""
|
|
12
42
|
Takes a Wialon hardware type name and returns its id, if it exists.
|
|
@@ -152,10 +182,7 @@ def is_unique(value: str, session: WialonSession, items_type: str = "avl_unit")
|
|
|
152
182
|
response = session.wialon_api.core_check_unique(
|
|
153
183
|
**{"type": items_type, "value": value.strip()}
|
|
154
184
|
)
|
|
155
|
-
|
|
156
|
-
if not response:
|
|
157
|
-
return False
|
|
158
|
-
return bool(response.get("result"))
|
|
185
|
+
return not bool(response.get("result")) if response else False
|
|
159
186
|
|
|
160
187
|
|
|
161
188
|
def generate_wialon_password(length: int = 32) -> str:
|
|
File without changes
|
{python_terminusgps-28.2.0.dist-info → python_terminusgps-28.3.0.dist-info}/licenses/COPYING
RENAMED
|
File without changes
|