mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 04:01:32 -06:00
Core: use patch extension register directly (#4375)
Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>
This commit is contained in:
@@ -15,7 +15,6 @@ import bsdiff4
|
|||||||
semaphore = threading.Semaphore(os.cpu_count() or 4)
|
semaphore = threading.Semaphore(os.cpu_count() or 4)
|
||||||
|
|
||||||
del threading
|
del threading
|
||||||
del os
|
|
||||||
|
|
||||||
|
|
||||||
class AutoPatchRegister(abc.ABCMeta):
|
class AutoPatchRegister(abc.ABCMeta):
|
||||||
@@ -34,10 +33,8 @@ class AutoPatchRegister(abc.ABCMeta):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_handler(file: str) -> Optional[AutoPatchRegister]:
|
def get_handler(file: str) -> Optional[AutoPatchRegister]:
|
||||||
for file_ending, handler in AutoPatchRegister.file_endings.items():
|
_, suffix = os.path.splitext(file)
|
||||||
if file.endswith(file_ending):
|
return AutoPatchRegister.file_endings.get(suffix, None)
|
||||||
return handler
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
class AutoPatchExtensionRegister(abc.ABCMeta):
|
class AutoPatchExtensionRegister(abc.ABCMeta):
|
||||||
|
Reference in New Issue
Block a user