35 lines
864 B
Python
35 lines
864 B
Python
import pathlib
|
|
ROOT = pathlib.Path(".").resolve()
|
|
svc = ROOT / "app/fitness/service.py"
|
|
text = svc.read_text(encoding="utf-8")
|
|
old = """from app.db.models import (
|
|
BodyMetric,
|
|
FitnessProfile,
|
|
FitnessReminder,
|
|
FoodLog,
|
|
WaterLog,
|
|
WorkoutLog,
|
|
)
|
|
from app.fitness.calculators import compute_targets, one_rep_max"""
|
|
new = """from app.db.models import (
|
|
BodyMetric,
|
|
FitnessProfile,
|
|
FitnessReminder,
|
|
FoodLog,
|
|
StepLog,
|
|
WaterLog,
|
|
WorkoutLog,
|
|
)
|
|
from app.fitness.activity_budget import (
|
|
build_base_targets,
|
|
compute_activity_bonus,
|
|
estimate_workout_active_kcal,
|
|
scale_targets,
|
|
)
|
|
from app.fitness.calculators import compute_targets, one_rep_max"""
|
|
if old not in text:
|
|
raise SystemExit("import block missing")
|
|
text = text.replace(old, new, 1)
|
|
svc.write_text(text, encoding="utf-8")
|
|
print("ok imports")
|