@@ -197,7 +197,7 @@ def _wait_for_press(self, card):
197
197
198
198
:param card: The active card
199
199
200
- Return the id of the destination page .
200
+ Return the id of the destination card .
201
201
"""
202
202
button01_text = card .get ('button01_text' , None )
203
203
button02_text = card .get ('button02_text' , None )
@@ -209,25 +209,25 @@ def _wait_for_press(self, card):
209
209
# showing only middle button
210
210
if self ._middle_button .contains (point_touched ):
211
211
print ("Middle button" )
212
- return card .get ('button01_goto_page_id ' , None )
212
+ return card .get ('button01_goto_card_id ' , None )
213
213
if button01_text and button02_text :
214
214
if self ._left_button .contains (point_touched ):
215
215
print ("Left button" )
216
- return card .get ('button01_goto_page_id ' , None )
216
+ return card .get ('button01_goto_card_id ' , None )
217
217
if self ._right_button .contains (point_touched ):
218
218
print ("Right button" )
219
- return card .get ('button02_goto_page_id ' , None )
219
+ return card .get ('button02_goto_card_id ' , None )
220
220
221
221
def display_card (self , card_num ):
222
- """Display and handle input on a page .
222
+ """Display and handle input on a card .
223
223
224
224
:param card_num: the index of the card to process
225
225
226
226
"""
227
227
card = self ._game [card_num ]
228
228
print (card )
229
229
print ("*" * 32 )
230
- print ('****{:^24s}****' .format (card ['page_id ' ]))
230
+ print ('****{:^24s}****' .format (card ['card_id ' ]))
231
231
print ("*" * 32 )
232
232
233
233
self ._fade_to_black ()
@@ -248,14 +248,14 @@ def display_card(self, card_num):
248
248
time .sleep (auto_adv )
249
249
return card_num + 1
250
250
251
- destination_page_id = self ._wait_for_press (card )
251
+ destination_card_id = self ._wait_for_press (card )
252
252
253
253
self .play_sound (None ) # stop playing any sounds
254
- for page_number , page_struct in enumerate (self ._game ):
255
- if page_struct .get ('page_id ' , None ) == destination_page_id :
256
- return page_number # found the matching card!
254
+ for card_number , card_struct in enumerate (self ._game ):
255
+ if card_struct .get ('card_id ' , None ) == destination_card_id :
256
+ return card_number # found the matching card!
257
257
# eep if we got here something went wrong
258
- raise RuntimeError ("Could not find card with matching 'page_id ': " , destination_page_id )
258
+ raise RuntimeError ("Could not find card with matching 'card_id ': " , destination_card_id )
259
259
260
260
def play_sound (self , filename , * , wait_to_finish = True , loop = False ):
261
261
"""Play a sound
0 commit comments