From f94fe23f60f89520ee0f849ca208ed5bc33b4b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Wed, 5 Jul 2023 19:00:50 +0200 Subject: [PATCH] move executable cli file outside of package structure --- hanabi/{hanabi_cli.py => cli.py} | 7 +++---- hanabi_cli.py | 10 ++++++++++ test.py | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) rename hanabi/{hanabi_cli.py => cli.py} (99%) create mode 100755 hanabi_cli.py diff --git a/hanabi/hanabi_cli.py b/hanabi/cli.py similarity index 99% rename from hanabi/hanabi_cli.py rename to hanabi/cli.py index 13872c8..ee1406c 100755 --- a/hanabi/hanabi_cli.py +++ b/hanabi/cli.py @@ -11,10 +11,13 @@ from hanabi.live import compress from hanabi.database import init_database """ +Commands supported: + init db + populate tables download games of variant download single game analyze single game + """ @@ -145,7 +148,3 @@ def hanabi_cli(): method_args.pop('command') method_args.pop('verbose') switcher[args.command](**method_args) - - -if __name__ == "__main__": - hanabi_cli() diff --git a/hanabi_cli.py b/hanabi_cli.py new file mode 100755 index 0000000..6b8724d --- /dev/null +++ b/hanabi_cli.py @@ -0,0 +1,10 @@ +#!/bin/bash/python3 + +""" +Short executable file to start the command-line-interface for the hanabi package. +Note this is not part of the package itself +""" + +from hanabi import cli + +cli.hanabi_cli() diff --git a/test.py b/test.py index 4a8420e..698ef17 100644 --- a/test.py +++ b/test.py @@ -4,7 +4,7 @@ from hanabi.live.download_data import download_games, detailed_export_game from hanabi.database.database import conn, cur from hanabi.database import init_database -from hanabi.hanabi_cli import hanabi_cli +from hanabi.cli import hanabi_cli def find_double_dark_games(): cur.execute("SELECT variants.id, variants.name, count(suits.id) from variants "