Nicholas Jones 747480367b Enable pep8 checks
Enables excluded pep8 checks and fixes existing the related errors

Change-Id: Ib3a909d79b9726567c1cebf5881d1878d91ee052
2017-08-01 09:49:28 -05:00

33 lines
864 B
Python

from pecan import make_app
from fms_rest.data import wsme
from fms_rest.logger import get_logger
from pecan.commands import CommandRunner
from fms_rest.utils import authentication
from orm_common.policy import policy
import os
logger = get_logger(__name__)
def setup_app(config):
wsme.init_model()
token_conf = authentication.get_token_conf(config)
policy.init(config.authentication.policy_file, token_conf)
app_conf = dict(config.app)
app = make_app(
app_conf.pop('root'),
logging=getattr(config, 'logging', {}),
**app_conf
)
logger.info('Starting FMS...')
return app
def main():
dir_name = os.path.dirname(__file__)
drive, path_and_file = os.path.splitdrive(dir_name)
path, filename = os.path.split(path_and_file)
runner = CommandRunner()
runner.run(['serve', path+'/config.py'])