Esempio n. 1
0
    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')
Esempio n. 2
0
    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('...')
Esempio n. 3
0
 def run(self):
     Audio.play('sounds/nevermind.wav')
     print('OK')
Esempio n. 4
0
 def run(self):
     print('Awaiting command')
     Audio.play('sounds/wakeup.wav')
Esempio n. 5
0
 def run(self):
     Audio.play('sounds/quit.wav')
     sys.exit()
Esempio n. 6
0
 def run(self):
     print('RED ALERT')
     Audio.play('sounds/alert.wav')
Esempio n. 7
0
 def run(self):
     Audio.play('sounds/rude.wav')
Esempio n. 8
0
 def run(self):
     print(choice(config.DINNER_OPTIONS))
     Audio.play('sounds/dinner.wav')