Compute messages root path against project root dir in development environment
This commit is contained in:
parent
ddd97fb59c
commit
b5ddefdaac
|
@ -10,6 +10,10 @@ ROUGAIL_DTD_PATH = '../rougail/data/creole.dtd'
|
|||
POSTGRESQL_ADDRESS = '192.168.56.106'
|
||||
POSTGRESQL_PORT = 5432
|
||||
|
||||
import os
|
||||
from pathlib import PurePosixPath
|
||||
CURRENT_PATH = PurePosixPath(__file__)
|
||||
|
||||
def get_config():
|
||||
return {'database': {'host': 'localhost',
|
||||
'port': 5432,
|
||||
|
@ -18,10 +22,10 @@ def get_config():
|
|||
'password': 'risotto',
|
||||
},
|
||||
'http_server': {'port': 8080},
|
||||
'global': {'message_root_path': 'messages',
|
||||
'global': {'message_root_path': CURRENT_PATH.parents[2] / 'messages',
|
||||
'debug': DEBUG,
|
||||
'internal_user': 'internal',
|
||||
'rougail_dtd_path': '../rougail/data/creole.dtd'},
|
||||
'source': {'root_path': '/srv/seed'},
|
||||
'cache': {'root_path': '/var/cache/risotto'}
|
||||
'source': {'root_path': '/home/bbohard/Cadoles/tmp/srv/seed'},
|
||||
'cache': {'root_path': '/home/bbohard/Cadoles/tmp/var/cache/risotto'}
|
||||
}
|
||||
|
|
|
@ -9,9 +9,10 @@ from tiramisu import StrOption, IntOption, BoolOption, ChoiceOption, OptionDescr
|
|||
from yaml import load, SafeLoader
|
||||
from os import listdir
|
||||
from os.path import isfile
|
||||
from ..config import MESSAGE_ROOT_PATH
|
||||
from ..config import get_config
|
||||
from ..utils import _
|
||||
|
||||
MESSAGE_ROOT_PATH = get_config().get('global').get('message_root_path')
|
||||
|
||||
groups.addgroup('message')
|
||||
|
||||
|
|
Loading…
Reference in New Issue