mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-26 12:23:21 -07:00
change to dictionary.get
This commit is contained in:
@@ -56,18 +56,18 @@ class AutoPatchExtensionRegister(type):
|
||||
|
||||
@staticmethod
|
||||
def get_handler(game: str) -> Union[AutoPatchExtensionRegister, List[AutoPatchExtensionRegister]]:
|
||||
for extension_type, handler in AutoPatchExtensionRegister.extension_types.items():
|
||||
if extension_type == game:
|
||||
if handler.required_extensions:
|
||||
handlers = [handler]
|
||||
for required in handler.required_extensions:
|
||||
if required in AutoPatchExtensionRegister.extension_types:
|
||||
handlers.append(AutoPatchExtensionRegister.extension_types[required])
|
||||
else:
|
||||
raise NotImplementedError(f"No handler for {required}.")
|
||||
return handlers
|
||||
else:
|
||||
return handler
|
||||
if game in AutoPatchExtensionRegister.extension_types:
|
||||
handler = AutoPatchExtensionRegister.extension_types.get(game)
|
||||
if handler.required_extensions:
|
||||
handlers = [handler]
|
||||
for required in handler.required_extensions:
|
||||
if required in AutoPatchExtensionRegister.extension_types:
|
||||
handlers.append(AutoPatchExtensionRegister.extension_types.get(required))
|
||||
else:
|
||||
raise NotImplementedError(f"No handler for {required}.")
|
||||
return handlers
|
||||
else:
|
||||
return handler
|
||||
return APPatchExtension
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user