def run(self): now = datetime.now() hour = now.strftime('%-I') minute = now.strftime('%M') h = NumberToText.convert(hour) m = NumberToText.convert(minute) print('The time is ' + h + ' ' + m) filenames = [h] + m.split(' ') Audio.play('sounds/clock.wav') for filename in filenames: Audio.play('sounds/clock/' + filename + '.wav')
def loop(self): # Wait for user input. word = Listener().listen() # Test for all available commands. for command in self.available_commands: if word == command.split('/')[-1]: self.run_command(command) self.load_commands(command) self.print_commands() return # If there is a path, then we are awake. We only want to play an error message if we are awake. if self.path: print('Command not found') Audio.play('sounds/error.wav') else: print('...')
def run(self): Audio.play('sounds/nevermind.wav') print('OK')
def run(self): print('Awaiting command') Audio.play('sounds/wakeup.wav')
def run(self): Audio.play('sounds/quit.wav') sys.exit()
def run(self): print('RED ALERT') Audio.play('sounds/alert.wav')
def run(self): Audio.play('sounds/rude.wav')
def run(self): print(choice(config.DINNER_OPTIONS)) Audio.play('sounds/dinner.wav')