def error(message, level="error", exit_code=1, **kwargs):
    kwargs["fg"] = kwargs.get("fg", "red")
    click.secho(u"error: {}".format(message), **kwargs)
    sys.exit(exit_code)
def allowed_file(filename):
    return '.' in filename and \
           filename.rsplit('.', 1)[1] in app.config.get('ALLOWED_EXTENSIONS')