fifa17-recon: family flags -- FUT_CONSUMABLES=0 meant ON

os.environ.get returns the STRING "0", which is truthy, so anyone typing
FUT_CONSUMABLES=0 to turn the family off would have turned it on. "", "0", "off",
"no" and "false" now all mean off; any other value is the mode string ("1", "all").

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VUT92pz6RWKih9dSr8ZpxW
This commit is contained in:
funman300
2026-08-05 10:05:57 -07:00
parent 0e4bc13db4
commit 21b2263e30
+11 -3
View File
@@ -1477,9 +1477,17 @@ def sweep_items():
# FUT_MANAGERS=1 serve on type=manager|staff
# Every club fetch logs the ?type= it was asked for while any of the three is set, so
# a null result tells the human WHICH arm to aim at instead of nothing at all.
CONSUMABLES = os.environ.get("FUT_CONSUMABLES", "")
COACHES = os.environ.get("FUT_COACHES", "")
MANAGERS = os.environ.get("FUT_MANAGERS", "")
def _family_flag(name):
""""" / "0" / "off" all mean OFF. Without this, FUT_CONSUMABLES=0 would be a
non-empty string and would quietly turn the family ON -- the opposite of what
anyone typing it means."""
v = os.environ.get(name, "").strip().lower()
return "" if v in ("", "0", "off", "no", "false") else v
CONSUMABLES = _family_flag("FUT_CONSUMABLES")
COACHES = _family_flag("FUT_COACHES")
MANAGERS = _family_flag("FUT_MANAGERS")
FAMILIES_ON = bool(CONSUMABLES or COACHES or MANAGERS)
MANAGER_TYPES = ("manager", "staff")