# Path: api/config.py
# class Config(dict):
#     """The simplest config object ever."""
# 
#     def from_object(self, obj):
#         for key in dir(obj):
#             if key.isupper():
#                 self[key] = getattr(obj, key)
# 
#     def __getattr__(self, name):
#         try:
#             return self[name]
#         except KeyError:
#             raise AttributeError('"{}" not found'.format(name))
# 
#     def __setattr__(self, name, value):
#         self[name] = value
# 
# Path: api/github/plugin.py
# CONFIG_KEY = 'GITHUB'
# APP_CLIENT_KEY = 'github_client'
# def setup(app):


from aiohttp import web
from aiohttp_utils import negotiation, path_norm
from .config import Config
from . import settings
from . import routes
from .github import plugin as github_plugin
from . import cache


##### App factory #####

def create_app(settings_obj=None) -> web.Application:
    """App factory. Sets up routes and all plugins.

    :param settings_obj: Object containing optional configuration overrides. May be
        a Python module or class with uppercased variables.
    """

# Path: api/config.py
# class Config(dict):
#     """The simplest config object ever."""
# 
#     def from_object(self, obj):
#         for key in dir(obj):
#             if key.isupper():
#                 self[key] = getattr(obj, key)
# 
#     def __getattr__(self, name):
#         try:
#             return self[name]
#         except KeyError:
#             raise AttributeError('"{}" not found'.format(name))
# 
#     def __setattr__(self, name, value):
#         self[name] = value
# 
# Path: api/github/plugin.py
# CONFIG_KEY = 'GITHUB'
# APP_CLIENT_KEY = 'github_client'
# def setup(app):


# Path: api/app.py
from aiohttp import web
from aiohttp_utils import negotiation, path_norm
from .config import Config
from . import settings
from . import routes
from .github import plugin as github_plugin
from . import cache



##### App factory #####

def create_app(settings_obj=None) -> web.Application:
    """App factory. Sets up routes and all plugins.

    :param settings_obj: Object containing optional configuration overrides. May be
        a Python module or class with uppercased variables.
    """

    config = Config()