Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/searpc-codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,16 @@ def gen_signature_list():
write_file(f, generate_signature(item[0], item[1]))

if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(description='Generate function signatures and marshals for using Searpc')
parser.add_argument('rpc_mod_file', nargs='?', help='the RPC module file name (default: rpc_table)')
Comment thread
moschlar marked this conversation as resolved.
args = parser.parse_args()

sys.path.append(os.getcwd())

# load function table
if len(sys.argv) == 2:
abspath = os.path.abspath(sys.argv[1])
if args.rpc_mod_file:
abspath = os.path.abspath(args.rpc_mod_file)
with open(abspath, 'r') as fp:
exec(fp.read())
print("loaded func_table from %s" % abspath)
Expand Down