forked from mtusi2026/mtusi2026lab2
14 lines
300 B
Python
14 lines
300 B
Python
import os
|
|
from pathlib import Path
|
|
|
|
|
|
def secret(name):
|
|
return Path(os.environ[name + "_FILE"]).read_text(encoding="utf-8").strip()
|
|
|
|
|
|
def positive_int(name, default):
|
|
value = int(os.getenv(name, default))
|
|
if value < 1:
|
|
raise ValueError(f"{name} must be positive")
|
|
return value
|