INNER CODE UNIT · Python

playbook_on_task_start

geerlingguy/raspberry-pi-dramble · testing/presentation/ansible-encounters/callback_plugins/tones.py:60

    def playbook_on_task_start(self, name, is_conditional):
        # define some defaults
        length = '0.75'
        delay = 0.5
        notes = {
            'G5': '783.99',
            'A5': '880.00',
            'F5': '698.46',
            'F4': '349.23',
            'C5': '523.25'
        }

        if name == 'C5':
            length = '1.25'

        # play the tone if it exists
        if name in notes.keys():
            thread = threading.Thread(target=self.tone, args=(notes[name], length, delay))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…