예제 #1
0
파일: fiapc.py 프로젝트: EmOne/fiapy
#
# main
#
opt = parse_args()
if opt.url.startswith('https://'):
    sec_lv = 1
sec_lv = opt.sec_lv
url, host = set_default_port(opt.url)

#soapGetAddressLocation(opt.wsdl)

#
# parse the configuration file if specified.
#
cf = fiapConfig.fiapConfig(opt.cfile, security_level=sec_lv, debug=opt.debug)

if opt.debug:
    print 'DEBUG: reading request file.'
if opt.bfile != None:
    fp = open(opt.bfile)
else:
    fp = sys.stdin
src = fp.read()
if src == None:
    print 'ERROR: src document is nothing'
    exit(1)

fiap = fiapProto.fiapProto(cf, debug=opt.debug)

#
예제 #2
0
파일: fiapy.py 프로젝트: xiangdn/fiapy
    p.add_argument('-p', action='store', dest='port', default=None,
        help='specify the port number for this server.')
    p.add_argument('-s', action='store', dest='sec_lv', default=0,
        help='specify to use TLS connection. 0, 1, or 2')
    p.add_argument('-c', action='store', dest='cfile', default=False,
        help='specify the file name of the configuration.')
    p.add_argument('-z', action='store', dest='tzname', default='Asia/Tokyo',
        help='specify the name of default timezone. ')
    p.add_argument('-d', action='store', dest='debug', default=0,
        help='specify the debug level. 0, 1, or 2')
    opt = p.parse_args()
    return opt

#
# main
#
opt = parse_args()
cf = fiapConfig.fiapConfig(opt.cfile, security_level=opt.sec_lv,
                           tzname=opt.tzname, debug=opt.debug)
#
# set the runner and default port if needed.
#
if opt.sec_lv:
    if opt.port == None:
        opt.port = 18883
else:
    if opt.port == None:
        opt.port = 18880

run(port=opt.port, config=cf)
예제 #3
0
파일: fiapc.py 프로젝트: tanupoo/fiapy
#
# main
#
opt = parse_args()
if opt.url.startswith('https://'):
    sec_lv = 1
sec_lv = opt.sec_lv
url, host = set_default_port(opt.url)

#soapGetAddressLocation(opt.wsdl)

#
# parse the configuration file if specified.
#
cf = fiapConfig.fiapConfig(opt.cfile, security_level=sec_lv, debug=opt.debug)

if opt.debug:
    print 'DEBUG: reading request file.'
if opt.bfile != None:
    fp = open(opt.bfile)
else:
    fp = sys.stdin
src = fp.read()
if src == None:
    print 'ERROR: src document is nothing'
    exit(1)

fiap = fiapProto.fiapProto(cf, debug=opt.debug)

#