aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/gen_tasklet_reg.py
diff options
context:
space:
mode:
authorr-vetrov <r-vetrov@yandex-team.ru>2022-02-10 16:48:37 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:37 +0300
commit57ec4be909691453c290c719a2055a1563ca9940 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /build/scripts/gen_tasklet_reg.py
parente9e4986eda97ffe44139887e03f9ae77852ff8d9 (diff)
downloadydb-57ec4be909691453c290c719a2055a1563ca9940.tar.gz
Restoring authorship annotation for <r-vetrov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'build/scripts/gen_tasklet_reg.py')
-rw-r--r--build/scripts/gen_tasklet_reg.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/build/scripts/gen_tasklet_reg.py b/build/scripts/gen_tasklet_reg.py
index 5e2266dbb0..5b747c2eca 100644
--- a/build/scripts/gen_tasklet_reg.py
+++ b/build/scripts/gen_tasklet_reg.py
@@ -1,33 +1,33 @@
import argparse
-TEMPLATE = '''\
-{includes}\
-#include <tasklet/runtime/lib/{language}_wrapper.h>
+TEMPLATE = '''\
+{includes}\
+#include <tasklet/runtime/lib/{language}_wrapper.h>
#include <tasklet/runtime/lib/registry.h>
static const NTasklet::TRegHelper REG(
"{name}",
- new NTasklet::{wrapper}
+ new NTasklet::{wrapper}
);
'''
-WRAPPER = {
- 'cpp': 'TCppWrapper<{impl}>()',
+WRAPPER = {
+ 'cpp': 'TCppWrapper<{impl}>()',
'js': 'TJsWrapper("{impl}")',
- 'go': 'TGoWrapper("{impl}")',
- 'py': 'TPythonWrapper("{impl}")',
+ 'go': 'TGoWrapper("{impl}")',
+ 'py': 'TPythonWrapper("{impl}")',
'java': 'TJavaWrapper("{impl}", "{py_wrapper}")',
-}
+}
def parse_args():
parser = argparse.ArgumentParser()
- parser.add_argument('name')
- parser.add_argument('output')
- parser.add_argument('-l', '--lang', choices=WRAPPER, required=True)
- parser.add_argument('-i', '--impl', required=True)
+ parser.add_argument('name')
+ parser.add_argument('output')
+ parser.add_argument('-l', '--lang', choices=WRAPPER, required=True)
+ parser.add_argument('-i', '--impl', required=True)
parser.add_argument('-w', '--wrapper', required=False)
- parser.add_argument('includes', nargs='*')
+ parser.add_argument('includes', nargs='*')
return parser.parse_args()
@@ -35,17 +35,17 @@ def parse_args():
if __name__ == '__main__':
args = parse_args()
- includes = ''.join(
- '#include <{}>\n'.format(include)
+ includes = ''.join(
+ '#include <{}>\n'.format(include)
for include in args.includes
)
code = TEMPLATE.format(
includes=includes,
- language=args.lang,
+ language=args.lang,
name=args.name,
wrapper=WRAPPER[args.lang].format(impl=args.impl, py_wrapper=args.wrapper),
)
- with open(args.output, 'w') as f:
+ with open(args.output, 'w') as f:
f.write(code)