mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
We do this to make it easier to control this value during testing. We should not import these values at package setup time. Nor should we import them at package load time. This change introduces a new API for the Moulinette package. The moulinette.env accessor. This is a breaking change. However, I've searched around and can't seem to find any usage that relies directly on these properties being available. I've tried to maintain API backwards compatibility in all cases otherwise.
12 lines
451 B
Python
12 lines
451 B
Python
"""Moulinette global configuration core."""
|
|
|
|
from os import environ
|
|
|
|
|
|
def init_moulinette_env():
|
|
return {
|
|
'DATA_DIR': environ.get('MOULINETTE_DATA_DIR', '/usr/share/moulinette'),
|
|
'LIB_DIR': environ.get('MOULINETTE_LIB_DIR', '/usr/lib/moulinette'),
|
|
'LOCALES_DIR': environ.get('MOULINETTE_LOCALES_DIR', '/usr/share/moulinette/locale'),
|
|
'CACHE_DIR': environ.get('MOULINETTE_CACHE_DIR', '/var/cache/moulinette'),
|
|
}
|