diff options
author | Pjotr Prins | 2016-10-12 10:51:40 +0000 |
---|---|---|
committer | Pjotr Prins | 2016-10-12 10:51:40 +0000 |
commit | 88fa71d35fe261470bcfcb184aea14c5fb5b7c5e (patch) | |
tree | 0dac654f21d4ddfde97fe7cbd3f5b8b84e4d6872 /wqflask | |
parent | f0e23bc920b53414c5b698946d3591f31865c95e (diff) | |
download | genenetwork2-88fa71d35fe261470bcfcb184aea14c5fb5b7c5e.tar.gz |
API: GN_SERVER_URL and test
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/runserver.py | 11 | ||||
-rw-r--r-- | wqflask/utility/logger.py | 2 | ||||
-rw-r--r-- | wqflask/wqflask/templates/marker_regression_gn1.html | 10 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 1 |
4 files changed, 16 insertions, 8 deletions
diff --git a/wqflask/runserver.py b/wqflask/runserver.py index 0342b7ad..adacc712 100644 --- a/wqflask/runserver.py +++ b/wqflask/runserver.py @@ -19,11 +19,18 @@ ENDC = '\033[0m' import os app.config['SECRET_KEY'] = os.urandom(24) -from utility.tools import WEBSERVER_MODE,get_setting_int +from utility.tools import WEBSERVER_MODE,get_setting_int,get_setting port = get_setting_int("SERVER_PORT") -logger.info("GN2 is running. Visit %shttp://localhost:%s/%s" % (BLUE,port,ENDC)) +print("GN2 API server URL is ["+BLUE+get_setting("GN_SERVER_URL")+ENDC+"]") + +import requests +page = requests.get(get_setting("GN_SERVER_URL")) +if page.status_code != 200: + raise Exception("API server not found!") + +print("GN2 is running. Visit %s[http://localhost:%s/%s](%s)" % (BLUE,str(port),ENDC,get_setting("WEBSERVER_URL"))) werkzeug_logger = logging.getLogger('werkzeug') diff --git a/wqflask/utility/logger.py b/wqflask/utility/logger.py index bacb0aa4..128706df 100644 --- a/wqflask/utility/logger.py +++ b/wqflask/utility/logger.py @@ -72,7 +72,7 @@ LOG_LEVEL_DEBUG (NYI). def warning(self,*args): """Call logging.warning for multiple args""" self.collect(self.logger.warning,*args) - self.logger.warning(self.collect(*args)) + # self.logger.warning(self.collect(*args)) def error(self,*args): """Call logging.error for multiple args""" diff --git a/wqflask/wqflask/templates/marker_regression_gn1.html b/wqflask/wqflask/templates/marker_regression_gn1.html index a39da73a..7aceabee 100644 --- a/wqflask/wqflask/templates/marker_regression_gn1.html +++ b/wqflask/wqflask/templates/marker_regression_gn1.html @@ -414,9 +414,9 @@ provides_entrypoints: true }); BD.putSource({name: 'Genotype', - controlURI: "http://test-gn2.genenetwork.org/api_pre1/genotype/mouse/BXD.json", - URIBase: "http://test-gn2.genenetwork.org/api_pre1/genotype/mouse/", - tier_type: 'rqtl-genotype', + controlURI: gn_server_url+"/api_pre1/genotype/mouse/BXD.json", + URIBase: gn_server_url+"/api_pre1/genotype/mouse/", + tier_type: 'rqtl-genotype', vOffset: 8, pinned: true, transposed: true, @@ -465,7 +465,7 @@ }); BD.putSource({name: 'QTL', tier_type: 'qtl', - uri: 'http://localhost:5003/generated_text/{{csv_filename}}', + uri: '/generated_text/{{csv_filename}}', style: [{ type: 'default', style: { @@ -480,7 +480,7 @@ }], }); BD.putSource({name: 'SNP density', - jbURI: "http://test-gn2.genenetwork.org/api_pre1/snp", + jbURI: gn_server_url+"/api_pre1/snp", jbQuery: "", refetchOnZoom: true, style: [{ diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 289d2dc6..8d5eadb6 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -549,6 +549,7 @@ def marker_regression_page(): gn1_template_vars = marker_regression_gn1.MarkerRegression(result).__dict__ gn1_template_vars['json_filename'] = json_filename; gn1_template_vars['csv_filename'] = csv_filename; + gn1_template_vars['gn_server_url'] = GN_SERVER_URL; pickled_result = pickle.dumps(result, pickle.HIGHEST_PROTOCOL) logger.info("pickled result length:", len(pickled_result)) |