From 99bf3237019fd613d118fa6015628c9c8bf861af Mon Sep 17 00:00:00 2001 From: Radu Suciu Date: Fri, 8 May 2020 13:54:03 -0700 Subject: [PATCH] Fix more issues with interactive mode. --- traktor_nowplaying/cli.py | 11 +++++------ traktor_nowplaying/version.py | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/traktor_nowplaying/cli.py b/traktor_nowplaying/cli.py index 40e2e08..7a5e233 100644 --- a/traktor_nowplaying/cli.py +++ b/traktor_nowplaying/cli.py @@ -44,12 +44,10 @@ version='%(prog)s {version}'.format(version=__version__) ) -args = parser.parse_args() def _exit(status=None): - if not args.quiet: - print('\n Exiting') - sys.exit(status) + print('\n Exiting') + sys.exit(status) # capture Ctrl + C signal.signal(signal.SIGINT, lambda signum, frame: _exit()) @@ -117,7 +115,8 @@ def want_interactive(): return answer == 'i' -def main(args): +def main(): + args = parser.parse_args() # set arguments interactively if interactive flag is passed # or if the user passes no arguments and desires interactive mode if args.interactive or (len(sys.argv) == 1 and want_interactive()): @@ -127,4 +126,4 @@ def main(args): listener.start() if __name__ == '__main__': - main(args) + main() diff --git a/traktor_nowplaying/version.py b/traktor_nowplaying/version.py index 9d1ffab..b794fd4 100644 --- a/traktor_nowplaying/version.py +++ b/traktor_nowplaying/version.py @@ -1 +1 @@ -__version__ = '0.0.9' +__version__ = '0.1.0'