def gainFocus(self, previous, previous_name, *args, **kwargs): """What should be done when the state gets focus. Previous is the state that had focus before this one.""" self.old_state = previous self.old_state_name = previous_name try: music.pause() except: 'sound error'
async def answer(self, message): if self.is_speed_mode: music.pause(channel) msg_id = await self.channel.send(message.author.name + ": \"" + message.content + '\"') self.answers_mutex.acquire() try: self.answers[msg_id] = message.author finally: self.answers_mutex.release() await message.add_reaction('👍')
def pause_scene(): music.pause() paused = True while paused: for event in pygame.event.get(): if event.type == pygame.QUIT: game_quit() if event.type == pygame.KEYDOWN: if event.key == pygame.K_p: paused = False draw_background_colour(colour.WHITE) draw_large_centered_msg("Paused") pygame.display.update() clock.tick(FPS) music.resume()
def on_pause(self): music.pause() self.broadcast('pause')
def pause(): music.pause() return Response(status=204)