コード例 #1
0
def main(argv=None):
    if argv is None:
        import sys
        argv = sys.argv

    parser = optparse.OptionParser(
        description=__doc__,
        formatter=HelpFormatter(),
    )

    parser.add_option('--list',
                      dest='list_components',
                      action='store_true',
                      default=False,
                      help="List available components")

    options, args = parser.parse_args(argv[1:])

    if args:
        if args[0] == 'serve':
            from paste.httpserver import serve
            from wiseguy.app import configurator
            serve(configurator)

    if options.list_components:
        ep_parser = EPParser()
        for component_name, component in ep_parser.get_components():
            print component_name, component
コード例 #2
0
ファイル: command.py プロジェクト: PostPaste/wiseguy
def main(argv=None):
    if argv is None:
        import sys

        argv = sys.argv

    parser = optparse.OptionParser(description=__doc__, formatter=HelpFormatter())

    parser.add_option(
        "--list", dest="list_components", action="store_true", default=False, help="List available components"
    )

    options, args = parser.parse_args(argv[1:])

    if args:
        if args[0] == "serve":
            from paste.httpserver import serve
            from wiseguy.app import configurator

            serve(configurator)

    if options.list_components:
        ep_parser = EPParser()
        for component_name, component in ep_parser.get_components():
            print component_name, component
コード例 #3
0
ファイル: command.py プロジェクト: wsgicabal/wiseguy
def main(argv=None):
    if argv is None:
        import sys
        argv = sys.argv

    parser = optparse.OptionParser(description=__doc__,
                                   formatter=HelpFormatter(),
                                  )

    parser.add_option('--list', dest='list_components',
        action='store_true', default=False,
        help="List available components")

    options, args = parser.parse_args(argv[1:])

    if args:
        if args[0] == 'webconfig':
            from wiseguy.web.app import configurator
            serve(configurator)

        if args[0] == 'serve':
            filename = args[1]
            loader = AppLoader()
            loader.load_yaml(filename)
            app_factory = loader.get_app_factory('main')
            app = app_factory()
            serve(app)

    if options.list_components:
        ep_parser = EPParser()
        for component_name, component in ep_parser.get_components():
            print component_name, component
コード例 #4
0
def main(argv=None):
    if argv is None:
        import sys
        argv = sys.argv

    parser = optparse.OptionParser(
        description=__doc__,
        formatter=HelpFormatter(),
    )

    parser.add_option('--list',
                      dest='list_components',
                      action='store_true',
                      default=False,
                      help="List available components")

    options, args = parser.parse_args(argv[1:])

    if args:
        if args[0] == 'webconfig':
            from wiseguy.web.app import configurator
            serve(configurator)

        if args[0] == 'serve':
            filename = args[1]
            loader = AppLoader()
            loader.load_yaml(filename)
            app_factory = loader.get_app_factory('main')
            app = app_factory()
            serve(app)

    if options.list_components:
        ep_parser = EPParser()
        for component_name, component in ep_parser.get_components():
            print component_name, component