# Path: extrapypi/app.py
# def create_app(testing=False, config=None):
#     """Main application factory
#     """
# 
#     # the following line ensure that we search templates
#     # based on the app file, not working_directory
#     tmpl_path = os.path.join(
#         os.path.dirname(os.path.abspath(__file__)),
#         'templates'
#     )
#     static_path = os.path.join(
#         os.path.dirname(os.path.abspath(__file__)),
#         'static'
#     )
# 
#     app = Flask(
#         'extra-pypi',
#         template_folder=tmpl_path,
#         static_folder=static_path
#     )
#     configure_app(app, testing, config)
#     configure_logging(app)
#     configure_extensions(app)
#     register_blueprints(app)
#     register_filters(app)
# 
#     return app


import os
import click
from flask.cli import FlaskGroup
from extrapypi.app import create_app
from flask_migrate import MigrateCommand
from passlib.apps import custom_app_context
    from flask_migrate import stamp
    from extrapypi.extensions import db, migrate
    from extrapypi import models
    from pkg_resources import resource_string
    from extrapypi.extensions import db
    from extrapypi import models
    from extrapypi import models
    from flask import current_app as app
    from extrapypi.commons.packages import get_store, create_release_from_source



def create_pypi(info):
    return create_app(
        config=os.environ.get('EXTRAPYPI_CONFIG', None)
    )



# Path: extrapypi/app.py
# def create_app(testing=False, config=None):
#     """Main application factory
#     """
# 
#     # the following line ensure that we search templates
#     # based on the app file, not working_directory
#     tmpl_path = os.path.join(
#         os.path.dirname(os.path.abspath(__file__)),
#         'templates'
#     )
#     static_path = os.path.join(
#         os.path.dirname(os.path.abspath(__file__)),
#         'static'
#     )
# 
#     app = Flask(
#         'extra-pypi',
#         template_folder=tmpl_path,
#         static_folder=static_path
#     )
#     configure_app(app, testing, config)
#     configure_logging(app)
#     configure_extensions(app)
#     register_blueprints(app)
#     register_filters(app)
# 
#     return app


# Path: extrapypi/manage.py
import os
import click
from flask.cli import FlaskGroup
from extrapypi.app import create_app
from flask_migrate import MigrateCommand
from passlib.apps import custom_app_context
    from flask_migrate import stamp
    from extrapypi.extensions import db, migrate
    from extrapypi import models
    from pkg_resources import resource_string
    from extrapypi.extensions import db
    from extrapypi import models
    from extrapypi import models
    from flask import current_app as app
    from extrapypi.commons.packages import get_store, create_release_from_source




def create_pypi(info):
    return create_app(
        config=os.environ.get('EXTRAPYPI_CONFIG', None)
    )



@click.group(cls=FlaskGroup, create_app=create_pypi)