python-terminusgps 1.5.10__tar.gz → 1.7.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.

Potentially problematic release.


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

Files changed (29) hide show
  1. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/PKG-INFO +1 -1
  2. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/pyproject.toml +1 -1
  3. python_terminusgps-1.7.0/terminusgps/test.py +55 -0
  4. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/wialon/constants.py +10 -0
  5. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/wialon/items/base.py +1 -0
  6. python_terminusgps-1.7.0/terminusgps/wialon/items/resource.py +174 -0
  7. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/wialon/items/unit.py +5 -5
  8. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/wialon/session.py +24 -11
  9. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/wialon/utils.py +13 -0
  10. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/uv.lock +13 -13
  11. python_terminusgps-1.5.10/terminusgps/wialon/items/resource.py +0 -22
  12. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/.gitignore +0 -0
  13. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/COPYING +0 -0
  14. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/README.md +0 -0
  15. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/requirements.txt +0 -0
  16. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/__init__.py +0 -0
  17. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/authorizenet/__init__.py +0 -0
  18. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/authorizenet/auth.py +0 -0
  19. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/aws/__init__.py +0 -0
  20. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/aws/secrets.py +0 -0
  21. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/settings.py +0 -0
  22. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/wialon/__init__.py +0 -0
  23. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/wialon/errors.py +0 -0
  24. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/wialon/flags.py +0 -0
  25. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/wialon/items/__init__.py +0 -0
  26. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/wialon/items/retranslator.py +0 -0
  27. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/wialon/items/route.py +0 -0
  28. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/wialon/items/unit_group.py +0 -0
  29. {python_terminusgps-1.5.10 → python_terminusgps-1.7.0}/terminusgps/wialon/items/user.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.7.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.7.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" } ]
@@ -0,0 +1,55 @@
1
+ from django.utils import timezone
2
+ from terminusgps.wialon.session import WialonSession
3
+ from terminusgps.wialon.utils import get_hw_type_id, gen_wialon_password
4
+ from terminusgps.wialon.items import WialonUser, WialonResource, WialonUnit
5
+ from terminusgps.wialon import constants
6
+
7
+
8
+ def registration_test() -> None:
9
+ timestamp = f"{timezone.now():%y-%m-%d-%H:%M:%S}"
10
+
11
+ with WialonSession() as session:
12
+ print(f"Running test '{registration_test.__name__}' as '{session.username}'...")
13
+ hw_type_id = get_hw_type_id(name="Test HW", session=session)
14
+
15
+ super_user = WialonUser(
16
+ creator_id=session.uid,
17
+ name=f"super_user_{timestamp}",
18
+ password=gen_wialon_password(length=32),
19
+ session=session,
20
+ )
21
+ resource = WialonResource(
22
+ creator_id=super_user.id, name=f"resource_{timestamp}", session=session
23
+ )
24
+ unit = WialonUnit(
25
+ creator_id=session.uid,
26
+ name=f"test_unit_{timestamp}",
27
+ hw_type_id=hw_type_id,
28
+ session=session,
29
+ )
30
+ super_user.grant_access(unit, access_mask=constants.ACCESSMASK_UNIT_MIGRATION)
31
+ resource.create_account("terminusgps_ext_hist")
32
+ resource.migrate_unit(unit)
33
+ end_user = WialonUser(
34
+ creator_id=super_user.id,
35
+ name=f"end_user_{timestamp}",
36
+ password=gen_wialon_password(length=32),
37
+ session=session,
38
+ )
39
+ end_user.grant_access(unit, access_mask=constants.ACCESSMASK_UNIT_BASIC)
40
+
41
+
42
+ def account_days_test() -> None:
43
+ timestamp = f"{timezone.now():%y-%m-%d-%H:%M:%S}"
44
+
45
+ with WialonSession() as session:
46
+ print(f"Running test '{account_days_test.__name__}' as '{session.username}'...")
47
+ account = WialonResource(id="28990259", session=session)
48
+ account.set_settings_flags(0x20)
49
+ account.set_minimum_days(0)
50
+ account.add_days(30)
51
+
52
+
53
+ if __name__ == "__main__":
54
+ registration_test()
55
+ account_days_test()
@@ -74,3 +74,13 @@ ACCESSMASK_UNIT_SUPER: int = sum(
74
74
  )
75
75
 
76
76
  ACCESSMASK_UNIT_FULL: int = sum([flags.ACCESSFLAG_FULL_ACCESS])
77
+
78
+ ACCESSMASK_UNIT_MIGRATION: int = sum(
79
+ [
80
+ flags.ACCESSFLAG_DELETE_ITEM,
81
+ flags.ACCESSFLAG_MANAGE_ITEM_ACCESS,
82
+ flags.ACCESSFLAG_UNIT_DELETE_MESSAGES,
83
+ flags.ACCESSFLAG_UNIT_MANAGE_CONNECTIVITY,
84
+ flags.ACCESSFLAG_VIEW_ITEM_BASIC,
85
+ ]
86
+ )
@@ -12,6 +12,7 @@ class WialonBase:
12
12
  self._id = self.create(**kwargs)
13
13
  else:
14
14
  self._id = id
15
+ self.populate()
15
16
 
16
17
  def __str__(self) -> str:
17
18
  return str(self.id)
@@ -0,0 +1,174 @@
1
+ from terminusgps.wialon import flags
2
+ from terminusgps.wialon.items.base import WialonBase
3
+
4
+
5
+ class WialonResource(WialonBase):
6
+ def create(self, **kwargs) -> int | None:
7
+ if not kwargs.get("creator_id"):
8
+ raise ValueError("'creator_id' is required for creation.")
9
+ if not kwargs.get("name"):
10
+ raise ValueError("'name' is required for creation.")
11
+ if not kwargs.get("flags"):
12
+ kwargs["flags"] = flags.DATAFLAG_UNIT_BASE
13
+
14
+ response = self.session.wialon_api.core_create_resource(
15
+ **{
16
+ "creatorId": kwargs["creator_id"],
17
+ "name": kwargs["name"],
18
+ "dataFlags": kwargs["flags"],
19
+ }
20
+ )
21
+ return response.get("item", {}).get("id")
22
+
23
+ @property
24
+ def is_account(self) -> bool:
25
+ response = self.session.wialon_api.core_search_item(
26
+ **{"id": self.id, "flags": flags.DATAFLAG_RESOURCE_BILLING_PROPERTIES}
27
+ )
28
+ return response.get("item", {}).get("bact") == self.id
29
+
30
+ def migrate_unit(self, unit: WialonBase) -> None:
31
+ """
32
+ Migrates a :py:obj:`WialonUnit` into the account.
33
+
34
+ :param unit: A Wialon object.
35
+ :type unit: :py:obj:`~terminusgps.wialon.items.base.WialonBase`
36
+ :returns: Nothing.
37
+ :rtype: :py:obj:`None`
38
+
39
+ """
40
+ assert self.is_account, "The resource is not an account"
41
+ self.session.wialon_api.account_change_account(
42
+ **{"itemId": unit.id, "resourceId": self.id}
43
+ )
44
+
45
+ def update_plan(self, new_plan: str) -> None:
46
+ """
47
+ Updates the account billing plan.
48
+
49
+ :param new_plan: The name of a billing plan.
50
+ :type new_plan: :py:obj:`str`
51
+ :returns: Nothing.
52
+ :rtype: :py:obj:`None`
53
+
54
+ """
55
+ assert self.is_account, "The resource is not an account"
56
+ self.session.wialon_api.account_update_plan(
57
+ **{"itemId": self.id, "plan": new_plan}
58
+ )
59
+
60
+ def create_account(self, billing_plan: str) -> None:
61
+ """
62
+ Transforms the resource into an account.
63
+
64
+ :param billing_plan: The name of a billing plan.
65
+ :type billing_plan: :py:obj:`str`
66
+ :returns: Nothing.
67
+ :rtype: :py:obj:`None`
68
+
69
+ """
70
+ assert self.is_account, "The resource is already an account"
71
+ self.session.wialon_api.account_create_account(
72
+ **{"itemId": self.id, "plan": billing_plan}
73
+ )
74
+
75
+ def delete_account(self) -> None:
76
+ """
77
+ Deletes the account if it exists, as well as any micro-objects and macro-objects it contains.
78
+
79
+ :returns: Nothing.
80
+ :rtype: :py:obj:`None`
81
+
82
+ """
83
+ assert self.is_account, "The resource is not an account"
84
+ self.session.wialon_api.account_delete_account(**{"itemId": self.id})
85
+
86
+ def enable_account(self) -> None:
87
+ """
88
+ Enables the Wialon account.
89
+
90
+ :returns: Nothing.
91
+ :rtype: :py:obj:`None`
92
+
93
+ """
94
+ assert self.is_account, "The resource is not an account"
95
+ self.session.wialon_api.account_enable_account(
96
+ **{"itemId": self.id, "enable": int(True)}
97
+ )
98
+
99
+ def disable_account(self) -> None:
100
+ """
101
+ Disables the Wialon account.
102
+
103
+ :returns: Nothing.
104
+ :rtype: :py:obj:`None`
105
+
106
+ """
107
+ assert self.is_account, "The resource is not an account"
108
+ self.session.wialon_api.account_enable_account(
109
+ **{"itemId": self.id, "enable": int(False)}
110
+ )
111
+
112
+ def set_minimum_days(self, days: int = 0) -> None:
113
+ """
114
+ Sets the minimum days counter value to ``days``.
115
+
116
+ :param days: Number of days to set the counter to. Default is ``0``.
117
+ :type days: :py:obj:`int`
118
+ :returns: Nothing.
119
+ :rtype: :py:obj:`None`
120
+
121
+ """
122
+ assert self.is_account, "The resource is not an account"
123
+ self.session.wialon_api.account_update_min_days(
124
+ **{"itemId": self.id, "minDays": days}
125
+ )
126
+
127
+ def add_days(self, days: int = 30) -> None:
128
+ """
129
+ Adds days to the account.
130
+
131
+ :param days: Number of days to add to the account. Default is ``30``.
132
+ :type days: :py:obj:`int`
133
+ :returns: Nothing.
134
+ :rtype: :py:obj:`None`
135
+
136
+ """
137
+ assert self.is_account, "The resource is not an account"
138
+ self.session.wialon_api.account_do_payment(
139
+ **{
140
+ "itemId": self.id,
141
+ "balanceUpdate": "0.00",
142
+ "daysUpdate": days,
143
+ "description": f"{self.session.id} - Added {days} days.",
144
+ }
145
+ )
146
+
147
+ def set_settings_flags(
148
+ self,
149
+ flags: int = 0x20,
150
+ block_balance_val: float = 0.00,
151
+ deny_balance_val: float = 0.00,
152
+ ) -> None:
153
+ """
154
+ Sets account settings flags.
155
+
156
+ :param flags: A flag integer to set on the account.
157
+ :type flags: :py:obj:`int`
158
+ :param block_balance_val: Minimum amount on the account's balance before blocking the account.
159
+ :type block_balance_val: :py:obj:`float`
160
+ :param deny_balance_val: Minimum amount on the account's balance before denying the account.
161
+ :type deny_balance_val: :py:obj:`float`
162
+ :returns: Nothing.
163
+ :rtype: :py:obj:`None`
164
+
165
+ """
166
+ assert self.is_account, "The resource is not an account"
167
+ self.session.wialon_api.account_update_flags(
168
+ **{
169
+ "itemId": self.id,
170
+ "flags": flags,
171
+ "blockBalance": block_balance_val,
172
+ "denyBalance": deny_balance_val,
173
+ }
174
+ )
@@ -13,8 +13,8 @@ class WialonUnit(WialonBase):
13
13
  :type creator_id: :py:obj:`int`
14
14
  :param name: A new name for the unit.
15
15
  :type name: :py:obj:`str`
16
- :param hw_type: A Wialon hardware type.
17
- :type hw_type: :py:obj:`str`
16
+ :param hw_type_id: A Wialon hardware type ID.
17
+ :type hw_type_id: :py:obj:`str`
18
18
  :returns: The Wialon id for the new unit.
19
19
  :rtype: :py:obj:`int` | :py:obj:`None`
20
20
 
@@ -23,14 +23,14 @@ class WialonUnit(WialonBase):
23
23
  raise ValueError("'creator_id' is required on creation.")
24
24
  if not kwargs.get("name"):
25
25
  raise ValueError("'name' is required on creation.")
26
- if not kwargs.get("hw_type"):
27
- raise ValueError("'hw_type' is required on creation.")
26
+ if not kwargs.get("hw_type_id"):
27
+ raise ValueError("'hw_type_id' is required on creation.")
28
28
 
29
29
  response = self.session.wialon_api.core_create_unit(
30
30
  **{
31
31
  "creatorId": kwargs["creator_id"],
32
32
  "name": kwargs["name"],
33
- "hwTypeId": kwargs["hw_type"],
33
+ "hwTypeId": kwargs["hw_type_id"],
34
34
  "dataFlags": flags.DATAFLAG_UNIT_BASE,
35
35
  }
36
36
  )
@@ -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
@@ -15,6 +17,7 @@ class WialonSession:
15
17
  self,
16
18
  token: str | None = None,
17
19
  sid: str | None = None,
20
+ uid: str | None = None,
18
21
  scheme: str = "https",
19
22
  host: str = "hst-api.wialon.com",
20
23
  port: int = 443,
@@ -38,6 +41,7 @@ class WialonSession:
38
41
 
39
42
  self.wialon_api = Wialon(scheme=scheme, host=host, port=port, sid=sid)
40
43
  self.token = token
44
+ self.login_id = uid
41
45
  self._username = None
42
46
  self._gis_sid = None
43
47
  self._hw_gp_ip = None
@@ -46,7 +50,7 @@ class WialonSession:
46
50
 
47
51
  def __enter__(self) -> "WialonSession":
48
52
  assert self.token, "Wialon API token was not set"
49
- self.login(self.token)
53
+ self.login(self.token, self.login_id)
50
54
  return self
51
55
 
52
56
  def __exit__(self, *args, **kwargs) -> None:
@@ -250,8 +254,6 @@ class WialonSession:
250
254
 
251
255
  :param token: An active Wialon API token.
252
256
  :type token: :py:obj:`str`
253
- :param user_id: A user to operate as in the Wialon API session.
254
- :type user_id: :py:obj:`str` | :py:obj:`None`
255
257
  :param flags: A login response flag integer.
256
258
  :type flags: :py:obj:`int`
257
259
  :raises WialonLoginError: If the login fails.
@@ -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
@@ -13,6 +13,19 @@ from terminusgps.wialon.items import (
13
13
  )
14
14
 
15
15
 
16
+ def get_hw_type_id(name: str, session: WialonSession) -> int | None:
17
+ response = session.wialon_api.core_get_hw_types(
18
+ **{
19
+ "filterType": "id",
20
+ "filterValue": "name,id",
21
+ "includeType": "true",
22
+ "ignoreRename": "true",
23
+ }
24
+ )
25
+ hw_types = {item.get("name"): item.get("id") for item in response}
26
+ return int(hw_types.get(name)) if name in hw_types.keys() else None
27
+
28
+
16
29
  def get_wialon_cls(items_type: str) -> Any:
17
30
  """Returns a Wialon object class based on items_type."""
18
31
  match items_type:
@@ -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]]
@@ -1,22 +0,0 @@
1
- from terminusgps.wialon import flags
2
- from terminusgps.wialon.items.base import WialonBase
3
-
4
-
5
- class WialonResource(WialonBase):
6
- def create(self, **kwargs) -> int | None:
7
- if not kwargs.get("creator_id"):
8
- raise ValueError("'creator_id' is required for creation.")
9
- if not kwargs.get("name"):
10
- raise ValueError("'name' is required for creation.")
11
- if not kwargs.get("flags"):
12
- kwargs["flags"] = flags.DATAFLAG_UNIT_BASE
13
-
14
- response = self.session.wialon_api.core_create_resource(
15
- **{
16
- "creatorId": kwargs["creator_id"],
17
- "name": kwargs["name"],
18
- "dataFlags": kwargs["flags"],
19
- "skipCreatorCheck": int(True),
20
- }
21
- )
22
- return response.get("item", {}).get("id")