mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-06-12 05:08:28 +03:00
Separate setup() and module_setup().
This commit is contained in:
@@ -80,6 +80,10 @@ class BaseModule(ABC):
|
||||
for key, val in config.get(self.name, {}).items():
|
||||
setattr(self, key, val)
|
||||
|
||||
def module_setup(self):
|
||||
# For any additional setup required by modules, e.g. autehntication
|
||||
pass
|
||||
|
||||
def auth_for_site(self, site: str, extract_cookies=True) -> Mapping[str, Any]:
|
||||
"""
|
||||
Returns the authentication information for a given site. This is used to authenticate
|
||||
|
||||
@@ -242,6 +242,7 @@ class LazyBaseModule:
|
||||
default_config = dict((k, v['default']) for k, v in self.configs.items() if v.get('default'))
|
||||
config[self.name] = default_config | config.get(self.name, {})
|
||||
instance.setup(config)
|
||||
instance.module_setup()
|
||||
return instance
|
||||
|
||||
def __repr__(self):
|
||||
|
||||
Reference in New Issue
Block a user