mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-03 19:28:25 +02:00
18 lines
551 B
Python
18 lines
551 B
Python
from source.mkw.Patch import *
|
|
from source.mkw.Patch.PatchOperation.Operation import *
|
|
|
|
|
|
class PatchOperation:
|
|
"""
|
|
Represent an operation that can be applied onto a patch to modify it before installing
|
|
"""
|
|
|
|
def __new__(cls, name) -> "Operation":
|
|
"""
|
|
Return an operation from its name
|
|
:return: an Operation from its name
|
|
"""
|
|
|
|
for subclass in filter(lambda subclass: subclass.type == name, AbstractOperation.__subclasses__()):
|
|
return subclass
|
|
raise InvalidPatchOperation(name)
|