python-terminusgps 1.5.10__tar.gz → 1.6.0__tar.gz

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.
Files changed (27) hide show
  1. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/PKG-INFO +1 -1
  2. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/pyproject.toml +1 -1
  3. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/wialon/session.py +21 -8
  4. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/uv.lock +13 -13
  5. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/.gitignore +0 -0
  6. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/COPYING +0 -0
  7. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/README.md +0 -0
  8. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/requirements.txt +0 -0
  9. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/__init__.py +0 -0
  10. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/authorizenet/__init__.py +0 -0
  11. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/authorizenet/auth.py +0 -0
  12. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/aws/__init__.py +0 -0
  13. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/aws/secrets.py +0 -0
  14. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/settings.py +0 -0
  15. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/wialon/__init__.py +0 -0
  16. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/wialon/constants.py +0 -0
  17. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/wialon/errors.py +0 -0
  18. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/wialon/flags.py +0 -0
  19. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/wialon/items/__init__.py +0 -0
  20. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/wialon/items/base.py +0 -0
  21. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/wialon/items/resource.py +0 -0
  22. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/wialon/items/retranslator.py +0 -0
  23. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/wialon/items/route.py +0 -0
  24. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/wialon/items/unit.py +0 -0
  25. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/wialon/items/unit_group.py +0 -0
  26. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/wialon/items/user.py +0 -0
  27. {python_terminusgps-1.5.10 → python_terminusgps-1.6.0}/terminusgps/wialon/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-terminusgps
3
- Version: 1.5.10
3
+ Version: 1.6.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://app.terminusgps.com/docs/apps/python-terminusgps/index.html
6
6
  Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-terminusgps"
3
- version = "1.5.10"
3
+ version = "1.6.0"
4
4
  description = "Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more."
5
5
  readme = "README.md"
6
6
  authors = [ {name = "Blake Nall", email = "blake@terminusgps.com" } ]
@@ -1,3 +1,5 @@
1
+ import threading
2
+
1
3
  from wialon.api import Wialon, WialonError
2
4
  from django.conf import settings
3
5
  from django.core.exceptions import ImproperlyConfigured
@@ -307,13 +309,24 @@ class WialonSession:
307
309
  self._wsdk_version = login_response.get("wsdk_version")
308
310
 
309
311
 
310
- def main() -> None:
311
- session = WialonSession()
312
- session.login(token=settings.WIALON_TOKEN)
313
- session.duplicate(username="chrissyron@gmail.com", continued=False)
314
- session.logout()
315
- return
312
+ class WialonSessionManager:
313
+ _instance = None
314
+ _lock = threading.Lock()
315
+ _session = None
316
+
317
+ def __new__(cls) -> "WialonSessionManager":
318
+ with cls._lock:
319
+ if not cls._instance:
320
+ cls._instance = super().__new__(cls)
321
+ return cls._instance
316
322
 
323
+ def get_session(self, sid: str | None = None) -> WialonSession:
324
+ if not hasattr(settings, "WIALON_TOKEN"):
325
+ raise ImproperlyConfigured("'WIALON_TOKEN' setting is required.")
317
326
 
318
- if __name__ == "__main__":
319
- main()
327
+ with self._lock:
328
+ if not self._session or not self._session.active:
329
+ self._session = WialonSession(sid=sid)
330
+ if not self._session.active:
331
+ self._session.login(settings.WIALON_TOKEN)
332
+ return self._session
@@ -50,30 +50,30 @@ wheels = [
50
50
 
51
51
  [[package]]
52
52
  name = "boto3"
53
- version = "1.36.2"
53
+ version = "1.36.9"
54
54
  source = { registry = "https://pypi.org/simple" }
55
55
  dependencies = [
56
56
  { name = "botocore" },
57
57
  { name = "jmespath" },
58
58
  { name = "s3transfer" },
59
59
  ]
60
- sdist = { url = "https://files.pythonhosted.org/packages/3a/e9/c0b2fa75efc4007ea1af21bc2fcbedf6e545c517fb90904d7f59850e02bf/boto3-1.36.2.tar.gz", hash = "sha256:fde1c29996b77274a60b7bc9f741525afa6267bb1716eb644a764fb7c124a0d2", size = 110998 }
60
+ sdist = { url = "https://files.pythonhosted.org/packages/01/36/2e445688adf538259f469bd1f415619959df2aa9ac2972df8a5728791898/boto3-1.36.9.tar.gz", hash = "sha256:035ed3868ff3b9afe05a49d0bde35582315bc438e60b5e76727a00b107567bfb", size = 111028 }
61
61
  wheels = [
62
- { url = "https://files.pythonhosted.org/packages/17/c2/72a92794237b43f64141e156bc3a58bc36d18631f1a614e1e97a48b56447/boto3-1.36.2-py3-none-any.whl", hash = "sha256:76cfc9a705be46e8d22607efacc8d688c064f923d785a01c00b28e9a96425d1a", size = 139166 },
62
+ { url = "https://files.pythonhosted.org/packages/16/27/d5a257251bd046409505034d76c7a76a692dd8d4aa31bdc1ebef7881ef1e/boto3-1.36.9-py3-none-any.whl", hash = "sha256:440d0b70990efb732f63b40fa16c663c86fee80347eb4bf3bcc08b593e8ac77f", size = 139166 },
63
63
  ]
64
64
 
65
65
  [[package]]
66
66
  name = "botocore"
67
- version = "1.36.2"
67
+ version = "1.36.9"
68
68
  source = { registry = "https://pypi.org/simple" }
69
69
  dependencies = [
70
70
  { name = "jmespath" },
71
71
  { name = "python-dateutil" },
72
72
  { name = "urllib3" },
73
73
  ]
74
- sdist = { url = "https://files.pythonhosted.org/packages/c6/93/353b70cea6447e37789fc2d6f761fc12ae36fb4adb6f558055de8cdf655f/botocore-1.36.2.tar.gz", hash = "sha256:a1fe6610983f0214b0c7655fe6990b6a731746baf305b182976fc7b568fc3cb0", size = 13505440 }
74
+ sdist = { url = "https://files.pythonhosted.org/packages/e9/1e/976c79eeac461ddbf64b27ce42788c1f26e111c138bb931d14b4062127e5/botocore-1.36.9.tar.gz", hash = "sha256:cb3baefdb8326fdfae0750015e5868330e18d3a088a31da658df2cc8cba7ac73", size = 13493557 }
75
75
  wheels = [
76
- { url = "https://files.pythonhosted.org/packages/0c/fe/c066e8cb069027c12dbcf9066a7a4f3e9d2a31b10c7b174a8455ef1d0f46/botocore-1.36.2-py3-none-any.whl", hash = "sha256:bc3b7e3b573a48af2bd7116b80fe24f9a335b0b67314dcb2697a327d009abf29", size = 13302324 },
76
+ { url = "https://files.pythonhosted.org/packages/52/e9/fc6e02d198d52818e6658c727a250e89c7570323fc983468f76d761563f1/botocore-1.36.9-py3-none-any.whl", hash = "sha256:e31d206c7708300c541d0799df73b576bbe7d8bed011687d96323ed48763ffd2", size = 13321702 },
77
77
  ]
78
78
 
79
79
  [[package]]
@@ -285,7 +285,7 @@ wheels = [
285
285
 
286
286
  [[package]]
287
287
  name = "python-terminusgps"
288
- version = "1.5.7"
288
+ version = "1.6.0"
289
289
  source = { editable = "." }
290
290
  dependencies = [
291
291
  { name = "argparse" },
@@ -355,14 +355,14 @@ wheels = [
355
355
 
356
356
  [[package]]
357
357
  name = "s3transfer"
358
- version = "0.11.1"
358
+ version = "0.11.2"
359
359
  source = { registry = "https://pypi.org/simple" }
360
360
  dependencies = [
361
361
  { name = "botocore" },
362
362
  ]
363
- sdist = { url = "https://files.pythonhosted.org/packages/1a/aa/fdd958c626b00e3f046d4004363e7f1a2aba4354f78d65ceb3b217fa5eb8/s3transfer-0.11.1.tar.gz", hash = "sha256:3f25c900a367c8b7f7d8f9c34edc87e300bde424f779dc9f0a8ae4f9df9264f6", size = 146952 }
363
+ sdist = { url = "https://files.pythonhosted.org/packages/62/45/2323b5928f86fd29f9afdcef4659f68fa73eaa5356912b774227f5cf46b5/s3transfer-0.11.2.tar.gz", hash = "sha256:3b39185cb72f5acc77db1a58b6e25b977f28d20496b6e58d6813d75f464d632f", size = 147885 }
364
364
  wheels = [
365
- { url = "https://files.pythonhosted.org/packages/5f/ce/22673f4a85ccc640735b4f8d12178a0f41b5d3c6eda7f33756d10ce56901/s3transfer-0.11.1-py3-none-any.whl", hash = "sha256:8fa0aa48177be1f3425176dfe1ab85dcd3d962df603c3dbfc585e6bf857ef0ff", size = 84111 },
365
+ { url = "https://files.pythonhosted.org/packages/1b/ac/e7dc469e49048dc57f62e0c555d2ee3117fa30813d2a1a2962cce3a2a82a/s3transfer-0.11.2-py3-none-any.whl", hash = "sha256:be6ecb39fadd986ef1701097771f87e4d2f821f27f6071c872143884d2950fbc", size = 84151 },
366
366
  ]
367
367
 
368
368
  [[package]]
@@ -536,11 +536,11 @@ wheels = [
536
536
 
537
537
  [[package]]
538
538
  name = "tzdata"
539
- version = "2024.2"
539
+ version = "2025.1"
540
540
  source = { registry = "https://pypi.org/simple" }
541
- sdist = { url = "https://files.pythonhosted.org/packages/e1/34/943888654477a574a86a98e9896bae89c7aa15078ec29f490fef2f1e5384/tzdata-2024.2.tar.gz", hash = "sha256:7d85cc416e9382e69095b7bdf4afd9e3880418a2413feec7069d533d6b4e31cc", size = 193282 }
541
+ sdist = { url = "https://files.pythonhosted.org/packages/43/0f/fa4723f22942480be4ca9527bbde8d43f6c3f2fe8412f00e7f5f6746bc8b/tzdata-2025.1.tar.gz", hash = "sha256:24894909e88cdb28bd1636c6887801df64cb485bd593f2fd83ef29075a81d694", size = 194950 }
542
542
  wheels = [
543
- { url = "https://files.pythonhosted.org/packages/a6/ab/7e5f53c3b9d14972843a647d8d7a853969a58aecc7559cb3267302c94774/tzdata-2024.2-py2.py3-none-any.whl", hash = "sha256:a48093786cdcde33cad18c2555e8532f34422074448fbc874186f0abd79565cd", size = 346586 },
543
+ { url = "https://files.pythonhosted.org/packages/0f/dd/84f10e23edd882c6f968c21c2434fe67bd4a528967067515feca9e611e5e/tzdata-2025.1-py2.py3-none-any.whl", hash = "sha256:7e127113816800496f027041c570f50bcd464a020098a3b6b199517772303639", size = 346762 },
544
544
  ]
545
545
 
546
546
  [[package]]