MCPcopy
hub / github.com/pyload/pyload / thrift

Function thrift

pavement.py:160–184  ·  view source on GitHub ↗

Generate Thrift stubs

(options)

Source from the content-addressed store, hash-verified

158 ('gen=', 'g', "Extra --gen option")
159])
160def thrift(options):
161 """ Generate Thrift stubs """
162
163 print "add import for TApplicationException manually as long it is not fixed"
164
165 outdir = path("module") / "remote" / "thriftbackend"
166 (outdir / "gen-py").rmtree()
167
168 cmd = [options.thrift.path, "-strict", "-o", outdir, "--gen", "py:slots,dynamic", outdir / "pyload.thrift"]
169
170 if options.gen:
171 cmd.insert(len(cmd) - 1, "--gen")
172 cmd.insert(len(cmd) - 1, options.gen)
173
174 print "running", cmd
175
176 p = Popen(cmd)
177 p.communicate()
178
179 (outdir / "thriftgen").rmtree()
180 (outdir / "gen-py").move(outdir / "thriftgen")
181
182 #create light ttypes
183 from module.remote.socketbackend.create_ttypes import main
184 main()
185
186@task
187def compile_js():

Callers

nothing calls this directly

Calls 5

mainFunction · 0.90
pathFunction · 0.85
PopenClass · 0.85
communicateMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected