diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2020-04-06 23:05:31 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2020-04-06 23:05:31 +0200 |
commit | 49b199c610bb32d0581d771d856b3e3332707f17 (patch) | |
tree | 9e9c633d5d77bf3ae56395d8cd732ce20dba6b43 /runserver.py | |
parent | Added a link to the documentation in the about page. (diff) | |
download | newspipe-49b199c610bb32d0581d771d856b3e3332707f17.tar.gz newspipe-49b199c610bb32d0581d771d856b3e3332707f17.tar.bz2 newspipe-49b199c610bb32d0581d771d856b3e3332707f17.zip |
Migrate form Flask-Script to the built-in integration of the click command line interface of Flask.
Diffstat (limited to 'runserver.py')
-rwxr-xr-x | runserver.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/runserver.py b/runserver.py index b3f02823..2fe093f0 100755 --- a/runserver.py +++ b/runserver.py @@ -22,6 +22,15 @@ from flask import g from flask_restful import Api from newspipe.bootstrap import application +from newspipe import commands + + +def register_commands(app): + """Register Click commands.""" + app.cli.add_command(commands.db_empty) + app.cli.add_command(commands.db_create) + app.cli.add_command(commands.fetch_asyncio) + app.cli.add_command(commands.create_admin) with application.app_context(): @@ -42,6 +51,8 @@ with application.app_context(): application.register_blueprint(views.bookmarks_bp) application.register_blueprint(views.bookmark_bp) + register_commands(application) + if __name__ == "__main__": application.run( |