mirror of
https://github.com/tiyn/amphora-wiki.git
synced 2026-02-22 12:54:48 +01:00
src: fixed quote-signs
This commit is contained in:
38
src/app.py
38
src/app.py
@@ -18,38 +18,38 @@ STYLE = config.STYLE
|
||||
|
||||
@app.errorhandler(404)
|
||||
def page_not_found(e):
|
||||
return render_template('error.html', title=TITLE, errorcode='404', style=STYLE), 404
|
||||
return render_template("error.html", title=TITLE, errorcode="404", style=STYLE), 404
|
||||
|
||||
|
||||
@app.route('/')
|
||||
@app.route('/index.html')
|
||||
@app.route("/")
|
||||
@app.route("/index.html")
|
||||
def index():
|
||||
return render_template('index.html', title=TITLE, style=STYLE), 200
|
||||
return render_template("index.html", title=TITLE, style=STYLE), 200
|
||||
|
||||
|
||||
@app.route('/search', methods=['GET', 'POST'])
|
||||
@app.route('/search.html', methods=['GET', 'POST'])
|
||||
@app.route("/search", methods=["GET", "POST"])
|
||||
@app.route("/search.html", methods=["GET", "POST"])
|
||||
def search():
|
||||
form = SearchForm()
|
||||
if request.method == 'POST':
|
||||
query_str = request.form['query_str']
|
||||
if request.method == "POST":
|
||||
query_str = request.form["query_str"]
|
||||
content = cont.gen_query_res_string(query_str)
|
||||
return render_template('search.html', title=TITLE, style=STYLE, form=form, content=content), 200
|
||||
return render_template('search.html', title=TITLE, style=STYLE, form=form, content=''), 200
|
||||
return render_template("search.html", title=TITLE, style=STYLE, form=form, content=content), 200
|
||||
return render_template("search.html", title=TITLE, style=STYLE, form=form, content=""), 200
|
||||
|
||||
|
||||
@app.route('/entry/<path:fullurl>')
|
||||
@app.route("/entry/<path:fullurl>")
|
||||
def entry(fullurl):
|
||||
content = cont.gen_stand_string(fullurl)
|
||||
return render_template('entry.html', title=TITLE, style=STYLE, content=content), 200
|
||||
return render_template("entry.html", title=TITLE, style=STYLE, content=content), 200
|
||||
|
||||
@app.route('/namespace/', defaults={'fullurl': ''})
|
||||
@app.route('/namespace/<path:fullurl>')
|
||||
def namespace(fullurl=''):
|
||||
@app.route("/namespace/", defaults={"fullurl": ""})
|
||||
@app.route("/namespace/<path:fullurl>")
|
||||
def namespace(fullurl=""):
|
||||
content = cont.gen_arch_string(fullurl)
|
||||
if content == None:
|
||||
return render_template('error.html', title=TITLE, errorcode='404', style=STYLE), 404
|
||||
return render_template('entry.html', title=TITLE, style=STYLE, content=content), 200
|
||||
return render_template("error.html", title=TITLE, errorcode="404", style=STYLE), 404
|
||||
return render_template("entry.html", title=TITLE, style=STYLE, content=content), 200
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host='0.0.0.0')
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0")
|
||||
|
||||
Reference in New Issue
Block a user