def main(thrift_idl): loader = base.load_thrift(thrift_idl) global namespace namespace = loader.namespace for obj in loader.modules.values(): transform_module(obj) updateController(out_path)
def main(thrift_idl): loader = base.load_thrift(thrift_idl) global namespace namespace = loader.namespace tpl = open('tmpl/go_package.tmpl', 'r').read() t = Template(tpl, searchList=[{"namespace": namespace}]) code = unicode(t) with open(out_path + 'gen_init.go', "w") as fp: fp.write(code) for module in loader.modules.values(): transform(module)
def main(thrift_idl): loader = base.load_thrift(thrift_idl) namespace = loader.namespace print ' _ "zfw/models/' + namespace + '"'