mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-21 23:23:24 -07:00
Also add validation to the NamedRange class itself
This commit is contained in:
@@ -735,6 +735,11 @@ class NamedRange(Range):
|
||||
elif value > self.range_end and value not in self.special_range_names.values():
|
||||
raise Exception(f"{value} is higher than maximum {self.range_end} for option {self.__class__.__name__} " +
|
||||
f"and is also not one of the supported named special values: {self.special_range_names}")
|
||||
|
||||
for key in self.special_range_names:
|
||||
if key != key.lower() or " " in key:
|
||||
raise Exception(f"{self.__class__.__name__} has an invalid special_range_names key: {key}. "
|
||||
f"NamedRange keys must use only lowercase letters and underscores.")
|
||||
self.value = value
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user