1010
1111class Tinder :
1212 '''The main class for the application.'''
13-
13+
1414 def __init__ (self ):
1515 # setup for pygame mixer
1616 mixer .init ()
@@ -181,7 +181,6 @@ def new_image(self, cat=None):
181181 # getting base cat variables from the dict
182182 image = cat ["image" ]
183183 jumpscare = cat ["jumpscare" ]
184-
185184
186185 # if the image is not a jumpscare, add a Text widget with the cat name
187186 if not jumpscare :
@@ -191,7 +190,7 @@ def new_image(self, cat=None):
191190 hobbies = cat ["hobbies" ]
192191 age = cat ["age" ]
193192 location = cat ["location" ]
194-
193+
195194 # make the Text widget
196195 name = tk .Text (self .frame , width = 40 , height = 1 )
197196 # tag to make all text in the widget centered
@@ -222,25 +221,25 @@ def new_image(self, cat=None):
222221 mixer .music .load (
223222 os .path .join (self .dir , os .path .join (
224223 "res" , os .path .join ("sounds" , "jumpscare.mp3" ))
225- )
226- )
224+ )
225+ )
227226 mixer .music .play ()
228227
229228 # make a button to allow the user to pass through the image
230229 # Note: since everyone likes scary monsters, only make a Like button
231230 tk .Button (
232231 self .frame , text = "Like" , background = "green" , command = self .new_image
233- ).pack (side = tk .BOTTOM )
232+ ).pack (side = tk .BOTTOM )
234233
235234 # image was not a jumpscare, don't do jumpscare things
236235 else :
237236 # setting up like and dislike buttons on opposite sides of the screen
238237 tk .Button (
239238 self .frame , text = "Like" , background = "green" , command = self .new_image
240- ).pack (side = tk .RIGHT )
239+ ).pack (side = tk .RIGHT )
241240 tk .Button (
242241 self .frame , text = "Dislike" , background = "red" , command = self .new_image
243- ).pack (side = tk .LEFT )
242+ ).pack (side = tk .LEFT )
244243
245244 # defining button functions
246245 def back_to_photo ():
@@ -279,21 +278,21 @@ def get_bio():
279278 # setting up like/dislike/Back to Photo buttons on the bio screen
280279 tk .Button (
281280 self .frame , text = "Like" , background = "green" , command = self .new_image
282- ).pack (side = tk .RIGHT )
281+ ).pack (side = tk .RIGHT )
283282 tk .Button (
284283 self .frame , text = "Dislike" , background = "red" , command = self .new_image
285- ).pack (side = tk .LEFT )
284+ ).pack (side = tk .LEFT )
286285 tk .Button (
287286 self .root , text = "Back To Photo" , background = "blue" , command = back_to_photo
288- ).pack (side = tk .BOTTOM )
287+ ).pack (side = tk .BOTTOM )
289288
290289 # packing the frame
291290 self .frame .pack ()
292291
293292 # making and packing the Bio button for users to look at the cat's bio
294293 tk .Button (
295294 self .frame , text = "Bio" , background = "blue" , command = get_bio
296- ).pack (side = tk .BOTTOM )
295+ ).pack (side = tk .BOTTOM )
297296
298297 # packing the frame
299298 self .frame .pack ()
0 commit comments