pyvikunja 0.20b2__py3-none-any.whl → 0.22__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.
- pyvikunja/api.py +4 -1
- pyvikunja/models/models.py +5 -5
- {pyvikunja-0.20b2.dist-info → pyvikunja-0.22.dist-info}/METADATA +1 -1
- {pyvikunja-0.20b2.dist-info → pyvikunja-0.22.dist-info}/RECORD +7 -7
- {pyvikunja-0.20b2.dist-info → pyvikunja-0.22.dist-info}/WHEEL +0 -0
- {pyvikunja-0.20b2.dist-info → pyvikunja-0.22.dist-info}/licenses/LICENSE +0 -0
- {pyvikunja-0.20b2.dist-info → pyvikunja-0.22.dist-info}/top_level.txt +0 -0
pyvikunja/api.py
CHANGED
@@ -25,15 +25,18 @@ class APIError(Exception):
|
|
25
25
|
|
26
26
|
|
27
27
|
class VikunjaAPI:
|
28
|
-
def __init__(self, base_url: str, token: str, strict_ssl: bool = True):
|
28
|
+
def __init__(self, base_url: str, token: str, strict_ssl: bool = True, client: Optional[httpx.AsyncClient] = None):
|
29
29
|
self.host = self._normalize_host(base_url)
|
30
30
|
self.api_base_url = self._normalize_api_base_url(self.host)
|
31
31
|
self.headers = {"Authorization": f"Bearer {token}"}
|
32
32
|
self.strict_ssl = strict_ssl
|
33
|
+
self._client = client
|
33
34
|
|
34
35
|
@cached_property
|
35
36
|
def client(self) -> httpx.AsyncClient:
|
36
37
|
"""Lazily instantiate the HTTP client when first accessed."""
|
38
|
+
if self._client:
|
39
|
+
return self._client
|
37
40
|
return httpx.AsyncClient(verify=self.strict_ssl)
|
38
41
|
|
39
42
|
@property
|
pyvikunja/models/models.py
CHANGED
@@ -15,12 +15,12 @@ class BaseModel:
|
|
15
15
|
date = datetime.fromisoformat(date_str.replace('Z', '+00:00'))
|
16
16
|
epoch_seconds = int(date.timestamp())
|
17
17
|
|
18
|
-
local_time = date.astimezone()
|
19
|
-
|
20
18
|
if epoch_seconds <= 0:
|
21
19
|
return None
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
|
21
|
+
local_time = date.astimezone()
|
22
|
+
return local_time
|
23
|
+
except Exception as e:
|
24
|
+
print(f"Error parsing date {date_str}")
|
25
25
|
return None
|
26
26
|
return None
|
@@ -1,15 +1,15 @@
|
|
1
1
|
pyvikunja/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
pyvikunja/api.py,sha256=
|
2
|
+
pyvikunja/api.py,sha256=5URbOSO3KMUzqkbIsBzHrwbpDlv-gIIIKcNIB_my_PA,8018
|
3
3
|
pyvikunja/models/label.py,sha256=cOOuVYDVDMmK96Ev22EDgWwXljkAonQNL4XsTMay4K4,467
|
4
|
-
pyvikunja/models/models.py,sha256=
|
4
|
+
pyvikunja/models/models.py,sha256=t75YhYfFbXdLYUrZZDVgmcmZJ5CO2arHPhignqGxG70,926
|
5
5
|
pyvikunja/models/project.py,sha256=wFtnyuLTteDUQrUWeImR7DXTI0XYhCSiQGlmwaIzdwM,1128
|
6
6
|
pyvikunja/models/task.py,sha256=8KUoN0SuTRkJq_cHdsuIeQHUiNgOiWCLcWFVN9NJH5c,7806
|
7
7
|
pyvikunja/models/team.py,sha256=0Z3828Cm3nNuNr1z2on63fLYAVW325_SQKi5RmqXf-I,559
|
8
8
|
pyvikunja/models/user.py,sha256=36duFNyGXKzlwqO0d6FA-C1KTCci2sIMU1IBIF-N_LM,310
|
9
9
|
pyvikunja/models/enum/repeat_mode.py,sha256=xkDPfYeRz342ovqro1UVBAoegpPgpZQYTnyo2sf6R7I,112
|
10
10
|
pyvikunja/models/enum/task_priority.py,sha256=aVz1HEofIqwUkXG0vYm58n_vLNbgqtbvHuQ5K-YQqA0,119
|
11
|
-
pyvikunja-0.
|
12
|
-
pyvikunja-0.
|
13
|
-
pyvikunja-0.
|
14
|
-
pyvikunja-0.
|
15
|
-
pyvikunja-0.
|
11
|
+
pyvikunja-0.22.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
12
|
+
pyvikunja-0.22.dist-info/METADATA,sha256=vLQlGO6uHMT7bujYKDJsl82UZznkHdEyC20RUgothEw,210
|
13
|
+
pyvikunja-0.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
14
|
+
pyvikunja-0.22.dist-info/top_level.txt,sha256=WVV9zgxUBuWOkUY1t_U7zI0paWWTVelKYB4vjsiKsks,10
|
15
|
+
pyvikunja-0.22.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|