-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from qresp-code-development/qresp-1.1
Qresp 1.1
- Loading branch information
Showing
32 changed files
with
1,496 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ web/flask_session/ | |
flask_session/ | ||
web/dist/ | ||
web/project/__pycache__/ | ||
web/build/ | ||
web/qresp.egg-info/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,50 @@ | ||
language: python | ||
python: | ||
- "3.3" | ||
- "3.4" | ||
- "3.5" | ||
- "3.6" | ||
# command to install dependencies | ||
matrix: | ||
include: | ||
- os: linux | ||
python: 3.4 | ||
env: TOXENV=py34 | ||
- os: linux | ||
python: 3.5 | ||
env: TOXENV=py35 | ||
- os: linux | ||
python: 3.6 | ||
env: TOXENV=py36 | ||
- os: osx | ||
env: PYTHON=3.4.4 | ||
language: generic | ||
|
||
before_install: | | ||
if [ "$TRAVIS_OS_NAME" == "osx" ]; then | ||
brew update | ||
# Per the `pyenv homebrew recommendations <https://github.com/yyuu/pyenv/wiki#suggested-build-environment>`_. | ||
brew install openssl readline | ||
# See https://docs.travis-ci.com/user/osx-ci-environment/#A-note-on-upgrading-packages. | ||
# I didn't do this above because it works and I'm lazy. | ||
brew outdated pyenv || brew upgrade pyenv | ||
# virtualenv doesn't work without pyenv knowledge. venv in Python 3.3 | ||
# doesn't provide Pip by default. So, use `pyenv-virtualenv <https://github.com/yyuu/pyenv-virtualenv/blob/master/README.md>`_. | ||
brew install pyenv-virtualenv | ||
pyenv install $PYTHON | ||
# I would expect something like ``pyenv init; pyenv local $PYTHON`` or | ||
# ``pyenv shell $PYTHON`` would work, but ``pyenv init`` doesn't seem to | ||
# modify the Bash environment. ??? So, I hand-set the variables instead. | ||
export PYENV_VERSION=$PYTHON | ||
export PATH="/Users/travis/.pyenv/shims:${PATH}" | ||
pyenv-virtualenv venv | ||
source venv/bin/activate | ||
# A manual check that the correct version of Python is running. | ||
pip install --upgrade setuptools | ||
python --version | ||
fi | ||
install: | ||
- cd web | ||
- pip install -r requirements.txt | ||
- python setup.py install | ||
# command to run tests | ||
#script: | ||
# - pytest | ||
script: | ||
- nose2 --with-coverage -v | ||
|
||
after_success: | ||
- coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
version: '2' | ||
|
||
services: | ||
web: | ||
restart: always | ||
build: ./web | ||
expose: | ||
- 8080 | ||
ports: | ||
- "8080:8080" | ||
volumes: | ||
- ./web/:/usr/src/app/web | ||
environment: | ||
- KEY=<insert key> | ||
- GOOGLE_CLIENT_ID=<insert google client id> | ||
- GOOGLE_CLIENT_SECRET=<insert google client secret> | ||
- REDIRECT_URI=<insert redirect uri> | ||
- MAIL_ADDR=<administrators mail address> | ||
- MAIL_PWD=<administrators password> | ||
command: python run.py --host=0.0.0.0 --port 8080 | ||
|
||
nginx: | ||
restart: always | ||
build: ./nginx | ||
ports: | ||
- "8001:8001" | ||
volumes: | ||
- /www/static | ||
- ./papercollection:/usr/src/files | ||
volumes_from: | ||
- web | ||
depends_on: | ||
- web | ||
|
||
mongodb: | ||
image: mongo:latest | ||
container_name: "mongodb" | ||
environment: | ||
- MONGO_DATA_DIR=/usr/data/db | ||
- MONGO_LOG_DIR=/dev/null | ||
volumes: | ||
- ./data/db:/usr/data/db | ||
ports: | ||
- 27017:27017 | ||
command: mongod --smallfiles --logpath=/dev/null # --quiet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
recursive-include project/templates * | ||
recursive-include project/static * | ||
recursive-include project/static * | ||
include project/swagger.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
from .paperdao import * | ||
|
||
#edit swagger.yml file for method changes | ||
|
||
def search(searchWord=None,paperTitle=None,doi=None,tags=None,collectionList=None,authorsList=None,publicationList=None): | ||
""" | ||
This function responds to a request for /api/search | ||
with the complete lists of papers | ||
:return: list of papers | ||
""" | ||
allpaperslist = [] | ||
try: | ||
dao = PaperDAO() | ||
if collectionList: | ||
collectionList = collectionList.split(",") | ||
if authorsList: | ||
authorsList = authorsList.split(",") | ||
if publicationList: | ||
publicationList = publicationList.split(",") | ||
allpaperslist = dao.getAllFilteredSearchObjects(searchWord=searchWord,paperTitle=paperTitle,doi=doi, | ||
tags=tags,collectionList=collectionList, | ||
authorsList=authorsList,publicationList=publicationList) | ||
except Exception as e: | ||
print("Exception in search", e) | ||
return allpaperslist | ||
|
||
def collections(): | ||
""" | ||
This function responds to a request for /api/collections | ||
with the complete lists of c | ||
:return: list of collections | ||
""" | ||
allcollectionlist = [] | ||
try: | ||
dao = PaperDAO() | ||
allcollectionlist = dao.getCollectionList() | ||
except Exception as e: | ||
print("Exception in ", e) | ||
return list(allcollectionlist) | ||
|
||
def authors(): | ||
""" | ||
This function responds to a request for /api/authors | ||
with the complete lists of authors | ||
:return: list of authors | ||
""" | ||
allauthorlist = [] | ||
try: | ||
dao = PaperDAO() | ||
allauthorlist = dao.getAuthorList() | ||
except Exception as e: | ||
print("Exception in ", e) | ||
return list(allauthorlist) | ||
|
||
def publications(): | ||
""" | ||
This function responds to a request for /api/publications | ||
with the complete lists of publications | ||
:return: list of publications | ||
""" | ||
allpublist = [] | ||
try: | ||
dao = PaperDAO() | ||
allpublist = dao.getPublicationList() | ||
except Exception as e: | ||
print("Exception in ", e) | ||
return list(allpublist) | ||
|
||
def paper(id): | ||
""" | ||
This function responds to a request for /api/paper/{id} | ||
with the details of paper given id | ||
:return: paper details object | ||
""" | ||
paperdetail = None | ||
try: | ||
dao = PaperDAO() | ||
paperdetail = dao.getPaperDetails(id) | ||
except Exception as e: | ||
msg = "Exception in paper api " + str(e) | ||
print("Exception in paper api ", e) | ||
return e, 400 | ||
return paperdetail | ||
|
||
def workflow(id): | ||
""" | ||
This function responds to a request for /api/workflow/{id} | ||
with the workflow given id | ||
:return: workflow object | ||
""" | ||
workflowdetail = None | ||
try: | ||
dao = PaperDAO() | ||
workflowdetail = dao.getWorkflowDetails(id) | ||
except Exception as e: | ||
msg = "Exception in workflow api " + str(e) | ||
print("Exception in workflow api ", e) | ||
return msg,400 | ||
return workflowdetail | ||
|
||
def chart(id,cid): | ||
""" | ||
This function responds to a request for /api/paper/{id}/chart/{cid} | ||
with the chart given id | ||
:return: chart object | ||
""" | ||
chartworkflowdetail = None | ||
try: | ||
dao = PaperDAO() | ||
chartworkflowdetail = dao.getWorkflowForChartDetails(id, cid) | ||
except Exception as e: | ||
msg = "Exception in chart api " + str(e) | ||
print("Exception in chart api ", e) | ||
return msg,400 | ||
return chartworkflowdetail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.