diff --git a/adl.py b/adl.py index 69a1c49..50896ff 100644 --- a/adl.py +++ b/adl.py @@ -1,4 +1,5 @@ -import os, subprocess, sys, argparse +import os, subprocess, sys, argparse, signal +from time import sleep # argument parser ap = argparse.ArgumentParser() @@ -140,9 +141,9 @@ def get_score(choice): choice = choice[68:71] return choice -# watch anime +# watch animes def watch(cmd): - os.system(cmd) + subprocess.run(cmd) # next episode def next_episode(title,episode): @@ -276,6 +277,11 @@ def wanna_update_title_after_watch(title, episode, score): elif yn == "N" or yn == "n": break +def interupt_command(signum, frame): + exit_adl() + +signal.signal(signal.SIGINT, interupt_command) + # choose what to do with episode def choose_episode(): subprocess.call("cls", shell=True)