Commit 61f89d87 authored by Jerome Touvier's avatar Jerome Touvier
Browse files

pre fix css

parent ff01ef86
Pipeline #46547 passed with stage
in 2 minutes and 16 seconds
import logging
import os
from flask import Flask, make_response, render_template, redirect, request
from flask import Flask, make_response, render_template, request
from apps.constants import VERSION
from apps.root import output
app = Flask(__name__, APPLICATION_ROOT="/resifws/resp")
app = Flask(__name__)
app.config["APPLICATION_ROOT"] = "/resifws/resp"
fmt = "[%(asctime)s] %(levelname)s [%(filename)s:%(lineno)d] [%(funcName)s] %(message)s"
......@@ -14,20 +14,12 @@ loglevel = logging.INFO if os.environ.get("RUNMODE") == "prodution" else logging
logging.basicConfig(format=fmt, level=loglevel)
BASE_URL = "/" + VERSION.split(".")[0]
#@app.route("/", strict_slashes=False)
#def root():
# return redirect(BASE_URL, code=301)
@app.route(BASE_URL + "/query", methods=["GET"])
@app.route("/query", methods=["GET"])
def resp_root_get():
return output(request, "resp")
@app.route(BASE_URL + "/application.wadl")
@app.route("/application.wadl")
def resp_wadl():
template = render_template("ws-resp.wadl.xml")
response = make_response(template)
......@@ -35,7 +27,7 @@ def resp_wadl():
return response
@app.route(BASE_URL + "/version")
@app.route("/version")
def version():
response = make_response(VERSION)
response.headers["Content-Type"] = "text/plain"
......@@ -43,14 +35,12 @@ def version():
@app.route("/")
@app.route(BASE_URL)
@app.route(BASE_URL + "/")
@app.route(BASE_URL + "/local=fr")
@app.route("/local=fr")
def resp_doc():
return render_template("resp_doc.html")
@app.route(BASE_URL + "/local=en")
@app.route("/local=en")
def resp_doc_en():
return render_template("resp_doc_en.html")
......
import logging
import os
from flask import Flask, make_response, render_template, redirect, request
from flask import Flask, make_response, render_template, request
from apps.constants import VERSION
from apps.root import output
......@@ -12,20 +12,13 @@ fmt = "[%(asctime)s] %(levelname)s [%(filename)s:%(lineno)d] [%(funcName)s] %(me
loglevel = logging.INFO if os.environ.get("RUNMODE") == "prodution" else logging.DEBUG
logging.basicConfig(format=fmt, level=loglevel)
BASE_URL = "/" + VERSION.split(".")[0]
@app.route("/")
def root():
return redirect(BASE_URL, code=302)
@app.route(BASE_URL + "/query", methods=["GET"])
@app.route("/query", methods=["GET"])
def sacpz_root_get():
return output(request, "sacpz")
@app.route(BASE_URL + "/application.wadl")
@app.route("/application.wadl")
def sacpz_wadl():
template = render_template("ws-sacpz.wadl.xml")
response = make_response(template)
......@@ -33,25 +26,24 @@ def sacpz_wadl():
return response
@app.route(BASE_URL + "/version", strict_slashes=False)
@app.route("/version", strict_slashes=False)
def version():
response = make_response(VERSION)
response.headers["Content-Type"] = "text/plain"
return response
@app.route("/", strict_slashes=False)
@app.route(BASE_URL, strict_slashes=False)
@app.route(BASE_URL + "/local=fr")
@app.route("/")
@app.route("/local=fr")
def sacpz_doc():
return render_template("sacpz_doc.html")
@app.route(BASE_URL + "/local=en")
@app.route("/local=en")
def sacpz_doc_en():
return render_template("sacpz_doc_en.html")
# **** MAIN ****
if __name__ == "__main__":
app.run(host="0.0.0.0")
app.run()
......@@ -14,11 +14,11 @@
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="../static/resifws.css"/>
<a href="local=en"> <img src="../static/images/en.png" alt="Français - Anglais"> </a>
<link rel="stylesheet" href="./static/resifws.css"/>
<a href="./local=en"> <img src="./static/images/en.png" alt="Français - Anglais"> </a>
</head>
<body>
<p style="text-align:center;"> <img src="../static/images/logoresif.png" alt="logoresif" width="341" height="95"></p>
<p style="text-align:center;"> <img src="./static/images/logoresif.png" alt="logoresif" width="341" height="95"></p>
<h1 id="webservice-fdsn-resp">Webservice FDSN resp</h1>
<p>Ce service donne accès aux informations sur des réponses instrumentales sélectionnées au format ASCII RESP.</p>
<h2 id="utilisation-de-la-requête">Utilisation de la requête</h2>
......
......@@ -14,11 +14,11 @@
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="../static/resifws.css"/>
<a href="local=fr"> <img src="../static/images/fr.png" alt="Anglais - Français"> </a>
<link rel="stylesheet" href="./static/resifws.css"/>
<a href="./local=fr"> <img src="./static/images/fr.png" alt="Anglais - Français"> </a>
</head>
<body>
<p style="text-align:center;"> <img src="../static/images/logoresif.png" alt="logoresif" width="341" height="95"></p>
<p style="text-align:center;"> <img src="./static/images/logoresif.png" alt="logoresif" width="341" height="95"></p>
<h1 id="webservice-fdsn-resp">Webservice FDSN resp</h1>
<p>The RESIF RESP web service returns response information of the selected instrument in RESP ASCII format.</p>
<h2 id="query-usage">Query usage</h2>
......
......@@ -14,11 +14,11 @@
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="../static/resifws.css"/>
<a href="local=en"> <img src="../static/images/en.png" alt="Français - Anglais"> </a>
<link rel="stylesheet" href="./static/resifws.css"/>
<a href="./local=en"> <img src="./static/images/en.png" alt="Français - Anglais"> </a>
</head>
<body>
<p style="text-align:center;"> <img src="../static/images/logoresif.png" alt="logoresif" width="341" height="95"></p>
<p style="text-align:center;"> <img src="./static/images/logoresif.png" alt="logoresif" width="341" height="95"></p>
<h1 id="webservice-fdsn-sacpz">Webservice FDSN sacpz</h1>
<p>Ce service donne les pôles et les zéros des réponses instrumentales sélectionnées au format ASCII SACPZ.</p>
<h2 id="utilisation-de-la-requête">Utilisation de la requête</h2>
......
......@@ -14,11 +14,11 @@
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="../static/resifws.css"/>
<a href="local=fr"> <img src="../static/images/fr.png" alt="Anglais - Français"> </a>
<link rel="stylesheet" href="./static/resifws.css"/>
<a href="./local=fr"> <img src="./static/images/fr.png" alt="Anglais - Français"> </a>
</head>
<body>
<p style="text-align:center;"> <img src="../static/images/logoresif.png" alt="logoresif" width="341" height="95"></p>
<p style="text-align:center;"> <img src="./static/images/logoresif.png" alt="logoresif" width="341" height="95"></p>
<h1 id="webservice-fdsn-sacpz">Webservice FDSN sacpz</h1>
<p>The RESIF SACPZ web service returns the poles and zeros of the selected instrument responses in SAC ASCII format.</p>
<h2 id="query-usage">Query usage</h2>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment