python-terminusgps 52.0.0__py3-none-any.whl → 53.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-terminusgps
3
- Version: 52.0.0
3
+ Version: 53.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://terminusgps.github.io/python-terminusgps
6
6
  Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
@@ -1,10 +1,11 @@
1
1
  terminusgps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  terminusgps/default_settings.py,sha256=QizHKYUN9637Hs5eqi70S-Qj4Hvvu2Ds-a1mWcJ9no4,554
3
- terminusgps/mixins.py,sha256=_RC6GFLG3as1UfuCUm5D0DzlJytofpSkryiCvjWRoqY,788
3
+ terminusgps/mixins.py,sha256=lY5hB6yFAKjW1_xM5eE9Xt9C9JpKcjMoVco55B8j9gw,787
4
4
  terminusgps/validators.py,sha256=ZO3ychuBfpGTLsXFU_PFVMkMOyE1fJIsQh2hYsGDjKM,9508
5
5
  terminusgps/authorizenet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  terminusgps/authorizenet/constants.py,sha256=AfRP-Ta-bZW3LPagGuSqHlXUdANofgL6WaWwoi14As4,3371
7
- terminusgps/authorizenet/service.py,sha256=NXYa7Q27qn3c5-Y8kt82sZlGfeHJikNCgFaaxXnLP54,4230
7
+ terminusgps/authorizenet/service.py,sha256=RklyVxewgyx9NnP-kdICjziAcoha2IJIRf9IVm_9XzY,3551
8
+ terminusgps/authorizenet/utils.py,sha256=zVGWkPc8IfnLPehKxDzgso078qKSJ7f4UN1LYaI5djo,310
8
9
  terminusgps/authorizenet/api/__init__.py,sha256=VXR4Yco1yz5R-R7vgaH2zTP9VFqzfvvGy_XJVjyb3i0,154
9
10
  terminusgps/authorizenet/api/address_profiles.py,sha256=sZgq2mdJIblzroGodgSJXpXhN6eHsOAGmStjP1cpLUE,4907
10
11
  terminusgps/authorizenet/api/customer_profiles.py,sha256=LdOCUd0UyFtXYZ9aw3Emp8zs-7Qp-0VOoiYRj5Jgkj0,5917
@@ -16,7 +17,7 @@ terminusgps/wialon/constants.py,sha256=fs0KpTSEBddYKgvuB6OZfy_JCIgKoiupQJxx53EBg
16
17
  terminusgps/wialon/flags.py,sha256=M50EdhxQ8IMnJnU0mrHK7-h8Asc6tvNiTOOfd1dBW6A,12815
17
18
  terminusgps/wialon/session.py,sha256=oLvO3ktw2skrfNkIfNmMwrUpKFJKzuZJFiDDA1Z3O4g,7074
18
19
  terminusgps/wialon/utils.py,sha256=XRK53G0Ogv3AY-1KrfW_3Tym3D1LOUTRB-lDph-5RNw,6879
19
- python_terminusgps-52.0.0.dist-info/METADATA,sha256=AYdQsLNLxGTPO5dm8ui_wYne0an_95CSRuo5qsXt8es,973
20
- python_terminusgps-52.0.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
21
- python_terminusgps-52.0.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
22
- python_terminusgps-52.0.0.dist-info/RECORD,,
20
+ python_terminusgps-53.0.0.dist-info/METADATA,sha256=LcjQ9km1x9Uj3f2-fj-2vRlOhEoCR9twVddu0k6rK0g,973
21
+ python_terminusgps-53.0.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
22
+ python_terminusgps-53.0.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
23
+ python_terminusgps-53.0.0.dist-info/RECORD,,
@@ -3,14 +3,8 @@ from functools import cached_property
3
3
  from authorizenet.apicontractsv1 import merchantAuthenticationType
4
4
  from authorizenet.apicontrollersbase import APIOperationBase
5
5
  from django.conf import settings
6
- from django.core.exceptions import ImproperlyConfigured
7
6
  from lxml.objectify import ObjectifiedElement
8
7
 
9
- if not settings.configured:
10
- from terminusgps import default_settings
11
-
12
- settings.configure(default_settings)
13
-
14
8
 
15
9
  class AuthorizenetControllerExecutionError(Exception):
16
10
  """Raised when an Authorizenet API controller fails to execute."""
@@ -37,19 +31,6 @@ class AuthorizenetControllerExecutionError(Exception):
37
31
  class AuthorizenetService:
38
32
  """Service for safely interacting with the Authorizenet API."""
39
33
 
40
- REQUIRED_SETTINGS = (
41
- "MERCHANT_AUTH_ENVIRONMENT",
42
- "MERCHANT_AUTH_LOGIN_ID",
43
- "MERCHANT_AUTH_TRANSACTION_KEY",
44
- "MERCHANT_AUTH_VALIDATION_MODE",
45
- )
46
-
47
- def __init__(self) -> None:
48
- """Raises :py:exc:`~django.core.exceptions.ImproperlyConfigured` if required settings weren't set."""
49
- for setting in self.REQUIRED_SETTINGS:
50
- if not hasattr(settings, setting):
51
- raise ImproperlyConfigured(f"'{setting}' setting is required.")
52
-
53
34
  def execute(
54
35
  self,
55
36
  request_tuple: tuple[ObjectifiedElement, type[APIOperationBase]],
@@ -79,7 +60,7 @@ class AuthorizenetService:
79
60
  controller.execute()
80
61
  response = controller.getresponse()
81
62
 
82
- if response is None:
63
+ if not response:
83
64
  raise AuthorizenetControllerExecutionError(
84
65
  message="No response from the Authorizenet API controller.",
85
66
  code="1",
@@ -0,0 +1,13 @@
1
+ import typing
2
+
3
+ T_contract = typing.TypeVar("T_contract")
4
+
5
+
6
+ def build_contract(
7
+ contract_cls: type[T_contract], fields: dict[str, typing.Any]
8
+ ) -> T_contract:
9
+ contract = contract_cls()
10
+ for key, value in fields.items():
11
+ if value:
12
+ setattr(contract, key, value)
13
+ return contract
terminusgps/mixins.py CHANGED
@@ -21,7 +21,6 @@ class HtmxTemplateResponseMixin(TemplateResponseMixin):
21
21
  def get_template_names(self) -> list[str]:
22
22
  hx_request: bool = bool(self.request.headers.get("HX-Request"))
23
23
  hx_boosted: bool = bool(self.request.headers.get("HX-Boosted"))
24
-
25
24
  template_names: list[str] = super().get_template_names()
26
25
  if hx_request and not hx_boosted:
27
26
  template_names.insert(0, self.template_name + self.partial_name)