예제 #1
0
파일: clock.py 프로젝트: jlbelanger/chomsky
    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')
예제 #2
0
파일: app.py 프로젝트: jlbelanger/chomsky
    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('...')
예제 #3
0
 def run(self):
     Audio.play('sounds/nevermind.wav')
     print('OK')
예제 #4
0
 def run(self):
     print('Awaiting command')
     Audio.play('sounds/wakeup.wav')
예제 #5
0
 def run(self):
     Audio.play('sounds/quit.wav')
     sys.exit()
예제 #6
0
파일: alert.py 프로젝트: jlbelanger/chomsky
 def run(self):
     print('RED ALERT')
     Audio.play('sounds/alert.wav')
예제 #7
0
파일: rude.py 프로젝트: jlbelanger/chomsky
 def run(self):
     Audio.play('sounds/rude.wav')
예제 #8
0
 def run(self):
     print(choice(config.DINNER_OPTIONS))
     Audio.play('sounds/dinner.wav')