Add codegen script

This commit is contained in:
lash 2023-02-11 10:42:06 +00:00
parent eb9e1911b1
commit f9563b7a00
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,22 @@
# standard imports
import sys
import os
import argparse
script_dir=os.path.dirname(os.path.realpath(__file__))
data_dir=os.path.join(script_dir, '..', 'data')
tr={
'faucet': 'EthFaucet',
'period': 'PeriodSimple',
}
argparser = argparse.ArgumentParser()
argparser.add_argument('name', type=str, default='faucet', choices=['faucet', 'period'], help='list code identifiers')
args = argparser.parse_args(sys.argv[1:])
fp = os.path.join(data_dir, tr[args.name] + '.bin')
f = open(fp, 'r')
r = f.read()
f.close()
print(r)

View File

@ -41,3 +41,4 @@ testing =
[options.entry_points]
console_scripts =
eth-faucet-publish = eth_faucet.runnable.publish:main
eth-faucet-gen = eth_faucet.runnable.gen:main