From 1f163107975f048e2582875f97bf1586984362a7 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Thu, 31 Mar 2022 22:09:54 +0200 Subject: [PATCH] Options: fix "toggle: random" always being True --- Options.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Options.py b/Options.py index b75eb82f..7e98f04c 100644 --- a/Options.py +++ b/Options.py @@ -111,7 +111,9 @@ class Toggle(Option[int]): @classmethod def from_text(cls, text: str) -> Toggle: - if text.lower() in {"off", "0", "false", "none", "null", "no"}: + if text == "random": + return cls(random.choice(list(cls.name_lookup))) + elif text.lower() in {"off", "0", "false", "none", "null", "no"}: return cls(0) else: return cls(1)