Merge pull request #211 from decentral1se/fix-broken-import

Import DATA_DIR correctly
This commit is contained in:
Alexandre Aubin 2019-08-01 16:53:46 +02:00 committed by GitHub
commit 6185526bb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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()