taskbadger 1.6.0__tar.gz → 1.6.2__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.
- {taskbadger-1.6.0 → taskbadger-1.6.2}/PKG-INFO +2 -2
- {taskbadger-1.6.0 → taskbadger-1.6.2}/pyproject.toml +2 -2
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/sdk.py +30 -12
- {taskbadger-1.6.0 → taskbadger-1.6.2}/.gitignore +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/LICENSE +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/README.md +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/__init__.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/celery.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/cli/__init__.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/cli/basics.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/cli/list_tasks.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/cli/utils.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/cli/wrapper.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/cli_main.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/config.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/decorators.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/exceptions.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/integrations.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/__init__.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/__init__.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/action_endpoints/__init__.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/action_endpoints/action_cancel.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/action_endpoints/action_create.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/action_endpoints/action_get.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/action_endpoints/action_list.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/action_endpoints/action_partial_update.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/action_endpoints/action_update.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/task_endpoints/__init__.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/task_endpoints/task_cancel.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/task_endpoints/task_create.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/task_endpoints/task_get.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/task_endpoints/task_list.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/task_endpoints/task_partial_update.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/task_endpoints/task_update.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/client.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/errors.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/models/__init__.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/models/action.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/models/action_request.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/models/paginated_task_list.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/models/patched_action_request.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/models/patched_task_request.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/models/patched_task_request_tags.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/models/status_enum.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/models/task.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/models/task_request.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/models/task_request_tags.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/models/task_tags.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/py.typed +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/types.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/mug.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/process.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/safe_sdk.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/systems/__init__.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/systems/celery.py +0 -0
- {taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: taskbadger
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.2
|
|
4
4
|
Summary: The official Python SDK for Task Badger
|
|
5
5
|
Project-URL: Changelog, https://github.com/taskbadger/taskbadger-python/releases
|
|
6
6
|
Project-URL: homepage, https://taskbadger.net/
|
|
@@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
19
19
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
20
|
Requires-Python: >=3.9
|
|
21
21
|
Requires-Dist: attrs>=21.3.0
|
|
22
|
-
Requires-Dist: httpx
|
|
22
|
+
Requires-Dist: httpx>=0.20.0
|
|
23
23
|
Requires-Dist: importlib-metadata>=1.0; python_version < '3.8'
|
|
24
24
|
Requires-Dist: python-dateutil>=2.8.0
|
|
25
25
|
Requires-Dist: tomlkit>=0.12.5
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "taskbadger"
|
|
3
|
-
version = "1.6.
|
|
3
|
+
version = "1.6.2"
|
|
4
4
|
description = "The official Python SDK for Task Badger"
|
|
5
5
|
requires-python = ">=3.9"
|
|
6
6
|
authors = []
|
|
@@ -19,7 +19,7 @@ classifiers = [
|
|
|
19
19
|
]
|
|
20
20
|
|
|
21
21
|
dependencies = [
|
|
22
|
-
"httpx >=0.20.0
|
|
22
|
+
"httpx >=0.20.0",
|
|
23
23
|
"attrs >=21.3.0",
|
|
24
24
|
"python-dateutil >=2.8.0",
|
|
25
25
|
"typer[all] <0.10.0",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import datetime
|
|
2
2
|
import logging
|
|
3
3
|
import os
|
|
4
|
+
import warnings
|
|
4
5
|
from typing import Any
|
|
5
6
|
|
|
6
7
|
from taskbadger.exceptions import (
|
|
@@ -327,25 +328,32 @@ class Task:
|
|
|
327
328
|
"""Update the task status"""
|
|
328
329
|
self.update(status=status)
|
|
329
330
|
|
|
330
|
-
def increment_progress(self, amount: int
|
|
331
|
+
def increment_progress(self, amount: int):
|
|
332
|
+
warnings.warn(
|
|
333
|
+
"'task.increment_progress' will be removed in v1.7.0. Use 'task.increment_value' instead.",
|
|
334
|
+
DeprecationWarning,
|
|
335
|
+
stacklevel=2,
|
|
336
|
+
)
|
|
337
|
+
self.increment_value(amount)
|
|
338
|
+
|
|
339
|
+
def increment_value(self, amount: int):
|
|
331
340
|
"""Increment the task progress by adding the specified amount to the current value.
|
|
332
341
|
If the task value is not set it will be set to `amount`.
|
|
333
|
-
|
|
334
|
-
Arguments:
|
|
335
|
-
amount: The amount to increment the task value by.
|
|
336
|
-
value_step: The minimum change in value required to trigger an update.
|
|
337
|
-
rate_limit: The minimum interval between updates in seconds.
|
|
338
|
-
|
|
339
|
-
If either `value_step` or `rate_limit` is set, the task will only be updated if the
|
|
340
|
-
specified conditions are met. If both are set, the task will be updated if either
|
|
341
|
-
condition is met.
|
|
342
342
|
"""
|
|
343
343
|
value = self._task.value
|
|
344
344
|
value_norm = value if value is not UNSET and value is not None else 0
|
|
345
345
|
new_amount = value_norm + amount
|
|
346
|
-
self.
|
|
346
|
+
self.update(value=new_amount)
|
|
347
347
|
|
|
348
348
|
def update_progress(self, value: int, value_step: int = None, rate_limit: int = None):
|
|
349
|
+
warnings.warn(
|
|
350
|
+
"'task.update_progress' will be removed in v1.7.0. Use 'task.update_value' instead.",
|
|
351
|
+
DeprecationWarning,
|
|
352
|
+
stacklevel=2,
|
|
353
|
+
)
|
|
354
|
+
self.update_value(value, value_step, rate_limit)
|
|
355
|
+
|
|
356
|
+
def update_value(self, value: int, value_step: int = None, rate_limit: int = None) -> bool:
|
|
349
357
|
"""Update task progress.
|
|
350
358
|
|
|
351
359
|
Arguments:
|
|
@@ -353,6 +361,9 @@ class Task:
|
|
|
353
361
|
value_step: The minimum change in value required to trigger an update.
|
|
354
362
|
rate_limit: The minimum interval between updates in seconds.
|
|
355
363
|
|
|
364
|
+
Returns:
|
|
365
|
+
bool: True if the task was updated, False otherwise
|
|
366
|
+
|
|
356
367
|
If either `value_step` or `rate_limit` is set, the task will only be updated if the
|
|
357
368
|
specified conditions are met. If both are set, the task will be updated if either
|
|
358
369
|
condition is met.
|
|
@@ -362,6 +373,8 @@ class Task:
|
|
|
362
373
|
value_check = value_step and self._check_update_value_interval(value, value_step)
|
|
363
374
|
if skip_check or time_check or value_check:
|
|
364
375
|
self.update(value=value)
|
|
376
|
+
return True
|
|
377
|
+
return False
|
|
365
378
|
|
|
366
379
|
def set_value_max(self, value_max: int):
|
|
367
380
|
"""Set the `value_max`."""
|
|
@@ -416,16 +429,21 @@ class Task:
|
|
|
416
429
|
"""Add tags to the task."""
|
|
417
430
|
self.update(tags=tags)
|
|
418
431
|
|
|
419
|
-
def ping(self, rate_limit=None):
|
|
432
|
+
def ping(self, rate_limit=None) -> bool:
|
|
420
433
|
"""Update the task without changing any values. This can be used in conjunction
|
|
421
434
|
with 'stale_timeout' to indicate that the task is still running.
|
|
422
435
|
|
|
423
436
|
Arguments:
|
|
424
437
|
rate_limit: The minimum interval between pings in seconds. If set this will only
|
|
425
438
|
update the task if the last update was more than `rate_limit` seconds ago.
|
|
439
|
+
|
|
440
|
+
Returns:
|
|
441
|
+
bool: True if the task was updated, False otherwise
|
|
426
442
|
"""
|
|
427
443
|
if self._check_update_time_interval(rate_limit):
|
|
428
444
|
self.update()
|
|
445
|
+
return True
|
|
446
|
+
return False
|
|
429
447
|
|
|
430
448
|
@property
|
|
431
449
|
def tags(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/action_endpoints/action_cancel.py
RENAMED
|
File without changes
|
{taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/action_endpoints/action_create.py
RENAMED
|
File without changes
|
{taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/action_endpoints/action_get.py
RENAMED
|
File without changes
|
{taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/action_endpoints/action_list.py
RENAMED
|
File without changes
|
|
File without changes
|
{taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/action_endpoints/action_update.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/api/task_endpoints/task_partial_update.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{taskbadger-1.6.0 → taskbadger-1.6.2}/taskbadger/internal/models/patched_task_request_tags.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|