mirror of
git://holbrook.no/eth-faucet
synced 2025-05-23 16:16:45 +02:00
Add codegen script
This commit is contained in:
parent
eb9e1911b1
commit
f9563b7a00
22
python/eth_faucet/runnable/gen.py
Normal file
22
python/eth_faucet/runnable/gen.py
Normal 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)
|
@ -41,3 +41,4 @@ testing =
|
|||||||
[options.entry_points]
|
[options.entry_points]
|
||||||
console_scripts =
|
console_scripts =
|
||||||
eth-faucet-publish = eth_faucet.runnable.publish:main
|
eth-faucet-publish = eth_faucet.runnable.publish:main
|
||||||
|
eth-faucet-gen = eth_faucet.runnable.gen:main
|
||||||
|
Loading…
Reference in New Issue
Block a user