Exemple #1
0
def startWebserver(_cntlr, options):
    global imagesDir, cntlr, optionsNames
    cntlr = _cntlr
    imagesDir = cntlr.imagesDir
    optionsNames = [option for option in dir(options) if not option.startswith('_')]
    host, sep, port = options.webserver.partition(":")
    run(host=host, port=port)
Exemple #2
0
def startWebserver(_cntlr, options):
    """Called once from main program in CmtlrCmdLine to initiate web server on specified local port.
       
    :param options: OptionParser options from parse_args of main argv arguments (the argument *webserver* provides hostname and port), port being used to startup the webserver on localhost.
    :type options: optparse.Values
    """
    global imagesDir, cntlr, optionsNames
    cntlr = _cntlr
    imagesDir = cntlr.imagesDir
    optionsNames = [option for option in dir(options) if not option.startswith('_')]
    host, sep, portServer = options.webserver.partition(":")
    port, sep, server = portServer.partition(":")
    if server:
        run(host=host, port=port or 80, server=server)
    else:
        run(host=host, port=port or 80)
Exemple #3
0
def startWebserver(_cntlr, options):
    """Called once from main program in CmtlrCmdLine to initiate web server on specified local port.
       
    :param options: OptionParser options from parse_args of main argv arguments (the argument *webserver* provides hostname and port), port being used to startup the webserver on localhost.
    :type options: optparse.Values
    """
    global imagesDir, cntlr, optionsNames
    cntlr = _cntlr
    imagesDir = cntlr.imagesDir
    optionsNames = [
        option for option in dir(options) if not option.startswith('_')
    ]
    host, sep, portServer = options.webserver.partition(":")
    port, sep, server = portServer.partition(":")
    if server:
        run(host=host, port=port or 80, server=server)
    else:
        run(host=host, port=port or 80)
Exemple #4
0
def startWebserver(_cntlr, options):
    """Called once from main program in CmtlrCmdLine to initiate web server on specified local port.
       
    :param options: OptionParser options from parse_args of main argv arguments (the argument *webserver* provides hostname and port), port being used to startup the webserver on localhost.
    :type options: optparse.Values
    """
    global imagesDir, cntlr, optionsPrototype
    cntlr = _cntlr
    imagesDir = cntlr.imagesDir
    optionValuesTypes = _STR_NUM_TYPES + (type(None),)
    optionsPrototype = dict((option,value if isinstance(value,_STR_NUM_TYPES) else None)
                            for option in dir(options)
                            for value in (getattr(options, option),)
                            if isinstance(value,optionValuesTypes) and not option.startswith('_'))
    host, sep, portServer = options.webserver.partition(":")
    port, sep, server = portServer.partition(":")
    if server:
        run(host=host, port=port or 80, server=server)
    else:
        run(host=host, port=port or 80)