mirror of
https://github.com/LazoCoder/Pokemon-Terminal
synced 2025-02-17 13:28:32 +00:00
Fixed bug where background is changed even when user input is incorrect & added keyboard interrupt exception
This commit is contained in:
parent
830cab5516
commit
0dedb0eaeb
3 changed files with 11 additions and 3 deletions
|
@ -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
|
|
@ -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:
|
||||
|
|
7
main.py
7
main.py
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue