auto task switch for work desktop (default)
This commit is contained in:
@@ -83,6 +83,9 @@ def format_task_line(
|
||||
|
||||
def db_to_file_as_is(filepath: str):
|
||||
"""Write tasks from MongoDB to file exactly as they were read."""
|
||||
if filepath is None:
|
||||
filepath = task_file
|
||||
|
||||
current_task = state.retrieve("current").get("task")
|
||||
all_tasks = list(tasks.find())
|
||||
|
||||
@@ -141,12 +144,12 @@ def extract(line: str) -> Optional[str]:
|
||||
return None
|
||||
|
||||
|
||||
def read_and_extract(file_path: str) -> Optional[str]:
|
||||
def read_and_extract(filepath: str) -> Optional[str]:
|
||||
"""Read file and update state if current task is found."""
|
||||
if file_path is None:
|
||||
file_path = task_file
|
||||
if filepath is None:
|
||||
filepath = task_file
|
||||
|
||||
with open(file_path, "r") as file:
|
||||
with open(filepath, "r") as file:
|
||||
for line in file:
|
||||
task_id = extract(line)
|
||||
if task_id:
|
||||
|
||||
Reference in New Issue
Block a user