python-terminusgps 37.2.0__py3-none-any.whl → 37.2.2__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-37.2.0.dist-info → python_terminusgps-37.2.2.dist-info}/METADATA +1 -1
- {python_terminusgps-37.2.0.dist-info → python_terminusgps-37.2.2.dist-info}/RECORD +6 -6
- terminusgps/wialon/items/unit.py +7 -3
- terminusgps/wialon/session.py +6 -2
- {python_terminusgps-37.2.0.dist-info → python_terminusgps-37.2.2.dist-info}/WHEEL +0 -0
- {python_terminusgps-37.2.0.dist-info → python_terminusgps-37.2.2.dist-info}/licenses/COPYING +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-terminusgps
|
|
3
|
-
Version: 37.2.
|
|
3
|
+
Version: 37.2.2
|
|
4
4
|
Summary: Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more.
|
|
5
5
|
Project-URL: Documentation, https://docs.terminusgps.com
|
|
6
6
|
Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
|
|
@@ -43,7 +43,7 @@ terminusgps/twilio/caller.py,sha256=RQax2iZ6SYHiuCvBxXkrooRWQ9J8DwKGAjxa8RYjrLI,
|
|
|
43
43
|
terminusgps/wialon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
44
|
terminusgps/wialon/constants.py,sha256=05pLc_0S-x0tT87cQcxOmr8plesjOQxoXfUdjIHwI90,7732
|
|
45
45
|
terminusgps/wialon/flags.py,sha256=M50EdhxQ8IMnJnU0mrHK7-h8Asc6tvNiTOOfd1dBW6A,12815
|
|
46
|
-
terminusgps/wialon/session.py,sha256=
|
|
46
|
+
terminusgps/wialon/session.py,sha256=kkfeqXg2akH_kytcTHsuga3RGpKn8bNcD8NeE3199F8,14843
|
|
47
47
|
terminusgps/wialon/utils.py,sha256=ntHLAVJSJBdIgJK704xxFNFRopaFz-No9YZZOMmvWO8,11627
|
|
48
48
|
terminusgps/wialon/validators.py,sha256=Z2eci8NzKDHU6oXl5ncgeYXmBYg336k-0R2m0DIxsDY,4346
|
|
49
49
|
terminusgps/wialon/items/__init__.py,sha256=3BVthghekMvhMQSzQgBMlD_phxmKSmp3Zvmo-z0O8Bs,211
|
|
@@ -51,14 +51,14 @@ terminusgps/wialon/items/base.py,sha256=vS8xIo5WLiwzpB81i7aHFnwOHzCf4lQG6azjq79H
|
|
|
51
51
|
terminusgps/wialon/items/resource.py,sha256=Rhy2ig-yxznNhi6ZSaUBbu8ViVx0Sg4n_XS08ijgXsA,18280
|
|
52
52
|
terminusgps/wialon/items/retranslator.py,sha256=2J1x7lNxRck-IEXrmJ7RM9bVL60mrZkfmczOSiUhiO8,3873
|
|
53
53
|
terminusgps/wialon/items/route.py,sha256=2dEUK9o8nwutPE03W-5GUcZrjGvbwLoExVnFV9LyedE,1326
|
|
54
|
-
terminusgps/wialon/items/unit.py,sha256=
|
|
54
|
+
terminusgps/wialon/items/unit.py,sha256=udDz1NnFdFAMjnYnzuijbUkqAmPdQKy0MruNA0EDuO0,12018
|
|
55
55
|
terminusgps/wialon/items/unit_group.py,sha256=HhYMZ9b7UATXeEgHkXN9r5-M_w82fabjDYADCUwBtxQ,4442
|
|
56
56
|
terminusgps/wialon/items/user.py,sha256=pR6OTrm6f7Zo0J8eLvKtWVsdhGi430OxMsMMthGh8YE,5382
|
|
57
57
|
terminusgps/wialon/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
58
|
terminusgps/wialon/tests/test_items.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
59
59
|
terminusgps/wialon/tests/test_session.py,sha256=9mBlYchMo9NeqRIZsmxYzrM1zBHorqu4ooxqSNppLpI,1336
|
|
60
60
|
terminusgps/wialon/tests/test_utils.py,sha256=SK4PxJQGECFnzx_EQeRAQfsQ5_3FLaVcis2W9u_ibuI,1730
|
|
61
|
-
python_terminusgps-37.2.
|
|
62
|
-
python_terminusgps-37.2.
|
|
63
|
-
python_terminusgps-37.2.
|
|
64
|
-
python_terminusgps-37.2.
|
|
61
|
+
python_terminusgps-37.2.2.dist-info/METADATA,sha256=ROKVscKY9GHS-sBZuOvWgHdE6eIsINWx6nEQE5E1Xog,1329
|
|
62
|
+
python_terminusgps-37.2.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
63
|
+
python_terminusgps-37.2.2.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
64
|
+
python_terminusgps-37.2.2.dist-info/RECORD,,
|
terminusgps/wialon/items/unit.py
CHANGED
|
@@ -103,9 +103,13 @@ class WialonUnit(WialonBase):
|
|
|
103
103
|
+----------+------------------------------+-----------------+
|
|
104
104
|
|
|
105
105
|
"""
|
|
106
|
-
response =
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
response = (
|
|
107
|
+
self.session.wialon_api.core_search_item(
|
|
108
|
+
**{"id": self.id, "flags": flags.DataFlag.UNIT_POSITION}
|
|
109
|
+
)
|
|
110
|
+
.get("item", {})
|
|
111
|
+
.get("pos", {})
|
|
112
|
+
)
|
|
109
113
|
if response:
|
|
110
114
|
response["t"] = datetime.fromtimestamp(response["t"])
|
|
111
115
|
return response
|
terminusgps/wialon/session.py
CHANGED
|
@@ -299,7 +299,7 @@ class WialonSession:
|
|
|
299
299
|
response = self.wialon_api.token_login(**{"token": token, "fl": flags})
|
|
300
300
|
self._set_login_response(response)
|
|
301
301
|
return response.get("eid")
|
|
302
|
-
except (wialon.api.WialonError,
|
|
302
|
+
except (wialon.api.WialonError, ValueError):
|
|
303
303
|
raise
|
|
304
304
|
|
|
305
305
|
def logout(self) -> None:
|
|
@@ -316,16 +316,20 @@ class WialonSession:
|
|
|
316
316
|
if response.get("error") != 0:
|
|
317
317
|
print(f"Failed to logout of session: '{response.get('message')}'")
|
|
318
318
|
|
|
319
|
-
def _set_login_response(self, login_response: dict) -> None:
|
|
319
|
+
def _set_login_response(self, login_response: dict | None) -> None:
|
|
320
320
|
"""
|
|
321
321
|
Sets the Wialon API session's attributes based on a login response.
|
|
322
322
|
|
|
323
323
|
:param login_response: A response returned from :py:meth:`login` or :py:meth:`duplicate`.
|
|
324
324
|
:type login_response: :py:obj:`dict`
|
|
325
|
+
:raises ValueError: If ``login_response`` wasn't provided.
|
|
325
326
|
:returns: Nothing.
|
|
326
327
|
:rtype: :py:obj:`None`
|
|
327
328
|
|
|
328
329
|
"""
|
|
330
|
+
if login_response is None:
|
|
331
|
+
raise ValueError("Failed to login to Wialon.")
|
|
332
|
+
|
|
329
333
|
self.wialon_api.sid = login_response.get("eid")
|
|
330
334
|
self._gis_geocode = login_response.get("gis_geocode")
|
|
331
335
|
self._gis_render = login_response.get("gis_render")
|
|
File without changes
|
{python_terminusgps-37.2.0.dist-info → python_terminusgps-37.2.2.dist-info}/licenses/COPYING
RENAMED
|
File without changes
|