Actions
Cleanup #49363
openmgr/dashboard: remove settins.py module and refactor MODULE_OPTIONS
% Done:
0%
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:
Description
It's no longer necessary, creates lots of unnecessary CLI commands and overrides some existing/better behaviours. Anything identified that is positive, it should be moved to mgr_module level (or mgr_utils) so that other modules can benefit from it.
Perhaps a possibility would be to replace MODULE_OPTIONS with a class that provides better functionality and encapsulates code:
MODULE_OPTIONS = ModuleOptions([
Option('foo', int)
])
...
self.MODULE_OPTIONS['foo'] = 'bar'
print(self.MODULE_OPTIONS['foo'])
>>> 'bar'
It might bring some extra features:
- If option
runtime
is False, the value is fetched at the beginning and cached since then. - Provide mypy/typing hints/generics.
Updated by Ernesto Puerta about 3 years ago
- Project changed from mgr to Dashboard
- Category changed from 132 to General
Actions