Import DATA_DIR correctly

Fix for f6bfabc7aa.
This commit is contained in:
Luke Murphy 2019-08-01 16:51:04 +02:00
parent f6bfabc7aa
commit 659e20d5f5
No known key found for this signature in database
GPG key ID: 5E2EF5A63E3718CC

View file

@ -13,7 +13,7 @@ from geventwebsocket import WebSocketError
from bottle import run, request, response, Bottle, HTTPResponse from bottle import run, request, response, Bottle, HTTPResponse
from bottle import abort from bottle import abort
from moulinette import msignals, m18n, DATA_DIR from moulinette import msignals, m18n, env
from moulinette.core import MoulinetteError, clean_session from moulinette.core import MoulinetteError, clean_session
from moulinette.interfaces import ( from moulinette.interfaces import (
BaseActionsMapParser, BaseInterface, ExtendedArgumentParser, BaseActionsMapParser, BaseInterface, ExtendedArgumentParser,
@ -789,6 +789,8 @@ class Interface(BaseInterface):
category -- Name of the category category -- Name of the category
""" """
DATA_DIR = env()['DATA_DIR']
if category is None: if category is None:
with open('%s/../doc/resources.json' % DATA_DIR) as f: with open('%s/../doc/resources.json' % DATA_DIR) as f:
return f.read() return f.read()