import re import sys from os.path import dirname from adapt.intent import IntentBuilder from mycroft import MycroftSkill, intent_handler class MeetingModeSkill(MycroftSkill): """ Skill to show or hide a DO NOT DISTURB message """ def __init__(self): super().__init__("MeetingModeSkill") self.dnd_image = None self.html_resources = "file://" + dirname(__file__) + '/res/' self.on_settings_changed() def on_settings_changed(self): self.dnd_image = self.settings.get('dnd_image', 'do-not-disturb.png') def initialize(self): self.gui.register_handler('MeetingModeSkill.doNotDisturb', self.handle_do_not_disturb_intent) self.gui.register_handler('MeetingModeSkill.cancelDoNotDisturb', self.handle_cancel_do_not_disturb_intent) @intent_handler(IntentBuilder('handle_do_not_disturb_intent').require('do-not-disturb')) def handle_do_not_disturb_intent(self, message): self.gui.clear() self.enclosure.display_manager.remove_active() html = """