python-terminusgps 35.6.0__py3-none-any.whl → 36.1.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.

Potentially problematic release.


This version of python-terminusgps might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-terminusgps
3
- Version: 35.6.0
3
+ Version: 36.1.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=09WYWvON_H844IFfdt7_x1we6tHhQSkt9K_BEedBjv0,10396
40
+ terminusgps/wialon/session.py,sha256=jHMr3fQ5tuB3pic73sCZvAsitW3Hcoqzu4X3UblPzvw,10670
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-35.6.0.dist-info/METADATA,sha256=X1DuwOhyOEoHoJjTMXXg5-6RpyXpB0F8m42BY8M4oUE,1616
56
- python_terminusgps-35.6.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
57
- python_terminusgps-35.6.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
58
- python_terminusgps-35.6.0.dist-info/RECORD,,
55
+ python_terminusgps-36.1.0.dist-info/METADATA,sha256=l161qfkVe86AkFOLlo5tDOr0-S5fMj8WBIUlngZ0QIs,1616
56
+ python_terminusgps-36.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
57
+ python_terminusgps-36.1.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
58
+ python_terminusgps-36.1.0.dist-info/RECORD,,
@@ -1,10 +1,10 @@
1
1
  import dataclasses
2
2
  import datetime
3
+ import os
3
4
  import typing
4
5
 
5
6
  import wialon.api
6
7
  from django.conf import settings
7
- from django.utils import timezone
8
8
  from loguru import logger
9
9
 
10
10
 
@@ -20,7 +20,12 @@ class WialonAPICall:
20
20
 
21
21
  class Wialon(wialon.api.Wialon):
22
22
  def __init__(
23
- self, log_level: int = 10, log_days: int = 10, *args, **kwargs
23
+ self,
24
+ debug: bool = False,
25
+ log_level: int = 10,
26
+ log_days: int = 10,
27
+ *args,
28
+ **kwargs,
24
29
  ) -> None:
25
30
  super().__init__(*args, **kwargs)
26
31
  self.call_history: list[WialonAPICall] = []
@@ -28,7 +33,7 @@ class Wialon(wialon.api.Wialon):
28
33
  f"logs/{self.__class__.__name__}.log",
29
34
  level=log_level,
30
35
  retention=f"{log_days} days",
31
- diagnose=settings.DEBUG,
36
+ diagnose=debug,
32
37
  )
33
38
 
34
39
  @property
@@ -42,7 +47,10 @@ class Wialon(wialon.api.Wialon):
42
47
  def call(self, action_name: str, *argc, **kwargs) -> typing.Any:
43
48
  logger.debug(f"Executing '{action_name}'...")
44
49
  call_record = WialonAPICall(
45
- action=action_name, timestamp=timezone.now(), args=argc, kwargs=kwargs
50
+ action=action_name,
51
+ timestamp=datetime.datetime.now(),
52
+ args=argc,
53
+ kwargs=kwargs,
46
54
  )
47
55
 
48
56
  try:
@@ -68,6 +76,7 @@ class WialonSession:
68
76
  port: int = 443,
69
77
  log_level: int = 10,
70
78
  log_days: int = 10,
79
+ debug: bool = False,
71
80
  ) -> None:
72
81
  """
73
82
  Starts or continues a Wialon API session.
@@ -93,9 +102,13 @@ class WialonSession:
93
102
  f"logs/{self.__class__.__name__}.log",
94
103
  level=log_level,
95
104
  retention=f"{log_days} days",
96
- diagnose=settings.DEBUG,
105
+ diagnose=debug or settings.DEBUG if settings.configured else False,
106
+ )
107
+ self._token = (
108
+ token or settings.WIALON_TOKEN
109
+ if settings.configured
110
+ else os.getenv("WIALON_TOKEN")
97
111
  )
98
- self._token = token or settings.WIALON_TOKEN
99
112
  self._username = None
100
113
  self._gis_sid = None
101
114
  self._hw_gp_ip = None
@@ -108,6 +121,7 @@ class WialonSession:
108
121
  sid=sid,
109
122
  log_level=log_level,
110
123
  log_days=log_days,
124
+ debug=debug,
111
125
  )
112
126
 
113
127
  def __str__(self) -> str: