# Path: tokenserver/util.py
# def find_config_file(*paths):
#     ini_files = []
#     ini_files.append(os.environ.get('TOKEN_INI'))
#     ini_files.extend(paths)
#     ini_files.extend((
#         '/data/tokenserver/token-prod.ini',
#         '/etc/mozilla-services/token/production.ini',
#     ))
#     for ini_file in ini_files:
#         if ini_file is not None:
#             ini_file = os.path.abspath(ini_file)
#             if os.path.exists(ini_file):
#                 return ini_file
#     raise RuntimeError("Could not locate tokenserver ini file")


import os
from logging.config import fileConfig
from ConfigParser import NoSectionError
from tokenserver.util import find_config_file
from paste.deploy import loadapp
# flake8: noqa
# -*- coding: utf8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
"""
Runs the Application. This script can be called by any wsgi runner that looks
for an 'application' variable
"""


# setting up the egg cache to a place where apache can write
os.environ['PYTHON_EGG_CACHE'] = '/tmp/python-eggs'

# setting up logging

# Path: tokenserver/util.py
# def find_config_file(*paths):
#     ini_files = []
#     ini_files.append(os.environ.get('TOKEN_INI'))
#     ini_files.extend(paths)
#     ini_files.extend((
#         '/data/tokenserver/token-prod.ini',
#         '/etc/mozilla-services/token/production.ini',
#     ))
#     for ini_file in ini_files:
#         if ini_file is not None:
#             ini_file = os.path.abspath(ini_file)
#             if os.path.exists(ini_file):
#                 return ini_file
#     raise RuntimeError("Could not locate tokenserver ini file")


# Path: tokenserver/run.py
import os
from logging.config import fileConfig
from ConfigParser import NoSectionError
from tokenserver.util import find_config_file
from paste.deploy import loadapp

# flake8: noqa
# -*- coding: utf8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
"""
Runs the Application. This script can be called by any wsgi runner that looks
for an 'application' variable
"""


# setting up the egg cache to a place where apache can write
os.environ['PYTHON_EGG_CACHE'] = '/tmp/python-eggs'

# setting up logging

ini_file = find_config_file()