eth-faucet

Gas token gifter with controls from time intervals, amounts and access
Info | Log | Files | Refs | README

gen.py (616B)


      1 # standard imports
      2 import sys
      3 import os
      4 import argparse
      5 
      6 script_dir=os.path.dirname(os.path.realpath(__file__))
      7 data_dir=os.path.join(script_dir, '..', 'data')
      8 
      9 tr={
     10         'faucet': 'EthFaucet',
     11         'period': 'PeriodSimple',
     12         }
     13 
     14 argparser = argparse.ArgumentParser()
     15 argparser.add_argument('name', type=str, default='faucet', choices=['faucet', 'period'], help='list code identifiers')
     16 args = argparser.parse_args(sys.argv[1:])
     17 
     18 def main():
     19     fp = os.path.join(data_dir, tr[args.name] + '.bin')
     20     f = open(fp, 'r')
     21     r = f.read()
     22     f.close()
     23     print(r)
     24 
     25 
     26 if __name__ == '__main__':
     27     main()