#! /usr/bin/env python
# -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license. 
# See the NOTICE for more information.


import os
import sys

sys.path.insert(0, os.getcwd())

from gunicorn.main import main
from gunicorn.util import import_app

__usage__ = "%prog [OPTIONS] APP_MODULE"

def get_app(parser, opts, args):
    if len(args) != 1:
        parser.error("No application module specified.")

    try:
        return import_app(args[0])
    except:
        parser.error("Failed to import application module.")

main(__usage__, get_app)

