# Path: makesite/modules/flask/base/ext.py
# def config_extensions(app):
# def config_babel(app):
#     def get_locale():


from flaskext.script import Command, Option, prompt_pass
from ..ext import manager
        from .models import User
        from base.ext import db
        from .models import Role
        from base.ext import db
        from .models import User, Role
        from base.ext import db
        from .models import User, Role
        from base.ext import db



class Create_user(Command):
    "  Create a user. "

    option_list = (
        Option('username'),
        Option('email'),
        Option('-a', '--active', dest='active', action='store_true'),
        Option('-p', '--password', dest='password', default=''),
    )

    @staticmethod
    def run(username=None, email=None, active=False, password=''):

        password = password or prompt_pass("Set password")
        user = User(username=username,
                    email=email,
                    pw_hash=password,
                    active=active)

        db.session.add(user)
        db.session.commit()

        print 'User created successfully.'

# Path: makesite/modules/flask/base/ext.py
# def config_extensions(app):
# def config_babel(app):
#     def get_locale():


# Path: makesite/modules/flask/base/auth/script.py
from flaskext.script import Command, Option, prompt_pass
from ..ext import manager
        from .models import User
        from base.ext import db
        from .models import Role
        from base.ext import db
        from .models import User, Role
        from base.ext import db
        from .models import User, Role
        from base.ext import db




class Create_user(Command):
    "  Create a user. "

    option_list = (
        Option('username'),
        Option('email'),
        Option('-a', '--active', dest='active', action='store_true'),
        Option('-p', '--password', dest='password', default=''),
    )

    @staticmethod
    def run(username=None, email=None, active=False, password=''):

        password = password or prompt_pass("Set password")
        user = User(username=username,
                    email=email,
                    pw_hash=password,
                    active=active)

        db.session.add(user)
        db.session.commit()

        print 'User created successfully.'

manager.add_command('create_user', Create_user())