Skip to content

Commit

Permalink
Fix more issues with interactive mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
radusuciu committed May 8, 2020
1 parent bcfdab2 commit 99bf323
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions traktor_nowplaying/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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()):
Expand All @@ -127,4 +126,4 @@ def main(args):
listener.start()

if __name__ == '__main__':
main(args)
main()
2 changes: 1 addition & 1 deletion traktor_nowplaying/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.0.9'
__version__ = '0.1.0'

0 comments on commit 99bf323

Please sign in to comment.