Skip to content

Commit

Permalink
even more scanner docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTechromancer committed Sep 14, 2023
1 parent daeeda3 commit eac2af5
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions bbot/scanner/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,31 @@ async def setup_modules(self, remove_failed=True):
}

async def load_modules(self):
"""
Import and instantiate all scan modules (including internal ones).
Module dependencies will be installed as part of this process.
"""Asynchronously import and instantiate all scan modules, including internal and output modules.
This method is automatically invoked by `setup_modules()`. It performs several key tasks in the following sequence:
1. Install dependencies for each module via `self.helpers.depsinstaller.install()`.
2. Load scan modules and updates the `modules` dictionary.
3. Load internal modules and updates the `modules` dictionary.
4. Load output modules and updates the `modules` dictionary.
5. Sorts modules based on their `_priority` attribute.
If any modules fail to load or their dependencies fail to install, a ScanError will be raised (unless `self.force_start` is set to True).
Attributes:
succeeded, failed (tuple): A tuple containing lists of modules that succeeded or failed during the dependency installation.
loaded_modules, loaded_internal_modules, loaded_output_modules (dict): Dictionaries of successfully loaded modules.
failed, failed_internal, failed_output (list): Lists of module names that failed to load.
Raises:
ScanError: If any module dependencies fail to install or modules fail to load, and if self.force_start is False.
Returns:
None
Note:
After all modules are loaded, they are sorted by `_priority` and stored in the `modules` dictionary.
"""
if not self._modules_loaded:
all_modules = list(set(self._scan_modules + self._output_modules + self._internal_modules))
Expand Down

0 comments on commit eac2af5

Please sign in to comment.