예제 #1
0
@flaskbb.command()
@click.option("--welcome",
              "-w",
              default=True,
              is_flag=True,
              help="Disable the welcome forum.")
@click.option("--force",
              "-f",
              default=False,
              is_flag=True,
              help="Doesn't ask for confirmation.")
@click.option("--username", "-u", help="The username of the user.")
@click.option("--email",
              "-e",
              type=EmailType(),
              help="The email address of the user.")
@click.option("--password", "-p", help="The password of the user.")
@with_appcontext
def install(welcome, force, username, email, password):
    """Installs flaskbb. If no arguments are used, an interactive setup
    will be run.
    """
    click.secho("[+] Installing FlaskBB...", fg="cyan")
    if database_exists(db.engine.url):
        if force or click.confirm(
                click.style(
                    "Existing database found. Do you want to delete the old one and "
                    "create a new one?",
                    fg="magenta")):
            db.drop_all()
예제 #2
0
              help="Specify the config to use in dotted module notation "
                   "e.g. flaskbb.configs.default.DefaultConfig")
@click.option("--version", expose_value=False, callback=get_version,
              is_flag=True, is_eager=True, help="Show the FlaskBB version.")
def flaskbb():
    """This is the commandline interface for flaskbb."""
    pass


@flaskbb.command()
@click.option("--welcome", "-w", default=True, is_flag=True,
              help="Disable the welcome forum.")
@click.option("--force", "-f", default=False, is_flag=True,
              help="Doesn't ask for confirmation.")
@click.option("--username", "-u", help="The username of the user.")
@click.option("--email", "-e", type=EmailType(),
              help="The email address of the user.")
@click.option("--password", "-p", help="The password of the user.")
@click.option("--group", "-g", help="The group of the user.",
              type=click.Choice(["admin", "super_mod", "mod", "member"]))
def install(welcome, force, username, email, password, group):
    """Installs flaskbb. If no arguments are used, an interactive setup
    will be run.
    """
    click.secho("[+] Installing FlaskBB...", fg="cyan")
    if database_exists(db.engine.url):
        if force or click.confirm(click.style(
            "Existing database found. Do you want to delete the old one and "
            "create a new one?", fg="magenta")
        ):
            drop_database(db.engine.url)