modernize type hinting

This commit is contained in:
Patrick Jentsch
2024-09-25 17:46:53 +02:00
parent 02e6c7c16c
commit 492fdc9d28
13 changed files with 116 additions and 88 deletions

12
wsgi.py
View File

@ -4,17 +4,16 @@ import eventlet
eventlet.monkey_patch()
from flask import Flask # noqa
from typing import Any, Dict # noqa
from typing import Any # noqa
from app import create_app, db, scheduler, socketio # noqa
from app import models # noqa
app: Flask = create_app()
app = create_app()
@app.shell_context_processor
def make_shell_context() -> Dict[str, Any]:
def make_shell_context() -> dict[str, Any]:
''' Adds variables to the shell context. '''
return {
'db': db,
@ -34,9 +33,8 @@ def make_shell_context() -> Dict[str, Any]:
def main():
if app.config['NOPAQUE_IS_PRIMARY_INSTANCE']:
with app.app_context():
scheduler.start()
with app.app_context():
scheduler.start()
socketio.run(app, host='0.0.0.0')