2020-03-10 18:40:19 +00:00
|
|
|
import sys
|
2020-02-28 12:02:29 +00:00
|
|
|
import click
|
|
|
|
|
2020-09-28 14:49:37 +00:00
|
|
|
from eth2deposit.cli.existing_mnemonic import existing_mnemonic
|
|
|
|
from eth2deposit.cli.new_mnemonic import new_mnemonic
|
2021-02-22 17:22:35 +00:00
|
|
|
from eth2deposit.utils.intl import load_text
|
2020-02-28 12:02:29 +00:00
|
|
|
|
|
|
|
|
2020-05-19 13:34:16 +00:00
|
|
|
def check_python_version() -> None:
|
2020-03-10 18:40:19 +00:00
|
|
|
'''
|
|
|
|
Checks that the python version running is sufficient and exits if not.
|
|
|
|
'''
|
|
|
|
if sys.version_info < (3, 7):
|
2021-02-22 17:11:16 +00:00
|
|
|
click.pause(load_text('en', ['err_python_version']))
|
2020-03-10 18:40:19 +00:00
|
|
|
sys.exit()
|
|
|
|
|
|
|
|
|
2020-09-28 14:49:37 +00:00
|
|
|
@click.group()
|
|
|
|
def cli() -> None:
|
|
|
|
pass
|
2020-02-28 12:02:29 +00:00
|
|
|
|
|
|
|
|
2020-09-28 14:49:37 +00:00
|
|
|
cli.add_command(existing_mnemonic)
|
|
|
|
cli.add_command(new_mnemonic)
|
|
|
|
|
2020-09-28 15:20:08 +00:00
|
|
|
|
2020-02-28 12:02:29 +00:00
|
|
|
if __name__ == '__main__':
|
2020-09-28 14:49:37 +00:00
|
|
|
check_python_version()
|
|
|
|
cli()
|