forked from Hanabi/hanabi-league
expand cli: include option for full-fledged run
This commit is contained in:
parent
295458f3f6
commit
d6000a299e
1 changed files with 10 additions and 1 deletions
|
@ -74,6 +74,13 @@ def subcommand_generate_site():
|
||||||
render_site.render_all()
|
render_site.render_all()
|
||||||
|
|
||||||
|
|
||||||
|
def subcommand_run():
|
||||||
|
subcommand_fetch("all")
|
||||||
|
subcommand_process_ratings()
|
||||||
|
subcommand_process_stats()
|
||||||
|
subcommand_generate_site()
|
||||||
|
|
||||||
|
|
||||||
def get_parser() -> argparse.ArgumentParser:
|
def get_parser() -> argparse.ArgumentParser:
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
prog=constants.APP_NAME,
|
prog=constants.APP_NAME,
|
||||||
|
@ -91,6 +98,7 @@ def get_parser() -> argparse.ArgumentParser:
|
||||||
subparsers.add_parser('process-ratings', help="Process ratings of all games.")
|
subparsers.add_parser('process-ratings', help="Process ratings of all games.")
|
||||||
subparsers.add_parser('process-stats', help="Process statistics for all players.")
|
subparsers.add_parser('process-stats', help="Process statistics for all players.")
|
||||||
subparsers.add_parser('generate-site', help="Generate the website from the DB.")
|
subparsers.add_parser('generate-site', help="Generate the website from the DB.")
|
||||||
|
subparsers.add_parser('run', help="Run the automatic suite: Fetch + process games and render site.")
|
||||||
|
|
||||||
fetch_parser = subparsers.add_parser('fetch', help='Fetch new data.')
|
fetch_parser = subparsers.add_parser('fetch', help='Fetch new data.')
|
||||||
fetch_parser.add_argument(dest='target', choices=['all', 'players', 'games', 'game-details'], default='all')
|
fetch_parser.add_argument(dest='target', choices=['all', 'players', 'games', 'game-details'], default='all')
|
||||||
|
@ -108,7 +116,8 @@ def main():
|
||||||
'process-ratings': subcommand_process_ratings,
|
'process-ratings': subcommand_process_ratings,
|
||||||
'process-stats': subcommand_process_stats,
|
'process-stats': subcommand_process_stats,
|
||||||
'generate-site': subcommand_generate_site,
|
'generate-site': subcommand_generate_site,
|
||||||
'fetch': subcommand_fetch
|
'fetch': subcommand_fetch,
|
||||||
|
'run': subcommand_run,
|
||||||
}[args.command]
|
}[args.command]
|
||||||
|
|
||||||
if args.verbose:
|
if args.verbose:
|
||||||
|
|
Loading…
Reference in a new issue