commit f9563b7a0002513f9c34dc246cafda900f96993d
parent eb9e1911b1ef7931b0e765bc5e41fb1811e1bcfa
Author: lash <dev@holbrook.no>
Date: Sat, 11 Feb 2023 10:42:06 +0000
Add codegen script
Diffstat:
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/python/eth_faucet/runnable/gen.py b/python/eth_faucet/runnable/gen.py
@@ -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)
diff --git a/python/setup.cfg b/python/setup.cfg
@@ -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