Fixed bug where background is changed even when user input is incorrect & added keyboard interrupt exception

This commit is contained in:
LazoCoder 2017-04-21 17:32:59 -04:00
parent 830cab5516
commit 0dedb0eaeb
3 changed files with 11 additions and 3 deletions

View file

@ -1,5 +1,5 @@
tell application "iTerm"
tell current session of current window
set background image to "/Users/Laki/GitHub/Pokemon-Terminal-Themes/Images/Generation IV - Sinnoh/408.png"
set background image to "/Users/Laki/GitHub/Pokemon-Terminal-Themes/Images/Generation I - Kanto/003.png"
end tell
end tell

View file

@ -3,6 +3,7 @@
import extractor
import filegen
import os
import sys
# Convert a Pokemon name to a number.
@ -71,7 +72,9 @@ def other_handler(user_input):
if number == -1:
guessed = guess(user_input)
if not guessed:
print("\"" + user_input + "\" is not a supported Pokemon or Region.")
print("\"" + user_input, end="")
print("\" is not a supported Pokemon or Region and no suggestions are available.")
sys.exit()
else:
return
else:

View file

@ -4,13 +4,18 @@ from sys import argv
import time
import printer
import backchanger
import sys
# Test each Pokemon in order, one by one.
def debug():
for x in range(1, 494):
backchanger.change_background(x)
time.sleep(0.25)
try:
time.sleep(0.25)
except KeyboardInterrupt:
print("Program was terminated.")
sys.exit()
# Entrance to the program.