aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/cffi/gen/main.py
diff options
context:
space:
mode:
authormonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
committermonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
commit06e5c21a835c0e923506c4ff27929f34e00761c2 (patch)
tree75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /contrib/python/cffi/gen/main.py
parent03f024c4412e3aa613bb543cf1660176320ba8f4 (diff)
downloadydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz
fix ya.make
Diffstat (limited to 'contrib/python/cffi/gen/main.py')
-rw-r--r--contrib/python/cffi/gen/main.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/contrib/python/cffi/gen/main.py b/contrib/python/cffi/gen/main.py
deleted file mode 100644
index 106293d3c53..00000000000
--- a/contrib/python/cffi/gen/main.py
+++ /dev/null
@@ -1,37 +0,0 @@
-import os.path
-import sys
-
-from cffi.setuptools_ext import execfile
-
-usage = '''Usage: {} INPUT:VAR OUTPUT
-Generate CFFI C module source code.
-
-INPUT is a source .py file.
-VAR is a cffi.FFI() object defined in the source file.
-OUTPUT is a .c or .cpp output file.
-'''
-
-
-def main():
- if len(sys.argv) != 3 or ':' not in sys.argv[1]:
- sys.stdout.write(usage.format(sys.argv[0]))
- sys.exit(1)
-
- mod_spec, c_file = sys.argv[1:3]
- build_file_name, ffi_var_name = mod_spec.rsplit(':', 1)
-
- source_dir = os.path.dirname(os.path.abspath(build_file_name))
- sys._MEIPASS = source_dir # For pygit2.
- sys.dont_write_bytecode = True
- sys.path = [source_dir]
- mod_vars = {'__name__': '__cffi__', '__file__': build_file_name}
- execfile(build_file_name, mod_vars)
-
- ffi = mod_vars[ffi_var_name]
- if callable(ffi):
- ffi = ffi()
- ffi.emit_c_code(c_file)
-
-
-if __name__ == '__main__':
- main()