MCPcopy
hub / github.com/chidiwilliams/buzz / save_json_tasks

Method save_json_tasks

buzz/cache.py:61–70  ·  view source on GitHub ↗
(self, tasks: List[FileTranscriptionTask])

Source from the content-addressed store, hash-verified

59 return tasks
60
61 def save_json_tasks(self, tasks: List[FileTranscriptionTask]):
62 json_str = json.dumps([task.id for task in tasks])
63 with open(self.tasks_list_file_path, "w") as file:
64 file.write(json_str)
65
66 for task in tasks:
67 file_path = self.get_task_path(task_id=task.id)
68 json_str = task.to_json()
69 with open(file_path, "w") as file:
70 file.write(json_str)
71
72 def get_task_path(self, task_id: int):
73 path = os.path.join(self.cache_dir, "transcriptions", f"{task_id}.json")

Callers 1

saveMethod · 0.95

Calls 2

get_task_pathMethod · 0.95
writeMethod · 0.80

Tested by

no test coverage detected