Exemple #1
0
#

import sys, service, json

from bottle import run

#Add defaut values
docchost = "localhost"
doccbottleport = 8080

if len(sys.argv) > 1:
    conf_file_path = sys.argv[1]
    conf_file = open(conf_file_path).read()

    confJson = {}
    confJson = json.loads(conf_file)

    docchost = confJson['docc.host']
    doccbottleport = confJson['docc.bottle.port']

    print 'Starting bottle service at \nhost:%s \nport:%s' % (docchost,
                                                              doccbottleport)

    # Initialize service objects
    service.setup()
    run(host=docchost, port=doccbottleport)

else:
    print 'Config file not specified:'
    print "usage:", sys.argv[0], "[conf file]"
Exemple #2
0
#
# start the server
#

import sys

from bottle import run
from service import setup 

if len(sys.argv) > 2:
    base = sys.argv[1]
    conf_fn = sys.argv[2]
    setup(base,conf_fn)
    
    run(host='localhost', port=8080)
else:
    print "usage:", sys.argv[0],"[base_dir] [conf file]"

Exemple #3
0
#

import sys, service, json

from bottle import run

#Add defaut values
docchost = "localhost"
doccbottleport = 8080

if len(sys.argv) > 1:
    conf_file_path = sys.argv[1]
    conf_file = open(conf_file_path).read()
     
    confJson = {}
    confJson = json.loads(conf_file)
    
    docchost = confJson['docc.host']
    doccbottleport = confJson['docc.bottle.port']
    
    print 'Starting bottle service at \nhost:%s \nport:%s' % (docchost, doccbottleport) 
    
    # Initialize service objects
    service.setup()
    run(host=docchost, port=doccbottleport)
    
else:
    print 'Config file not specified:'
    print "usage:", sys.argv[0],"[conf file]"

Exemple #4
0
from configparser import ConfigParser

from service import setup, app

if __name__ == '__main__':
    config = ConfigParser()
    config.read('settings.ini')
    host, port = setup(config)
    app.run(host=host, port=port)
    app.run()