Merge branch 'master' of github.com:ZeusWPI/Haldis

This commit is contained in:
Jasper Janin 2022-10-27 20:28:11 +02:00
commit 28fa1b7592
4 changed files with 39 additions and 19 deletions

View file

@ -3,11 +3,13 @@
"""Main Haldis script"""
import logging
import sentry_sdk
import typing
from datetime import datetime
from logging.handlers import TimedRotatingFileHandler
from admin import init_admin
from config import Configuration
from flask import Flask, render_template
from flask_bootstrap import Bootstrap, StaticCDN
from flask_debugtoolbar import DebugToolbarExtension
@ -19,6 +21,7 @@ from login import init_login
from markupsafe import Markup
from models import db
from models.anonymous_user import AnonymouseUser
from sentry_sdk.integrations.flask import FlaskIntegration
from utils import euro_string, price_range_string, ignore_none
from zeus import init_oauth
@ -171,5 +174,11 @@ def create_app():
# For usage when you directly call the script with python
if __name__ == "__main__":
if Configuration.SENTRY_DSN:
sentry_sdk.init(
dsn=Configuration.SENTRY_DSN,
integrations=[FlaskIntegration()]
)
app, app_mgr = create_app()
app_mgr.run()

View file

@ -12,5 +12,6 @@ class Configuration:
SECRET_KEY = "<change>"
SLACK_WEBHOOK = None
LOGFILE = "haldis.log"
SENTRY_DSN = None
ZEUS_KEY = "tomtest"
ZEUS_SECRET = "blargh"

View file

@ -12,3 +12,4 @@ black
pymysql
pyyaml
tatsu<5.6 # >=5.6 needs Python >=3.8
sentry-sdk[flask]

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile
@ -11,11 +11,15 @@ appdirs==1.4.4
black==21.6b0
# via -r requirements.in
blinker==1.4
# via flask-debugtoolbar
# via
# flask-debugtoolbar
# sentry-sdk
cachelib==0.1.1
# via flask-oauthlib
certifi==2021.5.30
# via requests
# via
# requests
# sentry-sdk
chardet==4.0.0
# via requests
click==7.1.2
@ -24,6 +28,19 @@ click==7.1.2
# flask
dominate==2.6.0
# via flask-bootstrap
flask==1.1.4
# via
# -r requirements.in
# flask-admin
# flask-bootstrap
# flask-debugtoolbar
# flask-login
# flask-migrate
# flask-oauthlib
# flask-script
# flask-sqlalchemy
# flask-wtf
# sentry-sdk
flask-admin==1.5.8
# via -r requirements.in
flask-bootstrap==3.3.7.1
@ -44,18 +61,6 @@ flask-sqlalchemy==2.5.1
# flask-migrate
flask-wtf==0.15.1
# via -r requirements.in
flask==1.1.4
# via
# -r requirements.in
# flask-admin
# flask-bootstrap
# flask-debugtoolbar
# flask-login
# flask-migrate
# flask-oauthlib
# flask-script
# flask-sqlalchemy
# flask-wtf
greenlet==1.1.0
# via sqlalchemy
idna==2.10
@ -92,10 +97,12 @@ pyyaml==5.4.1
# via -r requirements.in
regex==2021.4.4
# via black
requests-oauthlib==1.1.0
# via flask-oauthlib
requests==2.25.1
# via requests-oauthlib
requests-oauthlib==1.1.0
# via flask-oauthlib
sentry-sdk[flask]==1.10.1
# via -r requirements.in
six==1.16.0
# via python-dateutil
sqlalchemy==1.4.18
@ -106,8 +113,10 @@ tatsu==4.4.0
# via -r requirements.in
toml==0.10.2
# via black
urllib3==1.26.5
# via requests
urllib3==1.26.12
# via
# requests
# sentry-sdk
visitor==0.1.3
# via flask-bootstrap
werkzeug==1.0.1