20 lines
465 B
Python
20 lines
465 B
Python
|
#!/usr/bin/env python3
|
||
|
from typing import Callable
|
||
|
import csv
|
||
|
import pathlib
|
||
|
|
||
|
def repo_root_impure():
|
||
|
cwd = pathlib.Path.cwd()
|
||
|
return cwd.parent if cwd.name == "data" else cwd
|
||
|
|
||
|
def _item_list_f():
|
||
|
return repo_root_impure().joinpath("data", "list_items.txt")
|
||
|
|
||
|
def item_list(fpath: Callable[[], pathlib.Path] = _item_list_f):
|
||
|
"""
|
||
|
This is evil :(
|
||
|
"""
|
||
|
with open(fpath(), "r") as f:
|
||
|
return [line.strip().split(']')[1] for line in f]
|
||
|
|