Commit 82f4dd38 authored by David Trattnig's avatar David Trattnig
Browse files

Remove more Flask dependencies.

parent 54e79ece
......@@ -27,25 +27,33 @@ import signal
import logging
import unittest
from pathlib import Path
from flask import request, render_template, Flask, Response
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.ext.declarative import declarative_base
from libraries.base.logger import AuraLogger
from libraries.base.config import AuraConfig
# from modules.monitoring.diskspace_watcher import DiskSpaceWatcher
config = AuraConfig()
def configure_flask():
app.config["SQLALCHEMY_DATABASE_URI"] = config.get_database_uri()
app.config['BABEL_DEFAULT_LOCALE'] = 'de'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
config = AuraConfig()
# FIXME Instatiate SQLAlchemy without the need for Flask
app = Flask(__name__)
configure_flask()
DB = SQLAlchemy(app)
Base = declarative_base()
class Aura:
"""
Aura Class
The core of Aura Engine.
"""
logger = None
config = None
server = None
......@@ -53,13 +61,20 @@ class Aura:
controller = None
scheduler = None
# ------------------------------------------------------------------------------------------ #
def __init__(self):
"""
Initializes the Engine Core.
"""
self.config = config
AuraLogger(self.config)
self.logger = logging.getLogger("AuraEngine")
def startup(self):
"""
Starts the Engine Core.
"""
from modules.scheduling.scheduler import AuraScheduler
from modules.communication.liquidsoap.communicator import LiquidSoapCommunicator
from modules.communication.redis.adapter import ServerRedisAdapter
......@@ -90,10 +105,12 @@ class Aura:
# # ## ## ## ## ## # #
# # ENTRY FUNCTION # #
# # ## ## ## ## ## # #
def main():
#
# START THE ENGINE
#
if __name__ == "__main__":
aura = Aura()
if len(sys.argv) >= 2:
......@@ -103,12 +120,3 @@ def main():
aura.config.set("recreate_db", True)
aura.startup()
# # ## ## ## ## ## ## # #
# # End ENTRY FUNCTION # #
# # ## ## ## ## ## ## # #
if __name__ == "__main__":
main()
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