Skip to content

Commit c10fc0d

Browse files
Merge branch 'dev'
2 parents 7c3cad0 + 9c03b4b commit c10fc0d

File tree

7 files changed

+36
-11
lines changed

7 files changed

+36
-11
lines changed
File renamed without changes.

bumpver.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
[bumpver]
3-
current_version = "1.2.2"
3+
current_version = "1.2.3"
44
version_pattern = "MAJOR.MINOR.PATCH"
55
commit_message = "bump version {old_version} -> {new_version}"
66
tag_message = "{new_version}"

caldav_tasks_api/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
from caldav_tasks_api.caldav_tasks_api import TasksAPI
1212
from caldav_tasks_api.utils.data import TaskData, TaskListData
13-
import caldav_tasks_api.__main__ as cli
1413

1514
VERSION = TasksAPI.VERSION
1615

@@ -20,5 +19,4 @@
2019
"TaskListData",
2120
"logging_config", # Optionally expose logger or config
2221
"VERSION",
23-
"cli",
2422
]

caldav_tasks_api/caldav_tasks_api.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class TasksAPI:
1919

20-
VERSION: str = "1.2.2"
20+
VERSION: str = "1.2.3"
2121

2222
def __init__(
2323
self,
@@ -513,6 +513,10 @@ def add_task(self, task_data: TaskData, list_uid: Optional[str] = None) -> TaskD
513513
logger.info(
514514
f"Attempting to add task (UID: {task_data.uid if task_data.uid else 'new'}) to list UID: {effective_list_uid}"
515515
)
516+
# Debug print for task recovery purposes
517+
logger.info(
518+
f"DEBUG: Adding task with content - Text: '{task_data.text}', Notes: '{task_data.notes}', Priority: {task_data.priority}, Due: '{task_data.due_date}'"
519+
)
516520
if not self.raw_calendars:
517521
logger.debug("Raw calendars not loaded, fetching them before adding task.")
518522
self._fetch_raw_calendars()
@@ -676,6 +680,22 @@ def delete_task_by_id(self, task_uid: str, list_uid: Optional[str] = None) -> bo
676680
logger.info(
677681
f"Attempting to delete task UID '{task_uid}' from list UID '{list_uid}'."
678682
)
683+
684+
# Try to get task content for debug recovery purposes before deletion
685+
try:
686+
existing_task = self.get_task_by_global_uid(task_uid)
687+
if existing_task:
688+
logger.info(
689+
f"DEBUG: Deleting task with content - Text: '{existing_task.text}', Notes: '{existing_task.notes}', Priority: {existing_task.priority}, Due: '{existing_task.due_date}'"
690+
)
691+
else:
692+
logger.info(
693+
f"DEBUG: Deleting task UID '{task_uid}' - could not retrieve task content for debug"
694+
)
695+
except Exception as e:
696+
logger.info(
697+
f"DEBUG: Deleting task UID '{task_uid}' - error retrieving content for debug: {e}"
698+
)
679699
if not self.raw_calendars:
680700
logger.debug(
681701
"Raw calendars not loaded, fetching them before deleting task."

caldav_tasks_api/utils/data.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ def child_tasks(self) -> list["TaskData"]:
285285
def delete(self) -> bool:
286286
"""
287287
Deletes this task from the server using the API reference.
288-
288+
289289
Returns:
290290
True if deletion was successful, False otherwise.
291-
291+
292292
Raises:
293293
RuntimeError: If no API reference is available.
294294
PermissionError: If the API is in read-only mode.
@@ -299,13 +299,20 @@ def delete(self) -> bool:
299299
"Cannot delete task: No API reference available. "
300300
"This task may not have been loaded through a TasksAPI instance."
301301
)
302-
302+
303303
if not self.uid:
304304
raise ValueError("Cannot delete task: Task UID is missing.")
305-
305+
306306
if not self.list_uid:
307307
raise ValueError("Cannot delete task: Task list UID is missing.")
308-
308+
309+
# Debug print for task recovery purposes before deletion
310+
from loguru import logger
311+
312+
logger.info(
313+
f"DEBUG: TaskData.delete() called - Text: '{self.text}', Notes: '{self.notes}', Priority: {self.priority}, Due: '{self.due_date}', UID: '{self.uid}'"
314+
)
315+
309316
return self._api_reference.delete_task_by_id(self.uid, self.list_uid)
310317

311318
def to_ical(self) -> str:

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
project = "Caldav-Tasks-API"
2626
copyright = "2025, thiswillbeyourgithub"
2727
author = "thiswillbeyourgithub"
28-
release = "1.2.2"
28+
release = "1.2.3"
2929

3030
# -- General configuration ---------------------------------------------------
3131
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="caldav-tasks-api",
5-
version="1.2.2",
5+
version="1.2.3",
66
author="thiswillbeyourgithub",
77
description="A Python client for CalDAV task servers, with a CLI.",
88
long_description=open("README.md").read(),

0 commit comments

Comments
 (0)