python-terminusgps 19.1.1__py3-none-any.whl → 19.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-19.1.1.dist-info → python_terminusgps-19.3.0.dist-info}/METADATA +1 -1
- {python_terminusgps-19.1.1.dist-info → python_terminusgps-19.3.0.dist-info}/RECORD +6 -6
- terminusgps/wialon/items/geofence.py +3 -0
- terminusgps/wialon/session.py +21 -8
- {python_terminusgps-19.1.1.dist-info → python_terminusgps-19.3.0.dist-info}/WHEEL +0 -0
- {python_terminusgps-19.1.1.dist-info → python_terminusgps-19.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: 19.
|
|
3
|
+
Version: 19.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
|
|
@@ -17,11 +17,11 @@ terminusgps/wialon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
|
|
|
17
17
|
terminusgps/wialon/constants.py,sha256=u7y9MsA5LYvjPjxJnCMQdprTF3QhPPR9j4MvzoSNBaw,1628
|
|
18
18
|
terminusgps/wialon/errors.py,sha256=Fl8A0peF5HpDdR3y0r3g86-iQ4kQgye3FYQZKGe3T7Y,984
|
|
19
19
|
terminusgps/wialon/flags.py,sha256=-OoH-eZM54yjRqxsAXL8VImdQu_7C0OAxCrFqaCEuko,13510
|
|
20
|
-
terminusgps/wialon/session.py,sha256=
|
|
20
|
+
terminusgps/wialon/session.py,sha256=IPt9Q4CmzQ5AU27z6LoUaPO1PkAX_H0nIwCSCAOHNdY,11243
|
|
21
21
|
terminusgps/wialon/utils.py,sha256=KeZmV-MEdGOHXrsyn6IIoyX0EgVYiWYjvacXyZVr1u8,6501
|
|
22
22
|
terminusgps/wialon/items/__init__.py,sha256=cfUC5sfVsTwmpgsR-w9wA4ay6_EZYAPgEeuw2k06RJM,256
|
|
23
23
|
terminusgps/wialon/items/base.py,sha256=EAtzlnCvB7WTu3iX1bV1-S9TvwXc-Eez7e0X4TMiK9U,6943
|
|
24
|
-
terminusgps/wialon/items/geofence.py,sha256=
|
|
24
|
+
terminusgps/wialon/items/geofence.py,sha256=LOjWWtRpAFMhE_16SU4sqNEZphmswpeTNtiFCZBB5Ig,1740
|
|
25
25
|
terminusgps/wialon/items/notification.py,sha256=6IrswN6fdEkJErIqtMq45bTl9xVARQw8nokDsy3x1MA,97
|
|
26
26
|
terminusgps/wialon/items/resource.py,sha256=79SwbCyE1zlaoeBfU0erEqvqBAYUC4KAKs8AOLJqflU,9652
|
|
27
27
|
terminusgps/wialon/items/retranslator.py,sha256=8q9EDc92w92MElnHIeEzH3Ra4kiPXrx4t9V5nPDZuRU,3728
|
|
@@ -29,7 +29,7 @@ terminusgps/wialon/items/route.py,sha256=PTJx1gmT_PGz7nlSSUS2VzjYD-aAuvkEOIdIFne
|
|
|
29
29
|
terminusgps/wialon/items/unit.py,sha256=PwF7xlpDWI5MpM_u6TmYZjNHWk6TSKM4rJ4OB9CIn4A,7533
|
|
30
30
|
terminusgps/wialon/items/unit_group.py,sha256=xc7zYitPE59_WYS-G857jeIQnQcUAxLBH3X6Y1VDg_8,4089
|
|
31
31
|
terminusgps/wialon/items/user.py,sha256=INwAibQVmjNNelepQXMfDevgJqMvIjHHgEjAMLRvhB0,7082
|
|
32
|
-
python_terminusgps-19.
|
|
33
|
-
python_terminusgps-19.
|
|
34
|
-
python_terminusgps-19.
|
|
35
|
-
python_terminusgps-19.
|
|
32
|
+
python_terminusgps-19.3.0.dist-info/METADATA,sha256=I61CjEuSHa8Y8yr2VurF9-i_8CnokrnGiHlCKn641MY,912
|
|
33
|
+
python_terminusgps-19.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
34
|
+
python_terminusgps-19.3.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
35
|
+
python_terminusgps-19.3.0.dist-info/RECORD,,
|
terminusgps/wialon/session.py
CHANGED
|
@@ -45,8 +45,7 @@ class Wialon(WialonAPI):
|
|
|
45
45
|
return len(self.failed_calls) / self.total_calls
|
|
46
46
|
|
|
47
47
|
def call(self, action_name: str, *argc, **kwargs) -> typing.Any:
|
|
48
|
-
self.logger.
|
|
49
|
-
self.logger.debug(f"Executing '{action_name}' using: '{kwargs}'")
|
|
48
|
+
self.logger.debug(f"Executing '{action_name}'...")
|
|
50
49
|
call_record = WialonAPICall(
|
|
51
50
|
action=action_name, timestamp=timezone.now(), args=argc, kwargs=kwargs
|
|
52
51
|
)
|
|
@@ -54,6 +53,7 @@ class Wialon(WialonAPI):
|
|
|
54
53
|
try:
|
|
55
54
|
result = super().call(action_name, *argc, **kwargs)
|
|
56
55
|
call_record.result = result
|
|
56
|
+
self.logger.debug(f"Executed '{action_name}' successfully.")
|
|
57
57
|
return result
|
|
58
58
|
except WialonError as e:
|
|
59
59
|
self.logger.warning(f"Failed to execute '{action_name}': '{e}'")
|
|
@@ -102,7 +102,7 @@ class WialonSession:
|
|
|
102
102
|
self.wialon_api = Wialon(
|
|
103
103
|
scheme=scheme, host=host, port=port, sid=sid, log_level=log_level
|
|
104
104
|
)
|
|
105
|
-
self.
|
|
105
|
+
self._token = token or settings.WIALON_TOKEN
|
|
106
106
|
self.login_id = uid
|
|
107
107
|
self._username = None
|
|
108
108
|
self._gis_sid = None
|
|
@@ -275,11 +275,7 @@ class WialonSession:
|
|
|
275
275
|
:value: :confval:`WIALON_TOKEN`
|
|
276
276
|
|
|
277
277
|
"""
|
|
278
|
-
return self._token
|
|
279
|
-
|
|
280
|
-
@token.setter
|
|
281
|
-
def token(self, value: str | None = None) -> None:
|
|
282
|
-
self._token = value if value else settings.WIALON_TOKEN
|
|
278
|
+
return str(self._token)
|
|
283
279
|
|
|
284
280
|
def login(self, token: str, flags: int = sum([0x1, 0x2, 0x20])) -> str:
|
|
285
281
|
"""
|
|
@@ -367,3 +363,20 @@ class WialonSessionManager:
|
|
|
367
363
|
if not self._session:
|
|
368
364
|
self._session = WialonSession(sid=sid, log_level=log_level)
|
|
369
365
|
return self._session
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
def main() -> None:
|
|
369
|
+
# Usage example
|
|
370
|
+
session = WialonSession() # Instantiate session
|
|
371
|
+
session.login(settings.WIALON_TOKEN) # Login to session
|
|
372
|
+
session.wialon_api.avl_evts() # Call Wialon API
|
|
373
|
+
session.logout() # Logout of session
|
|
374
|
+
|
|
375
|
+
# Alternatively, use a context manager to handle logging in and out
|
|
376
|
+
with WialonSession() as session:
|
|
377
|
+
session.wialon_api.avl_evts() # Call Wialon API, logout when scope ends
|
|
378
|
+
return
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
if __name__ == "__main__":
|
|
382
|
+
main()
|
|
File without changes
|
{python_terminusgps-19.1.1.dist-info → python_terminusgps-19.3.0.dist-info}/licenses/COPYING
RENAMED
|
File without changes
|