All checks were successful
Run apocalypse tests / Explore-Gitea-Actions (push) Successful in 10s
30 lines
651 B
Python
Executable File
30 lines
651 B
Python
Executable File
#!/usr/bin/python3
|
|
|
|
import argparse
|
|
import re
|
|
from pathlib import Path
|
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
parser.add_argument(
|
|
"--input",
|
|
"-i",
|
|
type=lambda p: Path(p).absolute(),
|
|
required=True,
|
|
help="path for the file, provided automatically by the apocalypse"
|
|
)
|
|
|
|
args = parser.parse_args()
|
|
|
|
pth = args.input
|
|
pth_meta = Path(str(pth).replace("/raw/", "/res/processed/").replace("/data/ac", "/meta/ac"))
|
|
acq = re.search(r"acq(\d+)", str(pth)).group(1)
|
|
pth_meta = pth_meta.with_name(f"apo_acq{acq}.txt")
|
|
|
|
pth_meta.parent.mkdir(parents=True, exist_ok=True)
|
|
|
|
with open(pth_meta, "w") as f:
|
|
f.write("test")
|
|
|
|
print(args.input)
|