python-terminusgps 36.8.0__py3-none-any.whl → 36.9.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-36.8.0.dist-info → python_terminusgps-36.9.0.dist-info}/METADATA +1 -1
- {python_terminusgps-36.8.0.dist-info → python_terminusgps-36.9.0.dist-info}/RECORD +6 -6
- terminusgps/authorizenet/utils.py +17 -0
- terminusgps/wialon/session.py +78 -4
- {python_terminusgps-36.8.0.dist-info → python_terminusgps-36.9.0.dist-info}/WHEEL +0 -0
- {python_terminusgps-36.8.0.dist-info → python_terminusgps-36.9.0.dist-info}/licenses/COPYING +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-terminusgps
|
|
3
|
-
Version: 36.
|
|
3
|
+
Version: 36.9.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
|
|
@@ -3,7 +3,7 @@ terminusgps/authorizenet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
3
3
|
terminusgps/authorizenet/auth.py,sha256=g2tJPxP9V1nXnUcKzhHSRSs6ruSIHej5_hcf8P7bod8,1262
|
|
4
4
|
terminusgps/authorizenet/constants.py,sha256=xmulPmiBLhFfZoc7Il3l-DZA9Nq5HSaJmJKU-v-5X-Y,420
|
|
5
5
|
terminusgps/authorizenet/controllers.py,sha256=9t62qdGpmAkP4tNyPefd7vBRutXvMWsxql6z_pg52Bg,2146
|
|
6
|
-
terminusgps/authorizenet/utils.py,sha256=
|
|
6
|
+
terminusgps/authorizenet/utils.py,sha256=ve8aysWYa-rRmcrgSGP8Aqnxoe83BcZ_ljF0Ran9C1k,8749
|
|
7
7
|
terminusgps/authorizenet/profiles/__init__.py,sha256=IG4XCEEYtHKqXOatlZlob6J3ukAgF7cFR-RXxOSMS1c,161
|
|
8
8
|
terminusgps/authorizenet/profiles/addresses.py,sha256=5GudJStBa4P0Hd7G_hRFH2C-WpICAH_k3MT9YJkicKw,6305
|
|
9
9
|
terminusgps/authorizenet/profiles/base.py,sha256=Pu1NGrvC5Ox2W1oZuVcPqUw3aUoSK191Evexw1U6_3k,3940
|
|
@@ -37,7 +37,7 @@ terminusgps/twilio/caller.py,sha256=RQax2iZ6SYHiuCvBxXkrooRWQ9J8DwKGAjxa8RYjrLI,
|
|
|
37
37
|
terminusgps/wialon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
38
|
terminusgps/wialon/constants.py,sha256=05pLc_0S-x0tT87cQcxOmr8plesjOQxoXfUdjIHwI90,7732
|
|
39
39
|
terminusgps/wialon/flags.py,sha256=M50EdhxQ8IMnJnU0mrHK7-h8Asc6tvNiTOOfd1dBW6A,12815
|
|
40
|
-
terminusgps/wialon/session.py,sha256=
|
|
40
|
+
terminusgps/wialon/session.py,sha256=eWRAWEikYdGr-0xa6yGHfTAxlCx9-1vsZDNwNZUJjZM,13771
|
|
41
41
|
terminusgps/wialon/utils.py,sha256=iGOY8v7cNaSoA9Mo17d1bKAQMBtcotGq3FEQrghgvCo,11222
|
|
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-36.
|
|
56
|
-
python_terminusgps-36.
|
|
57
|
-
python_terminusgps-36.
|
|
58
|
-
python_terminusgps-36.
|
|
55
|
+
python_terminusgps-36.9.0.dist-info/METADATA,sha256=elyVSpvv-SXSHpKr6zZ1gkKTJaBJPIATgQ0VY9ZvrGc,1264
|
|
56
|
+
python_terminusgps-36.9.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
57
|
+
python_terminusgps-36.9.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
58
|
+
python_terminusgps-36.9.0.dist-info/RECORD,,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
|
|
1
3
|
from authorizenet import apicontractsv1, apicontrollers
|
|
2
4
|
from django import forms
|
|
3
5
|
|
|
@@ -5,6 +7,21 @@ from .auth import get_merchant_auth
|
|
|
5
7
|
from .controllers import AuthorizenetControllerExecutor
|
|
6
8
|
|
|
7
9
|
|
|
10
|
+
def get_days_between(start_date: datetime.date, end_date: datetime.date) -> int:
|
|
11
|
+
"""
|
|
12
|
+
Returns the total number of days between two dates.
|
|
13
|
+
|
|
14
|
+
:param start_date: Start date.
|
|
15
|
+
:type start_date: :py:obj:`~datetime.date`
|
|
16
|
+
:param end_date: End date.
|
|
17
|
+
:type end_date: :py:obj:`~datetime.date`
|
|
18
|
+
:returns: The number of days between the dates as an integer.
|
|
19
|
+
:rtype: :py:obj:`int`
|
|
20
|
+
|
|
21
|
+
"""
|
|
22
|
+
return (end_date - start_date).days
|
|
23
|
+
|
|
24
|
+
|
|
8
25
|
def get_payment_profile_transactions(
|
|
9
26
|
customer_profile_id: int | str,
|
|
10
27
|
payment_profile_id: int | str,
|
terminusgps/wialon/session.py
CHANGED
|
@@ -357,9 +357,9 @@ class WialonSessionManager:
|
|
|
357
357
|
:rtype: :py:obj:`None`
|
|
358
358
|
|
|
359
359
|
"""
|
|
360
|
-
self.
|
|
361
|
-
self.
|
|
362
|
-
self.
|
|
360
|
+
self._token = token
|
|
361
|
+
self._lifetime = lifetime
|
|
362
|
+
self._session = WialonSession(sid=None)
|
|
363
363
|
self.session.login(token=self.token)
|
|
364
364
|
|
|
365
365
|
def check_active(self) -> bool:
|
|
@@ -400,7 +400,7 @@ class WialonSessionManager:
|
|
|
400
400
|
@property
|
|
401
401
|
def sid(self) -> str | None:
|
|
402
402
|
"""
|
|
403
|
-
Current
|
|
403
|
+
Current Wialon session id.
|
|
404
404
|
|
|
405
405
|
:type: :py:obj:`str` | :py:obj:`None`
|
|
406
406
|
|
|
@@ -419,3 +419,77 @@ class WialonSessionManager:
|
|
|
419
419
|
|
|
420
420
|
"""
|
|
421
421
|
self.session.wialon_api.sid = other
|
|
422
|
+
|
|
423
|
+
@property
|
|
424
|
+
def token(self) -> str:
|
|
425
|
+
"""
|
|
426
|
+
A Wialon API token.
|
|
427
|
+
|
|
428
|
+
:type: :py:obj:`str`
|
|
429
|
+
|
|
430
|
+
"""
|
|
431
|
+
return str(self._token)
|
|
432
|
+
|
|
433
|
+
@token.setter
|
|
434
|
+
def token(self, other: str | None) -> None:
|
|
435
|
+
"""
|
|
436
|
+
Sets :py:attr:`token` to ``other`` if provided.
|
|
437
|
+
|
|
438
|
+
If ``other`` isn't provided, instead sets :py:attr:`token` to :confval:`WIALON_TOKEN`.
|
|
439
|
+
|
|
440
|
+
:param other: A Wialon API token.
|
|
441
|
+
:type other: :py:obj:`str` | :py:obj:`None`
|
|
442
|
+
:returns: Nothing.
|
|
443
|
+
:rtype: :py:obj:`None`
|
|
444
|
+
|
|
445
|
+
"""
|
|
446
|
+
if other is None:
|
|
447
|
+
self._token = settings.WIALON_TOKEN
|
|
448
|
+
self._token = other
|
|
449
|
+
|
|
450
|
+
@property
|
|
451
|
+
def session(self) -> WialonSession:
|
|
452
|
+
"""
|
|
453
|
+
A Wialon API session.
|
|
454
|
+
|
|
455
|
+
:type: :py:obj:`~terminusgps.wialon.session.WialonSession`
|
|
456
|
+
|
|
457
|
+
"""
|
|
458
|
+
return self._session
|
|
459
|
+
|
|
460
|
+
@session.setter
|
|
461
|
+
def session(self, other: WialonSession) -> None:
|
|
462
|
+
"""
|
|
463
|
+
Sets :py:attr:`session` to ``other``.
|
|
464
|
+
|
|
465
|
+
:param other: A Wialon session.
|
|
466
|
+
:type other: :py:obj:`~terminusgps.wialon.session.WialonSession`
|
|
467
|
+
:returns: Nothing.
|
|
468
|
+
:rtype: :py:obj:`None`
|
|
469
|
+
|
|
470
|
+
"""
|
|
471
|
+
self._session = other
|
|
472
|
+
|
|
473
|
+
@property
|
|
474
|
+
def lifetime(self) -> int:
|
|
475
|
+
"""
|
|
476
|
+
How long in seconds a Wialon session can live for.
|
|
477
|
+
|
|
478
|
+
:type: :py:obj:`int`
|
|
479
|
+
:value: :py:obj:`500`
|
|
480
|
+
|
|
481
|
+
"""
|
|
482
|
+
return self._lifetime
|
|
483
|
+
|
|
484
|
+
@lifetime.setter
|
|
485
|
+
def lifetime(self, other: int) -> None:
|
|
486
|
+
"""
|
|
487
|
+
Sets :py:attr:`lifetime` to ``other``.
|
|
488
|
+
|
|
489
|
+
:param other: An integer.
|
|
490
|
+
:type other: :py:obj:`int`
|
|
491
|
+
:returns: Nothing.
|
|
492
|
+
:rtype: :py:obj:`None`
|
|
493
|
+
|
|
494
|
+
"""
|
|
495
|
+
self._lifetime = other
|
|
File without changes
|
{python_terminusgps-36.8.0.dist-info → python_terminusgps-36.9.0.dist-info}/licenses/COPYING
RENAMED
|
File without changes
|