Skip to content
Snippets Groups Projects
Commit 9e8f6af3 authored by Miguel Angel Valero Navarro's avatar Miguel Angel Valero Navarro
Browse files

cmd

parent e02a35ce
No related branches found
No related tags found
1 merge request!1Developer
......@@ -5,8 +5,8 @@ import os
from flask import Flask
from app.api_loader import load_api_public_blueprints
from app.cli.cli import init_cli
from app.cli.v1.load_cli import load_cli_commands
from app.cmd.cli import init_cli
from app.cmd.v1.load_cli import load_cli_commands, load_cli_namespaces
from app.extensions import (db, migrate, cache, jwt, celery, csrf)
from werkzeug.middleware.proxy_fix import ProxyFix
......@@ -86,7 +86,7 @@ def init_redis_cache(app):
print("ok")
def load_cli_v1(application):
all_blueprints = load_cli_blueprints()
all_blueprints = load_cli_namespaces()
for bp in all_blueprints:
application.register_blueprint(bp)
......
from flask import Blueprint
from app.cli.v1.namespaces.opencast import opencastbp as oc_ns
#from app.cli.v1.namespaces.commands import commandsbp as cm_ns
def load_cli_commands():
return oc_ns
#def load_cli_namespaces():
# return oc_ns, cm_ns
\ No newline at end of file
import click
from flask import Blueprint
commandbp = Blueprint('commands', __name__)
@commandbp.cli.command('create')
@click.argument('name')
def create(name):
""" Creates a user """
print("Create user: {}".format(name))
\ No newline at end of file
import click
from flask import Blueprint
opencastbp = Blueprint('opencast', __name__)
@opencastbp.cli.command('ckeck')
@click.argument('event_id')
def ckeck(event_id):
""" Check a event """
print("Check event: {}".format(event_id))
\ No newline at end of file
from app.cli.v1.load_cli import load_cli_namespaces
from app.cmd.v1.load_cli import load_cli_namespaces
def load_cli_blueprints():
......
File moved
File moved
File moved
from flask import Blueprint
from app.cmd.v1.namespaces.opencast import load_opencast_blueprint as oc_bp
from app.cmd.v1.namespaces.commands import load_command_blueprint as cm_bp
def load_cli_commands():
commandsbp = Blueprint('test', __name__)
return cm_bp(commandsbp)
def load_cli_namespaces():
return oc_bp, cm_bp
\ No newline at end of file
import click
from flask import Blueprint
def load_command_blueprint(commandsbp):
@commandsbp.cli.command('create')
@click.argument('name')
def create(name):
""" Creates a user """
print("Create user: {}".format(name))
return commandsbp
\ No newline at end of file
import click
from flask import Blueprint
#opencastbp = Blueprint('opencast', __name__)
def load_opencast_blueprint(opencastbp):
@opencastbp.cli.command('ckeck')
@click.argument('event_id')
def ckeck(event_id):
""" Check a event """
print("Check event: {}".format(event_id))
return opencastbp
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment