provozni zaloha
This commit is contained in:
@@ -10,6 +10,8 @@ TASKS = WORKSPACE / "tasks"
|
||||
CONFIG = Path.home() / ".nanobot" / "config.json"
|
||||
LOG = WORKSPACE / "log" / "detach.log"
|
||||
|
||||
QUEUE_DIRS = ("new", "inbox", "running", "done", "failed")
|
||||
|
||||
FILENAME_RE = re.compile(
|
||||
r"^(\d{4}-\d{2}-\d{2}(?:T\d{6}|_\d{2}_\d{2}_\d{2}_\d{6}))-(.+)\.md$"
|
||||
)
|
||||
@@ -20,6 +22,11 @@ _NO_INTERACTION_BULLET = (
|
||||
)
|
||||
|
||||
|
||||
def ensure_queue_dirs() -> None:
|
||||
for name in QUEUE_DIRS:
|
||||
(TASKS / name).mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
def log(msg: str) -> None:
|
||||
LOG.parent.mkdir(parents=True, exist_ok=True)
|
||||
with LOG.open("a") as f:
|
||||
|
||||
Reference in New Issue
Block a user