Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aura-engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Kruse
aura-engine
Commits
82f4dd38
Commit
82f4dd38
authored
5 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Remove more Flask dependencies.
parent
54e79ece
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aura.py
+25
-17
25 additions, 17 deletions
aura.py
with
25 additions
and
17 deletions
aura.py
+
25
−
17
View file @
82f4dd38
...
...
@@ -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
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment