Implement Conditional Plugin Loading Based on Configuration #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a modification to the plugin loading mechanism in
subfuz.py
, enabling the script to conditionally load plugins based on their enabled status in theconfig.json
file. This change addresses the issue where attempting to load a plugin that is not properly configured or is intended to be disabled by default could lead to import errors or unintended behavior.Key Changes
initialize()
to check theconfig.json
for each plugin's enabled status before attempting to import it.Motivation
The primary motivation behind this change is two-fold:
subfuz.py
more adaptable to various use cases and environments.Testing
The changes have been manually tested to confirm that plugins marked as "enable": false in
config.json
are not loaded, and no import errors occur as a result. This was verified by adjusting the configuration for several plugins and observing that only those configured as enabled were attempted to be loaded.I believe this enhancement will make
subfuz.py
more robust and user-friendly. I look forward to your feedback and any further suggestions for improvement.