mirror of
https://github.com/ProjectSynthoria/SynthoriaArchive.git
synced 2025-03-12 15:26:56 +02:00

* Replace all `from nyaa import app` imports with `app = flask.current_app` (or `from flask import current_app as app` where possible) * Add a separate config object for top-level and class statements as `nyaa.extensions.config` Required because those codes don't have app context at the time of evaluation/execution. * Remove `routes.py` file and register all blueprints in `nyaa/__init__.py` * Refactor `nyaa/__init__.py` into an app factory * Update tools * Update tests (temporary, will be replaced)
18 lines
467 B
Python
18 lines
467 B
Python
from nyaa.views import ( # isort:skip
|
|
account,
|
|
admin,
|
|
main,
|
|
site,
|
|
torrents,
|
|
users,
|
|
)
|
|
|
|
|
|
def register_views(flask_app):
|
|
""" Register the blueprints using the flask_app object """
|
|
flask_app.register_blueprint(account.bp)
|
|
flask_app.register_blueprint(admin.bp)
|
|
flask_app.register_blueprint(main.bp)
|
|
flask_app.register_blueprint(site.bp)
|
|
flask_app.register_blueprint(torrents.bp)
|
|
flask_app.register_blueprint(users.bp)
|