Update base.py

This commit is contained in:
Namhyeon Go 2024-07-09 16:38:19 +09:00 committed by GitHub
parent 0b94de24e9
commit 2d2e54cd2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

10
base.py
View File

@ -7,7 +7,7 @@
# Namyheon Go (Catswords Research) <gnh1201@gmail.com>
# https://github.com/gnh1201/caterpillar
# Created at: 2024-05-20
# Updated at: 2024-07-06
# Updated at: 2024-07-09
#
import hashlib
@ -72,13 +72,17 @@ class Extension():
cls.buffer_size = _buffer_size
@classmethod
def register(cls, module_path, class_name):
def register(cls, s)
module_name = s.split('.')[0]
module_path = 'plugins.' + module_name
class_name = s.split('.')[-1]
try:
module = importlib.import_module(module_path)
_class = getattr(module, class_name)
cls.extensions.append(_class())
except (ImportError, AttributeError) as e:
raise ImportError(class_name + " in " + module_path)
raise ImportError(class_name + " in the extension " + module_name)
@classmethod
def get_filters(cls):