Skip to content

Commit

Permalink
Adds settings.cfg file
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelChavas committed May 12, 2021
1 parent fdde9e5 commit 5a525e4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Useful commands for development:
pip install pre-commit
pre-commit install # install the pre-commit hook
# Before a commit, you can launch the pre-commit:
pre-commit run --all-files
Contributing
============
Expand Down
6 changes: 3 additions & 3 deletions hbp_spatial_backend/api_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ def get_graph_yaml():
which links the template spaces. **The format of this file is subject to
change, this endpoint may be modified or removed at any time.**
"""
logger.error('default path to graph.yaml: %s',
current_app.config['DEFAULT_TRANSFORM_GRAPH'])
logger.error('instance path: %s', current_app.instance_path)
logger.info('default path to graph.yaml: %s',
current_app.config['DEFAULT_TRANSFORM_GRAPH'])
logger.info('instance path: %s', current_app.instance_path)
return flask.send_file(current_app.config['DEFAULT_TRANSFORM_GRAPH'],
mimetype='text/x-yaml')

Expand Down
3 changes: 3 additions & 0 deletions run-flask-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ FLASK_APP=hbp_spatial_backend
FLASK_ENV=development
export PYTHONPATH FLASK_APP FLASK_ENV

HBP_SPATIAL_BACKEND_SETTINGS=$PWD/settings.cfg
export HBP_SPATIAL_BACKEND_SETTINGS

flask run "$@"
6 changes: 6 additions & 0 deletions settings.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Sets path to transform graph
#It is loaded when running run-flask-dev.sh,
#in which the environnment variable HBP_SPATIAL_BACKEND_SETTINGS
#is set to read this configuration file
#Uncomment the following line and give the path to your graph yaml file:
#DEFAULT_TRANSFORM_GRAPH = 'instance/graph.yaml'

0 comments on commit 5a525e4

Please sign in to comment.