mycroft.managers package

mycroft.managers.client_manager module

class mycroft.managers.client_manager.ClientManager(client_classes, *args, **kwargs)[source]

Bases: object

Holds all clients to start and stop them

quit()[source]

Sends a signal to all clients to quit. Does not wait for clients to exit (non blocking)

start()[source]

Starts all clients in different threads (non blocking)

mycroft.managers.format_manager module

class mycroft.managers.format_manager.FormatManager(path_manager)[source]

Bases: object

Holds all formats and provides an interface to access them

as_dialog

Get data as a sentence

generate(name, results)[source]

mycroft.managers.intent_manager module

class mycroft.managers.intent_manager.IntentManager(path_manager)[source]

Bases: object

Used to handle creating both intents and intent engines

calc_results(query)[source]

Find the best intent and run the handler to find the results

Parameters:query – input sentence
Returns:name, results
Rtype name:string (namespaced intent)
Rtype results:dict
on_intents_loaded()[source]
register_fallback(handler)[source]

Register a function to be called as a general knowledge fallback

Parameters:handler – function that receives query and returns a dict of results, one of which is ‘confidence’ note: register_fallback in the MycroftSkill base class automatically manages results
register_intent(skill_name, intent, handler)[source]

Register an intent via the corresponding intent engine It tries passing the arguments to each engine until one can interpret it correctly

Parameters:
  • skill_name
  • intent – argument used to build intent; can be anything
  • handler – function that receives intent_data and returns a dict of results note: register_intent in the MycroftSkill base class automatically manages results
Returns:

nothing

mycroft.managers.path_manager module

class mycroft.managers.path_manager.PathManager(base_path)[source]

Bases: object

Retreives directories and files used by Mycroft

dialog_dir(skill_name)[source]
intent_dir(skill_name)[source]
mod_path
padatious_exe

The locally compiled Padatious executable

skill_dir(skill_name)[source]
skills_dir
vocab_dir(skill_name)[source]

mycroft.managers.query_manager module

class mycroft.managers.query_manager.QueryManager(intent_manager, format_manager)[source]

Bases: object

Launches queries in separate threads

on_response(callback)[source]

Assign a callback to be run whenever a new response comes in

send_query(query)[source]

Starts calculating a query in a new thread

mycroft.managers.skill_manager module

class mycroft.managers.skill_manager.SkillManager(intent_manager, path_manager)[source]

Bases: object

Dynamically loads skills

load_skills()[source]

Looks in the skill folder and loads the CamelCase equivalent class of the snake case folder This class should be inside the skill.py file. Example:

skills/
time_skill/
skill.py - class TimeSkill(MycroftSkill):
weather_skill/
skill.py - class WeatherSkill(MycroftSkill):