diff options
Diffstat (limited to 'xlators/experimental')
-rwxr-xr-x | xlators/experimental/fdl/src/gen_dumper.py | 11 | ||||
-rwxr-xr-x | xlators/experimental/fdl/src/gen_fdl.py | 27 | ||||
-rwxr-xr-x | xlators/experimental/fdl/src/gen_recon.py | 11 | ||||
-rwxr-xr-x | xlators/experimental/jbr-client/src/gen-fops.py | 13 | ||||
-rwxr-xr-x | xlators/experimental/jbr-server/src/gen-fops.py | 39 |
5 files changed, 53 insertions, 48 deletions
diff --git a/xlators/experimental/fdl/src/gen_dumper.py b/xlators/experimental/fdl/src/gen_dumper.py index 2950be44e01..363ba6ce63f 100755 --- a/xlators/experimental/fdl/src/gen_dumper.py +++ b/xlators/experimental/fdl/src/gen_dumper.py @@ -1,5 +1,6 @@ #!/usr/bin/python2 +from __future__ import print_function import os import re import sys @@ -109,8 +110,8 @@ def load_fragments (path="recon-tmpl.c"): if __name__ == "__main__": fragments = load_fragments(sys.argv[1]) - print "/* BEGIN GENERATED CODE - DO NOT MODIFY */" - print fragments["PROLOG"] - print gen_functions() - print fragments["EPILOG"].replace("@SWITCH_BODY@",gen_cases()) - print "/* END GENERATED CODE */" + print("/* BEGIN GENERATED CODE - DO NOT MODIFY */") + print(fragments["PROLOG"]) + print(gen_functions()) + print(fragments["EPILOG"].replace("@SWITCH_BODY@",gen_cases())) + print("/* END GENERATED CODE */") diff --git a/xlators/experimental/fdl/src/gen_fdl.py b/xlators/experimental/fdl/src/gen_fdl.py index 136aa112861..d2e7dd5dfb2 100755 --- a/xlators/experimental/fdl/src/gen_fdl.py +++ b/xlators/experimental/fdl/src/gen_fdl.py @@ -1,5 +1,6 @@ #!/usr/bin/python2 +from __future__ import print_function import os import sys @@ -325,29 +326,29 @@ def gen_fdl (): fop_subs[name]["@LEN_CODE@"] = len_code[:-1] fop_subs[name]["@SER_CODE@"] = ser_code[:-1] if 'len' in gen_funcs: - print generate(LEN_TEMPLATE,name,fop_subs) + print(generate(LEN_TEMPLATE,name,fop_subs)) if 'serialize' in gen_funcs: - print generate(SER_TEMPLATE,name,fop_subs) + print(generate(SER_TEMPLATE,name,fop_subs)) if name == 'writev': - print "#define DESTAGE_ASYNC" + print("#define DESTAGE_ASYNC") if 'callback' in gen_funcs: - print generate(CBK_TEMPLATE,name,cbk_subs) + print(generate(CBK_TEMPLATE,name,cbk_subs)) if 'continue' in gen_funcs: - print generate(CONTINUE_TEMPLATE,name,fop_subs) + print(generate(CONTINUE_TEMPLATE,name,fop_subs)) if 'fop' in gen_funcs: - print generate(FOP_TEMPLATE,name,fop_subs) + print(generate(FOP_TEMPLATE,name,fop_subs)) if name == 'writev': - print "#undef DESTAGE_ASYNC" + print("#undef DESTAGE_ASYNC") entrypoints.append(name) - print "struct xlator_fops fops = {" + print("struct xlator_fops fops = {") for ep in entrypoints: - print "\t.%s = fdl_%s," % (ep, ep) - print "};" + print("\t.%s = fdl_%s," % (ep, ep)) + print("};") for l in open(sys.argv[1],'r').readlines(): if l.find('#pragma generate') != -1: - print "/* BEGIN GENERATED CODE - DO NOT MODIFY */" + print("/* BEGIN GENERATED CODE - DO NOT MODIFY */") gen_fdl() - print "/* END GENERATED CODE */" + print("/* END GENERATED CODE */") else: - print l[:-1] + print(l[:-1]) diff --git a/xlators/experimental/fdl/src/gen_recon.py b/xlators/experimental/fdl/src/gen_recon.py index af1765517f3..75323ea3dd9 100755 --- a/xlators/experimental/fdl/src/gen_recon.py +++ b/xlators/experimental/fdl/src/gen_recon.py @@ -1,5 +1,6 @@ #!/usr/bin/python2 +from __future__ import print_function import os import re import string @@ -210,8 +211,8 @@ def load_fragments (path="recon-tmpl.c"): if __name__ == "__main__": fragments = load_fragments(sys.argv[1]) - print "/* BEGIN GENERATED CODE - DO NOT MODIFY */" - print fragments["PROLOG"] - print gen_functions() - print fragments["EPILOG"].replace("@SWITCH_BODY@",gen_cases()) - print "/* END GENERATED CODE */" + print("/* BEGIN GENERATED CODE - DO NOT MODIFY */") + print(fragments["PROLOG"]) + print(gen_functions()) + print(fragments["EPILOG"].replace("@SWITCH_BODY@",gen_cases())) + print("/* END GENERATED CODE */") diff --git a/xlators/experimental/jbr-client/src/gen-fops.py b/xlators/experimental/jbr-client/src/gen-fops.py index 64bd8b06cae..9893e0c5968 100755 --- a/xlators/experimental/jbr-client/src/gen-fops.py +++ b/xlators/experimental/jbr-client/src/gen-fops.py @@ -1,5 +1,6 @@ #!/usr/bin/python2 +from __future__ import print_function import os import re import string @@ -43,15 +44,15 @@ def gen_client (templates): if name == 'getspec': # It's not real if it doesn't have a stub function. continue - print generate(templates['cbk'],name,cbk_subs) - print generate(templates['cont-func'],name,fop_subs) - print generate(templates['fop'],name,fop_subs) + print(generate(templates['cbk'],name,cbk_subs)) + print(generate(templates['cont-func'],name,fop_subs)) + print(generate(templates['fop'],name,fop_subs)) tmpl = load_templates(sys.argv[1]) for l in open(sys.argv[2],'r').readlines(): if l.find('#pragma generate') != -1: - print "/* BEGIN GENERATED CODE - DO NOT MODIFY */" + print("/* BEGIN GENERATED CODE - DO NOT MODIFY */") gen_client(tmpl) - print "/* END GENERATED CODE */" + print("/* END GENERATED CODE */") else: - print l[:-1] + print(l[:-1]) diff --git a/xlators/experimental/jbr-server/src/gen-fops.py b/xlators/experimental/jbr-server/src/gen-fops.py index 2005e3932d4..e728f473372 100755 --- a/xlators/experimental/jbr-server/src/gen-fops.py +++ b/xlators/experimental/jbr-server/src/gen-fops.py @@ -5,6 +5,7 @@ # between leader and followers (including fan-out), and basic error checking # to be centralized one place, with per-operation code kept to a minimum. +from __future__ import print_function import os import re import string @@ -132,49 +133,49 @@ def gen_server (templates): if ("fsync" in flags) or ("queue" in flags): flags.append("need_fd") for fname in flags: - print "#define JBR_CG_%s" % fname.upper() + print("#define JBR_CG_%s" % fname.upper()) if 'complete' in gen_funcs: - print generate(templates[kind+"-complete"], - name,cbk_subs) + print(generate(templates[kind+"-complete"], + name,cbk_subs)) if 'continue' in gen_funcs: - print generate(templates[kind+"-continue"], - name,fop_subs) + print(generate(templates[kind+"-continue"], + name,fop_subs)) if 'fan-in' in gen_funcs: - print generate(templates[kind+"-fan-in"], - name,cbk_subs) + print(generate(templates[kind+"-fan-in"], + name,cbk_subs)) if 'dispatch' in gen_funcs: - print generate(templates[kind+"-dispatch"], - name,fop_subs) + print(generate(templates[kind+"-dispatch"], + name,fop_subs)) if 'call_dispatch' in gen_funcs: - print generate(templates[kind+"-call_dispatch"], - name,fop_subs) + print(generate(templates[kind+"-call_dispatch"], + name,fop_subs)) if 'perform_local_op' in gen_funcs: - print generate(templates[kind+"-perform_local_op"], - name, fop_subs) + print(generate(templates[kind+"-perform_local_op"], + name, fop_subs)) if 'fop' in gen_funcs: - print generate(templates[kind+"-fop"],name,fop_subs) + print(generate(templates[kind+"-fop"],name,fop_subs)) for fname in flags: - print "#undef JBR_CG_%s" % fname.upper() + print("#undef JBR_CG_%s" % fname.upper()) fops_done.append(name) # Just for fun, emit the fops table too. print("struct xlator_fops fops = {") for x in fops_done: - print(" .%s = jbr_%s,"%(x,x)) + print((" .%s = jbr_%s,"%(x,x))) print("};") tmpl = load_templates(sys.argv[1]) for l in open(sys.argv[2],'r').readlines(): if l.find('#pragma generate') != -1: - print "/* BEGIN GENERATED CODE - DO NOT MODIFY */" + print("/* BEGIN GENERATED CODE - DO NOT MODIFY */") gen_server(tmpl) - print "/* END GENERATED CODE */" + print("/* END GENERATED CODE */") else: - print l[:-1] + print(l[:-1]) |