core: add 'core' config section, add disabled_modules/enabled_modules configs, use them for hpi modules and hpi doctor
This commit is contained in:
parent
f939daac99
commit
70c801f692
6 changed files with 121 additions and 35 deletions
|
@ -40,12 +40,11 @@ def cache_dir() -> Path:
|
|||
class config:
|
||||
cache_dir = '/your/custom/cache/path'
|
||||
'''
|
||||
import my.config as C
|
||||
common_config = getattr(C, 'common', object())
|
||||
# TODO if attr is set _and_ it's none, disable cache?
|
||||
cdir = getattr(common_config, 'cache_dir', None)
|
||||
from .core_config import config
|
||||
cdir = config.cache_dir
|
||||
if cdir is None:
|
||||
# TODO fallback to default cachew dir instead?
|
||||
# TODO handle this in core_config.py
|
||||
# TODO fallback to default cachew dir instead? or appdirs cache
|
||||
return Path('/var/tmp/cachew')
|
||||
else:
|
||||
return Path(cdir)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue