Skip to content
This repository was archived by the owner on Mar 31, 2020. It is now read-only.

Commit 2554224

Browse files
committed
Fixing Error on Jumpscares
1 parent 03b714c commit 2554224

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/mainwindow.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,20 @@ def new_image(self, cat=None):
176176
self.loop.run_until_complete(self.get_cache())
177177
cat = self.cats.pop(0)
178178

179-
# getting cat variables from the dict
180-
cat_name = cat["name"]
179+
# getting base cat variables from the dict
181180
image = cat["image"]
182181
jumpscare = cat["jumpscare"]
183-
gender = cat["gender"].capitalize()
184-
hobbies = cat["hobbies"]
185-
age = cat["age"]
186-
location = cat["location"]
182+
187183

188184
# if the image is not a jumpscare, add a Text widget with the cat name
189185
if not jumpscare:
186+
# since the image is not a jumpscare, get regular cat variables
187+
cat_name = cat["name"]
188+
gender = cat["gender"].capitalize()
189+
hobbies = cat["hobbies"]
190+
age = cat["age"]
191+
location = cat["location"]
192+
190193
# make the Text widget
191194
name = tk.Text(self.frame, width=40, height=1)
192195
# tag to make all text in the widget centered

0 commit comments

Comments
 (0)