Example #1
0
    if not conf.environment:
        conf.environment = 'production'

    if not options.handler:
        options.handler = os.getenv('PIPE_HANDLER')

    if options.handler:
        options.handlerconf = 'conf/handlers/' + options.handler + '.conf'

except Exception as E:
    log.critical("Error reading " + options.pipeconf + ": %s", E)
    exit(1)

try:
    conf.handler = options.handler
    if options.handlerconf:
        conf.read(options.handlerconf)
        if not conf.handler:
            # deprecated loading of handler alias
            conf.handler = conf.get('settings', 'handler')

    # server's base settings
    if options.port:
        conf.port = int(options.port)
    else:
        conf.port = int(os.getenv('PIPE_PORT', 0))

    if not conf.port and options.handlerconf:
        conf.port = conf.getint("general", "port")