python-terminusgps 37.4.0__py3-none-any.whl → 37.4.1__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: 37.4.0
3
+ Version: 37.4.1
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
@@ -46,7 +46,7 @@ terminusgps/wialon/flags.py,sha256=M50EdhxQ8IMnJnU0mrHK7-h8Asc6tvNiTOOfd1dBW6A,1
46
46
  terminusgps/wialon/renderer.py,sha256=ubmaLjdJyksO2qiWHbIBvYeDqlFya2br7oJYsdfoyV8,7046
47
47
  terminusgps/wialon/session.py,sha256=cMpAdGQQZG8uLYJcGB9NFXk5JBaMNpY6T_QuQffsB_k,10096
48
48
  terminusgps/wialon/utils.py,sha256=ntHLAVJSJBdIgJK704xxFNFRopaFz-No9YZZOMmvWO8,11627
49
- terminusgps/wialon/validators.py,sha256=Z2eci8NzKDHU6oXl5ncgeYXmBYg336k-0R2m0DIxsDY,4346
49
+ terminusgps/wialon/validators.py,sha256=o5__H9HHnGYth8QAKErJG5rEub7FnT8ue0S3IQ8b67o,4232
50
50
  terminusgps/wialon/items/__init__.py,sha256=3BVthghekMvhMQSzQgBMlD_phxmKSmp3Zvmo-z0O8Bs,211
51
51
  terminusgps/wialon/items/base.py,sha256=vS8xIo5WLiwzpB81i7aHFnwOHzCf4lQG6azjq79HDM4,11775
52
52
  terminusgps/wialon/items/resource.py,sha256=Rhy2ig-yxznNhi6ZSaUBbu8ViVx0Sg4n_XS08ijgXsA,18280
@@ -59,7 +59,7 @@ terminusgps/wialon/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
59
59
  terminusgps/wialon/tests/test_items.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
60
  terminusgps/wialon/tests/test_session.py,sha256=9mBlYchMo9NeqRIZsmxYzrM1zBHorqu4ooxqSNppLpI,1336
61
61
  terminusgps/wialon/tests/test_utils.py,sha256=SK4PxJQGECFnzx_EQeRAQfsQ5_3FLaVcis2W9u_ibuI,1730
62
- python_terminusgps-37.4.0.dist-info/METADATA,sha256=4abh8CpLW2WBcK5GuX4OhzUJGewoOCK7_60AuwefS64,1329
63
- python_terminusgps-37.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
64
- python_terminusgps-37.4.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
65
- python_terminusgps-37.4.0.dist-info/RECORD,,
62
+ python_terminusgps-37.4.1.dist-info/METADATA,sha256=aup47rPICKUE0KbX435n2x7HH8GO9VcOPii0qCSvKBo,1329
63
+ python_terminusgps-37.4.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
64
+ python_terminusgps-37.4.1.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
65
+ python_terminusgps-37.4.1.dist-info/RECORD,,
@@ -4,7 +4,7 @@ from django.conf import settings
4
4
  from django.core.exceptions import ImproperlyConfigured, ValidationError
5
5
  from django.utils.translation import gettext_lazy as _
6
6
 
7
- from .session import WialonSessionManager
7
+ from .session import WialonSession
8
8
 
9
9
  if settings.configured and not hasattr(settings, "WIALON_TOKEN"):
10
10
  raise ImproperlyConfigured("'WIALON_TOKEN' setting is required.")
@@ -12,7 +12,8 @@ if settings.configured and not hasattr(settings, "WIALON_TOKEN"):
12
12
 
13
13
  class WialonValidatorBase:
14
14
  def __init__(self) -> None:
15
- self.session_manager = WialonSessionManager(token=settings.WIALON_TOKEN)
15
+ self.session = WialonSession()
16
+ self.session.login(self.session.token)
16
17
 
17
18
  def __call__(self, value: str) -> None:
18
19
  raise NotImplementedError("Subclasses must implement this method.")
@@ -20,8 +21,7 @@ class WialonValidatorBase:
20
21
 
21
22
  class WialonVinNumberValidator(WialonValidatorBase):
22
23
  def __call__(self, value: str) -> None:
23
- session = self.session_manager.get_session(sid=None)
24
- response = session.wialon_api.unit_get_vin_info(vin=value)
24
+ response = self.session.wialon_api.unit_get_vin_info(vin=value)
25
25
  if "error" in response["vin_lookup_result"].keys():
26
26
  raise ValidationError(
27
27
  _("Failed to get info for VIN # '%(value)s': '%(message)s'"),
@@ -35,8 +35,7 @@ class WialonVinNumberValidator(WialonValidatorBase):
35
35
 
36
36
  class WialonImeiNumberValidator(WialonValidatorBase):
37
37
  def __call__(self, value: str) -> None:
38
- session = self.session_manager.get_session(sid=None)
39
- response = session.wialon_api.core_search_items(
38
+ response = self.session.wialon_api.core_search_items(
40
39
  **{
41
40
  "spec": {
42
41
  "itemsType": "avl_unit",