forked from mtusi2026/mtusi2026lab2
Реализовать лабораторную 2
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
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
|
||||
Reference in New Issue
Block a user