# Path: atomicpress/admin.py
# def create_admin():
#     app = current_app._get_current_object()
#     admin = Admin(app, "AtomicPress", index_view=HomeView(name='Home'))
# 
#     admin.add_view(ModelView(models.Blog, db.session, category="Blog"))
#     admin.add_view(ModelView(models.Author, db.session, category="Blog"))
# 
#     admin.add_view(PostView(models.Post, db.session, category="Post"))
#     admin.add_view(ModelView(models.Tag, db.session, category="Post"))
#     admin.add_view(ModelView(models.Category, db.session, category="Post"))
# 
#     admin.add_view(FileAdmin(app.config["UPLOADS_PATH"],
#                              app.config["UPLOADS_URL"],
#                              name='Upload files'))
# 
# Path: atomicpress/app.py
# DEFAULT_EXTENSIONS = (
#     "atomicpress.ext.importer",
#     "atomicpress.ext.exporter",
#     "atomicpress.ext.ftp",
#     "atomicpress.ext.s3",
#     "atomicpress.ext.prefill",
# )
# DEFAULT_MARKDOWN_EXTENSIONS = [
#     "markdown.extensions.tables",
#     "markdown.extensions.nl2br",
#     "markdown.extensions.fenced_code",
#     "markdown.extensions.headerid"
# ]
# def setup(init_run=False):
# def activate_extensions():
# def activate_theme(theme):
# def run():


from subprocess import call
from flask_debugtoolbar import DebugToolbarExtension
from flask_script import prompt_bool
from atomicpress.admin import create_admin
from atomicpress.app import manager, db, app
# -*- coding: utf-8 -*-





logger = app.logger


@manager.command
def create_db():
    db.create_all()
    logger.info("Database was created")


@manager.command
def drop_db(remove=False, force=False):
    if not force:
        if not prompt_bool("Are you sure?"):
            return

    db.drop_all()
    logger.info("Database was dropped")

    if remove:
        call(["rm", app.config["DB_PATH"]])
        logger.info("Database file was removed")



# Path: atomicpress/admin.py
# def create_admin():
#     app = current_app._get_current_object()
#     admin = Admin(app, "AtomicPress", index_view=HomeView(name='Home'))
# 
#     admin.add_view(ModelView(models.Blog, db.session, category="Blog"))
#     admin.add_view(ModelView(models.Author, db.session, category="Blog"))
# 
#     admin.add_view(PostView(models.Post, db.session, category="Post"))
#     admin.add_view(ModelView(models.Tag, db.session, category="Post"))
#     admin.add_view(ModelView(models.Category, db.session, category="Post"))
# 
#     admin.add_view(FileAdmin(app.config["UPLOADS_PATH"],
#                              app.config["UPLOADS_URL"],
#                              name='Upload files'))
# 
# Path: atomicpress/app.py
# DEFAULT_EXTENSIONS = (
#     "atomicpress.ext.importer",
#     "atomicpress.ext.exporter",
#     "atomicpress.ext.ftp",
#     "atomicpress.ext.s3",
#     "atomicpress.ext.prefill",
# )
# DEFAULT_MARKDOWN_EXTENSIONS = [
#     "markdown.extensions.tables",
#     "markdown.extensions.nl2br",
#     "markdown.extensions.fenced_code",
#     "markdown.extensions.headerid"
# ]
# def setup(init_run=False):
# def activate_extensions():
# def activate_theme(theme):
# def run():


# Path: atomicpress/commands.py
from subprocess import call
from flask_debugtoolbar import DebugToolbarExtension
from flask_script import prompt_bool
from atomicpress.admin import create_admin
from atomicpress.app import manager, db, app

# -*- coding: utf-8 -*-





logger = app.logger


@manager.command
def create_db():
    db.create_all()
    logger.info("Database was created")


@manager.command
def drop_db(remove=False, force=False):
    if not force:
        if not prompt_bool("Are you sure?"):
            return

    db.drop_all()
    logger.info("Database was dropped")

    if remove:
        call(["rm", app.config["DB_PATH"]])
        logger.info("Database file was removed")



@manager.command