Skip to content

Commit

Permalink
Fixed an issue with saving data.
Browse files Browse the repository at this point in the history
  • Loading branch information
tahadnan committed Oct 16, 2024
1 parent 5b71231 commit 4dca009
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ttask_manager"
version = "1.0.3"
version = "1.0.4"
authors = [
{ name="Taha Yasser Adnan", email="tahadnan.101@gmail.com" },
]
Expand Down
10 changes: 6 additions & 4 deletions src/ttask_manager/ttask_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@ def __init__(self, priority_levels: List[Union[str, int]] = ['high', 'medium', '
self.daily_completed_tasks: Dict[str, Union[str, int]] = {}
self.to_do: Dict[str, Union[str, int]] = {}
self.done: Dict[str, Union[str, int]] = {}
self.data: Dict[str, Dict[str, Union[str, int]]] = {
self.priority_levels: List[Union[str, int]] = priority_levels
self.default_priority: Union[str, int] = default_priority
self.priorities_type: Literal[str, int] = priorities_type
@property
def data(self) -> Dict[str, Dict[str, Union[str, int]]]:
return {
'to_do': self.to_do,
'done': self.done,
'daily added tasks': self.daily_added_tasks,
'daily completed tasks': self.daily_completed_tasks
}
self.priority_levels: List[Union[str, int]] = priority_levels
self.default_priority: Union[str, int] = default_priority
self.priorities_type: Literal[str, int] = priorities_type
def save_current_state(self,data_file_path: str = './data.json') -> str:
"""
Saves the current state of the task manager to a JSON file.
Expand Down

0 comments on commit 4dca009

Please sign in to comment.