コード例 #1
0
ファイル: python.py プロジェクト: angel1991521/HyperDex
def generate_client_python():
    pyxfile = os.path.join(BASE, 'bindings/python/hyperdex/client.pyx')
    current = open(pyxfile, 'r').read()
    fout = open(pyxfile, 'w')
    prototypes = indent('\n'.join(
        [generate_prototype(c, 'client') for c in bindings.Client]))
    current = bindings.substitute_generated('Prototypes',
                                            current,
                                            prototypes,
                                            prefix='#')
    fps = '\n'.join(
        generate_function_pointer_typedefs(bindings.Client, 'client'))
    current = bindings.substitute_generated('Function Pointers',
                                            current,
                                            fps,
                                            prefix='#')
    methods = '\n'.join(generate_workers(bindings.Client))
    methods += '\n'
    methods += '\n'.join(
        [generate_method(c, 'client') for c in bindings.Client])
    current = bindings.substitute_generated('Methods',
                                            current,
                                            methods,
                                            prefix='#')
    fout.write(current)
コード例 #2
0
ファイル: python.py プロジェクト: angel1991521/HyperDex
def generate_client_python():
    pyxfile = os.path.join(BASE, 'bindings/python/hyperdex/client.pyx')
    current = open(pyxfile, 'r').read()
    fout = open(pyxfile, 'w')
    prototypes = indent('\n'.join([generate_prototype(c, 'client') for c in bindings.Client]))
    current = bindings.substitute_generated('Prototypes', current, prototypes, prefix='#')
    fps = '\n'.join(generate_function_pointer_typedefs(bindings.Client, 'client'))
    current = bindings.substitute_generated('Function Pointers', current, fps, prefix='#')
    methods  = '\n'.join(generate_workers(bindings.Client))
    methods += '\n'
    methods += '\n'.join([generate_method(c, 'client') for c in bindings.Client])
    current = bindings.substitute_generated('Methods', current, methods, prefix='#')
    fout.write(current)
コード例 #3
0
ファイル: go.py プロジェクト: Applied-Duality/HyperDex
def generate_client_code():
    code = ''
    code += '\n'.join(generate_workers(bindings.Client))
    code += '\n'
    code += '\n'.join([generate_method(c, 'Client') for c in bindings.Client])
    code += '\n'
    goclient = os.path.join(BASE, 'bindings/go/client/client.go')
    current = open(goclient, 'r').read()
    fout = open(goclient, 'w')
    fout.write(bindings.substitute_generated('Code', current, code))
コード例 #4
0
ファイル: go.py プロジェクト: weaver-viii/HyperDex
def generate_client_code():
    code = ''
    code += '\n'.join(generate_workers(bindings.Client))
    code += '\n'
    code += '\n'.join([generate_method(c, 'Client') for c in bindings.Client])
    code += '\n'
    goclient = os.path.join(BASE, 'bindings/go/client/client.go')
    current = open(goclient, 'r').read()
    fout = open(goclient, 'w')
    fout.write(bindings.substitute_generated('Code', current, code))