From 39fbe96daacf1ed2971ce9acb439d2ff0cc7eedb Mon Sep 17 00:00:00 2001 From: vg Date: Wed, 4 Feb 2026 17:05:41 +0100 Subject: git-sync on dita --- gamechestcli/pyproject.toml | 4 +- gamechestcli/src/__main__.py | 67 ---------------------------------- gamechestcli/src/gamechest/__main__.py | 67 ++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 69 deletions(-) delete mode 100755 gamechestcli/src/__main__.py create mode 100755 gamechestcli/src/gamechest/__main__.py (limited to 'gamechestcli') diff --git a/gamechestcli/pyproject.toml b/gamechestcli/pyproject.toml index 4371f10..cebf4de 100644 --- a/gamechestcli/pyproject.toml +++ b/gamechestcli/pyproject.toml @@ -11,8 +11,8 @@ dependencies = [ "rich>=14.3.2", "xdg>=6.0.0", ] -[project.scripts] -gamechest = "__main__:main" +#[project.scripts] +#gamechest = "__main__:main" [dependency-groups] dev = [ diff --git a/gamechestcli/src/__main__.py b/gamechestcli/src/__main__.py deleted file mode 100755 index 8452b99..0000000 --- a/gamechestcli/src/__main__.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/python3 -''' -Manage games. Install, remove, run them. - -Usage: gamechest install - gamechest remove - gamechest run [--profile_id=] - gamechest set [--profile_id=] [--remote_basedir=] [--gamesaves_path=] - gamechest list [--installed|--not-installed] - gamechest showconfig - -Options: - --profile_id=, -p - use profile instead of the default one. -''' - -import sys - -import docopt -from rich import print - -from gamechest.cliactions import install, remove, run -from gamechest.gameconfig import config -from gamechest.statusdb import StatusDB -from gamechest.gamedb import GameDB - - -def main(): - args = docopt.docopt(__doc__) - #print(args); raise SystemExit(0) - - if args['install']: - install.install(args['']) - elif args['remove']: - remove.remove(args['']) - elif args['run']: - profile_id = args['--profile_id'] or config.get_profile_id() - if not profile_id: - print('profile_id must be not null', file=sys.stderr) - run.run(args[''], profile_id) - elif args['set']: - if args['--profile_id']: - config.set_profile_id(args['--profile_id']) - if args['--remote_basedir']: - config.set_remote_basedir(args['--remote_basedir']) - if args['--gamesaves_path']: - config.set_gamesaves_path(args['--gamesaves_path']) - config.save() - elif args['list']: - status_db = StatusDB() - if args['--installed']: - print(list(status_db.get_installed())) - else: - game_db = GameDB() - list_installed = list(status_db.get_installed()) - for game_id in game_db.get_ids(): - if args['--not-installed']: - if game_id not in list_installed: - print(game_id) - else: - print(game_id, 'installed:', game_id in list_installed) - elif args['showconfig']: - config.print_config() - - -if __name__ == "__main__": - main() diff --git a/gamechestcli/src/gamechest/__main__.py b/gamechestcli/src/gamechest/__main__.py new file mode 100755 index 0000000..8452b99 --- /dev/null +++ b/gamechestcli/src/gamechest/__main__.py @@ -0,0 +1,67 @@ +#!/usr/bin/python3 +''' +Manage games. Install, remove, run them. + +Usage: gamechest install + gamechest remove + gamechest run [--profile_id=] + gamechest set [--profile_id=] [--remote_basedir=] [--gamesaves_path=] + gamechest list [--installed|--not-installed] + gamechest showconfig + +Options: + --profile_id=, -p + use profile instead of the default one. +''' + +import sys + +import docopt +from rich import print + +from gamechest.cliactions import install, remove, run +from gamechest.gameconfig import config +from gamechest.statusdb import StatusDB +from gamechest.gamedb import GameDB + + +def main(): + args = docopt.docopt(__doc__) + #print(args); raise SystemExit(0) + + if args['install']: + install.install(args['']) + elif args['remove']: + remove.remove(args['']) + elif args['run']: + profile_id = args['--profile_id'] or config.get_profile_id() + if not profile_id: + print('profile_id must be not null', file=sys.stderr) + run.run(args[''], profile_id) + elif args['set']: + if args['--profile_id']: + config.set_profile_id(args['--profile_id']) + if args['--remote_basedir']: + config.set_remote_basedir(args['--remote_basedir']) + if args['--gamesaves_path']: + config.set_gamesaves_path(args['--gamesaves_path']) + config.save() + elif args['list']: + status_db = StatusDB() + if args['--installed']: + print(list(status_db.get_installed())) + else: + game_db = GameDB() + list_installed = list(status_db.get_installed()) + for game_id in game_db.get_ids(): + if args['--not-installed']: + if game_id not in list_installed: + print(game_id) + else: + print(game_id, 'installed:', game_id in list_installed) + elif args['showconfig']: + config.print_config() + + +if __name__ == "__main__": + main() -- cgit v1.2.3