예제 #1
0
def main():
    """Main function."""
    # Process server arguments
    parser = argparse.ArgumentParser(description="WebService server.")
    parser.add_argument( "-l", "--loglevel",
                   help="loglevel (DEBUG,WARN)", metavar="LOGLEVEL" )
    parser.add_argument( "-a", "--address",
                   help="IP address for binding (default: 127.0.0.1)",
                   metavar="ADDRESS", default="127.0.0.1" )
    parser.add_argument( "-p", "--port",
                   help="HTTP port to use (default: 8080)",
                   metavar="PORT", default=8080, type=int )
    arguments = parser.parse_args()

    # Set the log level
    if arguments.loglevel:
        loglevel = eval(arguments.loglevel, logging.__dict__)
        logger = logging.getLogger("")
        logger.setLevel(loglevel)

    # Print ZSI installed version
    c.log( 'Starting' )
    c.log( 'ZSI version: {0}'.format(zsiversion) )

    # Run the server (use address='' for binding to all interfaces)
    c.log( 'Waiting for requests ...' )
    ServiceContainer.AsServer( address=arguments.address, port=arguments.port,
                               services=[RobustCommunityAnalysisImpl(),] )
예제 #2
0
def main():
    op = OptionParser(usage="%prog [options]")
    op.add_option("-l", "--loglevel", help="loglevel (DEBUG, WARN)",
    metavar="LOGLEVEL")
    op.add_option("-p", "--port", help="HTTP port",
    metavar="PORT", default=8000, type="int")
    options, args = op.parse_args()
    # set the loglevel according to cmd line arg
    if options.loglevel:
        loglevel = eval(options.loglevel, logging.__dict__)
        logger = logging.getLogger("")
        logger.setLevel(loglevel)
    # Run the server with a given list services
    AsServer(port=options.port, services=[MyNumbexService(),])
예제 #3
0
def main():
    op = OptionParser(usage="%prog [options]")
    op.add_option("-l", "--loglevel", help="loglevel (DEBUG, WARN)",
        metavar="LOGLEVEL")
    op.add_option("-p", "--port", help="HTTP port",
        metavar="PORT", default=8000, type="int")
    op.add_option("-d", "--database", help="sqlite3 database filename",
        metavar="DBFILE", default="tmp.db")
    options, args = op.parse_args()
    # set the loglevel according to cmd line arg
    logging.basicConfig(level=logging.INFO)
    if options.loglevel:
        loglevel = eval(options.loglevel, zsilogging.__dict__)
        logger = zsilogging.getLogger("")
        logger.setLevel(zsiloglevel)
    # Run the server with a given list services
    AsServer(port=options.port, services=[MyNumbexService(options.database),])
예제 #4
0
파일: Utility.py 프로젝트: 0z-cloud/ZSI-Py3
 def __init__(self, module=__name__):
     self.logger = logging.getLogger('%s-%s(%s)' %(module, self.__class__, _get_idstr(self)))
예제 #5
0
        eval(cmd)
        
        s = "run"
        cmd = yacc.parse(s)
        eval(cmd)
        
        s = "print"
        cmd = yacc.parse(s)
        proof = eval(cmd)
        
        print "proof: ", proof
        
        svg_str = parseToSVG(proof)               
        return svg_str

# Setup log information
op = OptionParser(usage="%prog [options]")
op.add_option("-l", "--loglevel", help="loglevel (DEBUG, WARN)", metavar="LOGLEVEL")
op.add_option("-p", "--port", help="HTTP port", metavar="PORT", default=8080, type="int")
options, args = op.parse_args()

# set the loglevel according to cmd line arg
if options.loglevel:
    loglevel = eval(options.loglevel, logging.__dict__)
    logger = logging.getLogger("")
    logger.setLevel(loglevel)

# Run the server with a given list services
AsServer(port=options.port, services=[HemeraServiceContainer(),])