Refactoring of the settings module to be more modular and extensible
|Reported by:||the_drow||Owned by:||the_drow|
|Has patch:||yes||Needs documentation:||yes|
|Needs tests:||yes||Patch needs improvement:||no|
I refactored the settings module to be much more modular and extensible.
It is now possible to switch a Setting class much more easily by injecting it into the LazySettings object's constructor.
This change also introduces the new SettingsCollector class which allows you to control exactly how the settings are being collected from the setting.py module.
It is possible to inject the SettingsCollector class to the Settings class through the constructor as well.
The only thing that is missing in this patch is a method to switch the settings class. That I don't really have an idea how to implement correctly.
This patch oviously needs tests which I didn't have time to write (I spent a full day working on this) and documentation.
Change History (3)
comment:1 Changed 12 months ago by aaugustin
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Resolution set to needsinfo
- Status changed from new to closed
comment:2 Changed 12 months ago by the_drow
- Needs documentation set
- Needs tests set
- Resolution needsinfo deleted
- Status changed from closed to new