From 49b199c610bb32d0581d771d856b3e3332707f17 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Mon, 6 Apr 2020 23:05:31 +0200 Subject: Migrate form Flask-Script to the built-in integration of the click command line interface of Flask. --- runserver.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'runserver.py') 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( -- cgit