-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
153 additions
and
70 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
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,39 +1,34 @@ | ||
from flask import Flask, render_template | ||
from flask_bootstrap import Bootstrap | ||
from quart import Quart, render_template | ||
|
||
from app.bot import bot_blueprint | ||
from app.site.routes import site_blueprint | ||
|
||
bootstrap = Bootstrap() | ||
|
||
|
||
def create_app(): | ||
""" | ||
Create app | ||
""" | ||
|
||
new_app = Flask(__name__) | ||
bootstrap.init_app(new_app) | ||
new_app = Quart(__name__) | ||
new_app.register_blueprint(bot_blueprint, url_prefix="/bot") | ||
new_app.register_blueprint(site_blueprint, url_prefix="/site") | ||
new_app.debug = True | ||
new_app.debug = False | ||
|
||
@new_app.errorhandler(404) | ||
def page_not_found(_): | ||
return render_template("404.html"), 404 | ||
async def page_not_found(_): | ||
return await render_template("404.html"), 404 | ||
|
||
@new_app.route("/", methods=["GET"]) | ||
@new_app.route("/index") | ||
def index(): | ||
async def index(): | ||
""" | ||
example endpoint | ||
""" | ||
return render_template("index.html") | ||
return await render_template("index.html") | ||
|
||
return new_app | ||
|
||
|
||
app = create_app() | ||
|
||
if __name__ == "__main__": | ||
app = create_app() | ||
app.run() |
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,4 +1,4 @@ | ||
Flask[async]>=3.0 | ||
Quart>=0.19.8 | ||
psycopg2-binary>=2.9 | ||
SQLAlchemy[asyncio]>=2.0 | ||
Loglan-Core>=0.5.0 | ||
|
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,5 +1,4 @@ | ||
-r ../requirements.txt | ||
|
||
Flask-Bootstrap~=3.3 | ||
Beautifulsoup4~=4.12 | ||
lxml~=5.3 |
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 |
---|---|---|
@@ -1,13 +1,57 @@ | ||
{% extends "bootstrap/base.html" %} | ||
{% block title %}fonifo{% endblock %} | ||
|
||
{% block navbar %} | ||
<div class="navbar navbar-fixed-top"> | ||
<!-- ... --> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="mx-3 px-3" style="margin-left: 25px"><h1>404</h1><br> | ||
Levi pidri, jio tu na begco pei, no dzabi. Soi ceokra!<br></div> | ||
{% endblock %} | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="icon" | ||
type="image/png" | ||
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADJ0lEQVQ4T21TWUwTURQ9701bpmWAAq2tUlCQQhBRjPrhEomoARMVExdI1A+/MIS6JeKX30YSNaL4YeKHGrcS14AmKmpEMCYajUsEWdQWQaoVSwfaaWfmaYcl1vj+7rn3nHffPfcR/Ofs3XvDLMuRVYTQWeNpVWc08hfq6ysG/i0nfwPV1RedvKBvAUOO0Wob5a3JRjDg5/tuPQgDCOlUJLWisbHq4yRvSqCmxl2u59UWoWCUKmICTOlFsCyeB0WKovv8Lczc2YefzywIdgoKZFrW0LClNSaiCdTUuHN1Caxr2mofTSocQeSHAUPN+cipXA/GgJ5z1+HY0Q2doCDwKhX+tnQ1JLK8M2eqejWB3fuufEyaIzqnrRnSOvv1Mg1hTwEyy0u0eOBBOwyON0hZMKzFvns2BDuT3jUcqywidXXXHOGI7M3e9QmUV7SC2C2hvnw41paCECDQ9Rkjng7YN3zW8rLI4cvZbDCZ5ZLa2qtHTJmRAxmVnql5MBXov5AL29ISJDpskENheFsegimjSFs+iMRcEd6Ls1h40HCUuFzuGynzgxutq7/FOeRvs8KgW4G04vxxnDGI/T4MtD5F1o5e+GMDfZvcTFyuppspxYEK66rx92uuRygGmmYitWAJzAUTqzCR+/78FQI9PaC8hIiPbya1tVcOm7KiBzO2eogajRGzIQ1RJM22Y0bpMhCOgskKGGOgep0mMzb4A1/vd0RlMXyI7N9/OVNm1JNd/Qmhfh7B14XIKFsJquO0YskfgKf5EVRZhW1JMaThEQhZ0+G90y5RUPuEje4uwSnmRX8ZYXYuROpc5zh5eASe262wlHrBFA7B91bw0wMYfmEGU+nVkyc2V8UtktGWTrPWl4JQAiUkoa/pLiwrvRDyglPzCbw2w/8kXY2Gaf7p01t7pqzbs+fSPNCE+4mZNsFessg0+LgDBnsv0pb5NLIyxsHfZoHYJahKhFt36tSWuzE87jO5XG4r0XFHoLLtjCn65EIRRK9CGjIyyacjhEM3VZTy48e39U22FCcwCdbV3ZoxNhbZRQgrin1BxtgHk4lrrK/f1B+3LH+C3+k0TOAiD2BKAAAAAElFTkSuQmCC"/> | ||
|
||
<!-- Bootstrap CSS --> | ||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous"> | ||
</head> | ||
<title>{% block title %}fonifo{% endblock %}</title> | ||
|
||
<style> | ||
body { | ||
font-family: 'Georgia', serif; | ||
display: flex; | ||
flex-direction: column; | ||
min-height: 100vh; | ||
} | ||
.header { | ||
text-align: center; | ||
} | ||
.content { | ||
flex: 1 0 auto; | ||
} | ||
.footer { | ||
font-size: 14px; | ||
margin-right: 10px; | ||
padding-left: 15px; | ||
} | ||
|
||
{% block style %}{% endblock %} | ||
</style> | ||
|
||
<body> | ||
<div class="content"> | ||
{% block content %} | ||
<div class="mx-3 px-3" style="margin-left: 25px"><h1>404</h1><br> | ||
Levi pidri, jio tu na begco pei, no dzabi. Soi ceokra!<br></div> | ||
{% endblock %} | ||
</div> | ||
<footer> | ||
<nav class="navbar navbar-expand-lg bg-light"> | ||
<ul class="navbar-nav"> | ||
<li class="nav-item"> | ||
<div class="container-fluent footer">Copyright © <script type="text/javascript">var year = new Date();document.write(year.getFullYear());</script> by <a href="http://www.loglan.org/">The Loglan Institute</a> & <a href="https://github.com/torrua">torrua</a>. All rights reserved.</div> | ||
</li> | ||
</ul> | ||
</nav> | ||
</footer> | ||
|
||
<!-- Bootstrap Bundle with Popper --> | ||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></script> | ||
</body> | ||
</html> |
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,57 @@ | ||
{% extends "bootstrap/base.html" %} | ||
{% block title %}Loglan Documentation{% endblock %} | ||
|
||
{% block navbar %} | ||
<div class="navbar navbar-fixed-top"> | ||
<!-- ... --> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="mx-3 px-3" style="margin-left: 25px"><h1>Loglan Documentation</h1><br> | ||
Loi, logli! <br>Ti po lo fomyrirda je la Loglan.<br></div> | ||
{% endblock %} | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="icon" | ||
type="image/png" | ||
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADJ0lEQVQ4T21TWUwTURQ9701bpmWAAq2tUlCQQhBRjPrhEomoARMVExdI1A+/MIS6JeKX30YSNaL4YeKHGrcS14AmKmpEMCYajUsEWdQWQaoVSwfaaWfmaYcl1vj+7rn3nHffPfcR/Ofs3XvDLMuRVYTQWeNpVWc08hfq6ysG/i0nfwPV1RedvKBvAUOO0Wob5a3JRjDg5/tuPQgDCOlUJLWisbHq4yRvSqCmxl2u59UWoWCUKmICTOlFsCyeB0WKovv8Lczc2YefzywIdgoKZFrW0LClNSaiCdTUuHN1Caxr2mofTSocQeSHAUPN+cipXA/GgJ5z1+HY0Q2doCDwKhX+tnQ1JLK8M2eqejWB3fuufEyaIzqnrRnSOvv1Mg1hTwEyy0u0eOBBOwyON0hZMKzFvns2BDuT3jUcqywidXXXHOGI7M3e9QmUV7SC2C2hvnw41paCECDQ9Rkjng7YN3zW8rLI4cvZbDCZ5ZLa2qtHTJmRAxmVnql5MBXov5AL29ISJDpskENheFsegimjSFs+iMRcEd6Ls1h40HCUuFzuGynzgxutq7/FOeRvs8KgW4G04vxxnDGI/T4MtD5F1o5e+GMDfZvcTFyuppspxYEK66rx92uuRygGmmYitWAJzAUTqzCR+/78FQI9PaC8hIiPbya1tVcOm7KiBzO2eogajRGzIQ1RJM22Y0bpMhCOgskKGGOgep0mMzb4A1/vd0RlMXyI7N9/OVNm1JNd/Qmhfh7B14XIKFsJquO0YskfgKf5EVRZhW1JMaThEQhZ0+G90y5RUPuEje4uwSnmRX8ZYXYuROpc5zh5eASe262wlHrBFA7B91bw0wMYfmEGU+nVkyc2V8UtktGWTrPWl4JQAiUkoa/pLiwrvRDyglPzCbw2w/8kXY2Gaf7p01t7pqzbs+fSPNCE+4mZNsFessg0+LgDBnsv0pb5NLIyxsHfZoHYJahKhFt36tSWuzE87jO5XG4r0XFHoLLtjCn65EIRRK9CGjIyyacjhEM3VZTy48e39U22FCcwCdbV3ZoxNhbZRQgrin1BxtgHk4lrrK/f1B+3LH+C3+k0TOAiD2BKAAAAAElFTkSuQmCC"/> | ||
|
||
<!-- Bootstrap CSS --> | ||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous"> | ||
<title>{% block title %}Loglan Documentation{% endblock %}</title> | ||
</head> | ||
|
||
<style> | ||
body { | ||
font-family: 'Georgia', serif; | ||
display: flex; | ||
flex-direction: column; | ||
min-height: 100vh; | ||
} | ||
.header { | ||
text-align: center; | ||
} | ||
.content { | ||
flex: 1 0 auto; | ||
} | ||
.footer { | ||
font-size: 14px; | ||
margin-right: 10px; | ||
padding-left: 15px; | ||
} | ||
|
||
{% block style %}{% endblock %} | ||
</style> | ||
|
||
<body> | ||
<div class="content"> | ||
{% block content %} | ||
<div class="mx-3 px-3" style="margin-left: 25px"><h1>Loglan Documentation</h1><br> | ||
Loi, logli! <br>Ti po lo fomyrirda je la Loglan.<br></div> | ||
{% endblock %} | ||
</div> | ||
<footer> | ||
<nav class="navbar navbar-expand-lg bg-light"> | ||
<ul class="navbar-nav"> | ||
<li class="nav-item"> | ||
<div class="container-fluent footer">Copyright © <script type="text/javascript">var year = new Date();document.write(year.getFullYear());</script> by <a href="http://www.loglan.org/">The Loglan Institute</a> & <a href="https://github.com/torrua">torrua</a>. All rights reserved.</div> | ||
</li> | ||
</ul> | ||
</nav> | ||
</footer> | ||
|
||
<!-- Bootstrap Bundle with Popper --> | ||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></script> | ||
</body> | ||
</html> |