def _starting_up(): """ Start loading skills. Starts - reloading of skills when needed - a timer to check for internet connection - a timer for updating skills every hour - adapt intent service - padatious intent service """ global ws, skill_reload_thread, event_scheduler ws.on('intent_failure', FallbackSkill.make_intent_failure_handler(ws)) # Create skill_manager listener and invoke the first time ws.on('skill_manager', skills_manager) ws.on('mycroft.internet.connected', install_default_skills) ws.emit(Message('skill_manager', {})) # Create the Intent manager, which converts utterances to intents # This is the heart of the voice invoked skill system PadatiousService(ws) IntentService(ws) event_scheduler = EventScheduler(ws) # Create a thread that monitors the loaded skills, looking for updates skill_reload_thread = WatchSkills() skill_reload_thread.daemon = True skill_reload_thread.start() # Wait until skills have been loaded once before starting to check # network connection skill_reload_thread.wait_loaded_priority() check_connection()
def _starting_up(): """ Start loading skills. Starts - SkillManager to load/reloading of skills when needed - a timer to check for internet connection - adapt intent service - padatious intent service """ global ws, skill_manager, event_scheduler ws.on('intent_failure', FallbackSkill.make_intent_failure_handler(ws)) # Create the Intent manager, which converts utterances to intents # This is the heart of the voice invoked skill system service = IntentService(ws) PadatiousService(ws, service) event_scheduler = EventScheduler(ws) # Create a thread that monitors the loaded skills, looking for updates skill_manager = SkillManager(ws) skill_manager.daemon = True skill_manager.start() # Wait until skills have been loaded once before starting to check # network connection skill_manager.wait_loaded_priority() check_connection()
def _starting_up(): """ Start loading skills. Starts - SkillManager to load/reloading of skills when needed - a timer to check for internet connection - adapt intent service - padatious intent service """ global bus, skill_manager, event_scheduler, connect_to_mycroft_backend bus.on('intent_failure', FallbackSkill.make_intent_failure_handler(bus)) # Create the Intent manager, which converts utterances to intents # This is the heart of the voice invoked skill system service = IntentService(bus) try: PadatiousService(bus, service) except Exception as e: LOG.exception('Failed to create padatious handlers ' '({})'.format(repr(e))) event_scheduler = EventScheduler(bus) # Create a thread that monitors the loaded skills, looking for updates try: skill_manager = SkillManager(bus) except MsmException: # skill manager couldn't be created, wait for network connection and # retry LOG.info( 'Msm is uninitialized and requires network connection', 'to fetch skill information\n' 'Waiting for network connection...') while not connected(): time.sleep(30) skill_manager = SkillManager(bus) skill_manager.daemon = True # Wait until priority skills have been loaded before checking # network connection # print(skill_manager.msm.repo.get_default_skill_names()) skill_manager.load_priority() skill_manager.start() bus.emit(Message('skill.manager.initialised')) if connect_to_mycroft_backend: check_connection() else: check_connection_without_backend()
def __init__(self, skills_root): self.skills_root = skills_root self.emitter = InterceptEmitter() from mycroft.skills.intent_service import IntentService from mycroft.skills.padatious_service import PadatiousService self.ih = IntentService(self.emitter) self.ps = PadatiousService(self.emitter, self.ih) self.skills = None self.emitter.on( 'intent_failure', FallbackSkill.make_intent_failure_handler(self.emitter)) def make_response(_): data = dict(result=False) self.emitter.emit(Message('skill.converse.response', data)) self.emitter.on('skill.converse.request', make_response)