python-terminusgps 35.6.0__py3-none-any.whl → 36.0.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-35.6.0.dist-info → python_terminusgps-36.0.0.dist-info}/METADATA +1 -1
- {python_terminusgps-35.6.0.dist-info → python_terminusgps-36.0.0.dist-info}/RECORD +5 -5
- terminusgps/wialon/session.py +15 -6
- {python_terminusgps-35.6.0.dist-info → python_terminusgps-36.0.0.dist-info}/WHEEL +0 -0
- {python_terminusgps-35.6.0.dist-info → python_terminusgps-36.0.0.dist-info}/licenses/COPYING +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-terminusgps
|
|
3
|
-
Version:
|
|
3
|
+
Version: 36.0.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://docs.terminusgps.com
|
|
6
6
|
Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
|
|
@@ -37,7 +37,7 @@ terminusgps/twilio/caller.py,sha256=l53-IxXn0wXc_oDcDxfhlrKPz-F4_KfMPV1dAzZjNo4,
|
|
|
37
37
|
terminusgps/wialon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
38
|
terminusgps/wialon/constants.py,sha256=Ju2XL2A4DPFD-w8NjYqEfnnqregl1luPT0XGhGSUnO8,6316
|
|
39
39
|
terminusgps/wialon/flags.py,sha256=M50EdhxQ8IMnJnU0mrHK7-h8Asc6tvNiTOOfd1dBW6A,12815
|
|
40
|
-
terminusgps/wialon/session.py,sha256=
|
|
40
|
+
terminusgps/wialon/session.py,sha256=Aj6GJKVTp5pSGm2x82rz69HaN0GoR0ruKMs6wGsd42w,10591
|
|
41
41
|
terminusgps/wialon/utils.py,sha256=SwpcxLPBLy0u3AT84G-Co4wxmhRrPFyW3jo_9O6ICvk,11008
|
|
42
42
|
terminusgps/wialon/validators.py,sha256=j5vrtcfClAzRdRkWTvRRAmrne1t0R6cKkmYdE7fAkSs,4247
|
|
43
43
|
terminusgps/wialon/items/__init__.py,sha256=3BVthghekMvhMQSzQgBMlD_phxmKSmp3Zvmo-z0O8Bs,211
|
|
@@ -52,7 +52,7 @@ terminusgps/wialon/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
52
52
|
terminusgps/wialon/tests/test_items.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
53
|
terminusgps/wialon/tests/test_session.py,sha256=9mBlYchMo9NeqRIZsmxYzrM1zBHorqu4ooxqSNppLpI,1336
|
|
54
54
|
terminusgps/wialon/tests/test_utils.py,sha256=SK4PxJQGECFnzx_EQeRAQfsQ5_3FLaVcis2W9u_ibuI,1730
|
|
55
|
-
python_terminusgps-
|
|
56
|
-
python_terminusgps-
|
|
57
|
-
python_terminusgps-
|
|
58
|
-
python_terminusgps-
|
|
55
|
+
python_terminusgps-36.0.0.dist-info/METADATA,sha256=9C-ood1Kd272RYbmF1KmGwmlVDVLI2apYkzK5-WSGBs,1616
|
|
56
|
+
python_terminusgps-36.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
57
|
+
python_terminusgps-36.0.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
58
|
+
python_terminusgps-36.0.0.dist-info/RECORD,,
|
terminusgps/wialon/session.py
CHANGED
|
@@ -4,7 +4,6 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import wialon.api
|
|
6
6
|
from django.conf import settings
|
|
7
|
-
from django.utils import timezone
|
|
8
7
|
from loguru import logger
|
|
9
8
|
|
|
10
9
|
|
|
@@ -20,7 +19,12 @@ class WialonAPICall:
|
|
|
20
19
|
|
|
21
20
|
class Wialon(wialon.api.Wialon):
|
|
22
21
|
def __init__(
|
|
23
|
-
self,
|
|
22
|
+
self,
|
|
23
|
+
debug: bool = False,
|
|
24
|
+
log_level: int = 10,
|
|
25
|
+
log_days: int = 10,
|
|
26
|
+
*args,
|
|
27
|
+
**kwargs,
|
|
24
28
|
) -> None:
|
|
25
29
|
super().__init__(*args, **kwargs)
|
|
26
30
|
self.call_history: list[WialonAPICall] = []
|
|
@@ -28,7 +32,7 @@ class Wialon(wialon.api.Wialon):
|
|
|
28
32
|
f"logs/{self.__class__.__name__}.log",
|
|
29
33
|
level=log_level,
|
|
30
34
|
retention=f"{log_days} days",
|
|
31
|
-
diagnose=
|
|
35
|
+
diagnose=debug,
|
|
32
36
|
)
|
|
33
37
|
|
|
34
38
|
@property
|
|
@@ -42,7 +46,10 @@ class Wialon(wialon.api.Wialon):
|
|
|
42
46
|
def call(self, action_name: str, *argc, **kwargs) -> typing.Any:
|
|
43
47
|
logger.debug(f"Executing '{action_name}'...")
|
|
44
48
|
call_record = WialonAPICall(
|
|
45
|
-
action=action_name,
|
|
49
|
+
action=action_name,
|
|
50
|
+
timestamp=datetime.datetime.now(),
|
|
51
|
+
args=argc,
|
|
52
|
+
kwargs=kwargs,
|
|
46
53
|
)
|
|
47
54
|
|
|
48
55
|
try:
|
|
@@ -68,6 +75,7 @@ class WialonSession:
|
|
|
68
75
|
port: int = 443,
|
|
69
76
|
log_level: int = 10,
|
|
70
77
|
log_days: int = 10,
|
|
78
|
+
debug: bool = False,
|
|
71
79
|
) -> None:
|
|
72
80
|
"""
|
|
73
81
|
Starts or continues a Wialon API session.
|
|
@@ -93,9 +101,9 @@ class WialonSession:
|
|
|
93
101
|
f"logs/{self.__class__.__name__}.log",
|
|
94
102
|
level=log_level,
|
|
95
103
|
retention=f"{log_days} days",
|
|
96
|
-
diagnose=settings.DEBUG,
|
|
104
|
+
diagnose=debug or settings.DEBUG if settings.configured else False,
|
|
97
105
|
)
|
|
98
|
-
self._token = token or settings.WIALON_TOKEN
|
|
106
|
+
self._token = token or settings.WIALON_TOKEN if settings.configured else None
|
|
99
107
|
self._username = None
|
|
100
108
|
self._gis_sid = None
|
|
101
109
|
self._hw_gp_ip = None
|
|
@@ -108,6 +116,7 @@ class WialonSession:
|
|
|
108
116
|
sid=sid,
|
|
109
117
|
log_level=log_level,
|
|
110
118
|
log_days=log_days,
|
|
119
|
+
debug=debug,
|
|
111
120
|
)
|
|
112
121
|
|
|
113
122
|
def __str__(self) -> str:
|
|
File without changes
|
{python_terminusgps-35.6.0.dist-info → python_terminusgps-36.0.0.dist-info}/licenses/COPYING
RENAMED
|
File without changes
|