From a4a42505ba9d5408846cfdb0f315abaa619d62aa Mon Sep 17 00:00:00 2001 From: yuanzhou Date: Tue, 3 Sep 2024 14:19:36 -0400 Subject: [PATCH] Revert "Tweaks for deployment" --- .../assayclasses_dev => dev}/.gitignore | 0 .../routes/assayclasses_dev => dev}/README.md | 0 .../routes/assayclasses_dev => dev}/app.py | 19 ++----------------- .../assayclasses.json | 0 .../instance/app.cfg.example | 0 .../assayclasses_dev => dev}/requirements.txt | 0 .../assayclasses_dev => dev}/test_api.sh | 0 src/main.py | 7 ------- 8 files changed, 2 insertions(+), 24 deletions(-) rename {src/hs_ontology_api/routes/assayclasses_dev => dev}/.gitignore (100%) rename {src/hs_ontology_api/routes/assayclasses_dev => dev}/README.md (100%) rename {src/hs_ontology_api/routes/assayclasses_dev => dev}/app.py (86%) rename {src/hs_ontology_api/routes/assayclasses_dev => dev}/assayclasses.json (100%) rename {src/hs_ontology_api/routes/assayclasses_dev => dev}/instance/app.cfg.example (100%) rename {src/hs_ontology_api/routes/assayclasses_dev => dev}/requirements.txt (100%) rename {src/hs_ontology_api/routes/assayclasses_dev => dev}/test_api.sh (100%) diff --git a/src/hs_ontology_api/routes/assayclasses_dev/.gitignore b/dev/.gitignore similarity index 100% rename from src/hs_ontology_api/routes/assayclasses_dev/.gitignore rename to dev/.gitignore diff --git a/src/hs_ontology_api/routes/assayclasses_dev/README.md b/dev/README.md similarity index 100% rename from src/hs_ontology_api/routes/assayclasses_dev/README.md rename to dev/README.md diff --git a/src/hs_ontology_api/routes/assayclasses_dev/app.py b/dev/app.py similarity index 86% rename from src/hs_ontology_api/routes/assayclasses_dev/app.py rename to dev/app.py index eeeaa2c..481cd76 100644 --- a/src/hs_ontology_api/routes/assayclasses_dev/app.py +++ b/dev/app.py @@ -1,24 +1,9 @@ import os import json +from flask import Flask, request, Response, abort from urllib.request import urlopen from urllib.error import HTTPError import logging -from flask import Flask, request, Response, abort, Blueprint - - -#################################################################################################### -# For assayclasses development needs - Zhou 8/28/2024 -assayclasses_dev_blueprint = Blueprint('assayclasses-dev', __name__, url_prefix='/assayclasses-dev') - -@assayclasses_dev_blueprint.route('', methods=['GET']) -def assayclasses_dev_get_all(): - return assayclass() - -@assayclasses_dev_blueprint.route('/', methods=['GET']) -def assayclasses_dev_get_by_code(code): - return assayclasses_by_code(code) -#################################################################################################### - # # This is a RESTful service that exposes two endpoints: @@ -45,7 +30,7 @@ def assayclasses_dev_get_by_code(code): app = Flask(__name__, - instance_path=os.path.join(os.path.abspath(os.path.dirname(__file__)), '../../instance'), + instance_path=os.path.join(os.path.abspath(os.path.dirname(__file__)), 'instance'), instance_relative_config=True) app.config.from_pyfile('app.cfg') diff --git a/src/hs_ontology_api/routes/assayclasses_dev/assayclasses.json b/dev/assayclasses.json similarity index 100% rename from src/hs_ontology_api/routes/assayclasses_dev/assayclasses.json rename to dev/assayclasses.json diff --git a/src/hs_ontology_api/routes/assayclasses_dev/instance/app.cfg.example b/dev/instance/app.cfg.example similarity index 100% rename from src/hs_ontology_api/routes/assayclasses_dev/instance/app.cfg.example rename to dev/instance/app.cfg.example diff --git a/src/hs_ontology_api/routes/assayclasses_dev/requirements.txt b/dev/requirements.txt similarity index 100% rename from src/hs_ontology_api/routes/assayclasses_dev/requirements.txt rename to dev/requirements.txt diff --git a/src/hs_ontology_api/routes/assayclasses_dev/test_api.sh b/dev/test_api.sh similarity index 100% rename from src/hs_ontology_api/routes/assayclasses_dev/test_api.sh rename to dev/test_api.sh diff --git a/src/main.py b/src/main.py index beb5977..8839c2d 100755 --- a/src/main.py +++ b/src/main.py @@ -73,13 +73,6 @@ def make_flask_config(): app.register_blueprint(assayclasses_blueprint) -#################################################################################################### -# For assayclasses development needs - Zhou 8/28/2024 -from hs_ontology_api.routes.assayclasses_dev.app import assayclasses_dev_blueprint -app.register_blueprint(assayclasses_dev_blueprint) -#################################################################################################### - - # Instantiate a Cells API client. # May 2024 Deprecated # cellsurl = make_flask_config().get('CELLSURL')