Minor clean up of intent_service.py
Remove print statement
Remove unused import
Updated some docstrings
@@ -19,7 +19,6 @@ from adapt.engine import IntentDeterminationEngine
from adapt.intent import IntentBuilder
from mycroft.configuration import Configuration
-from mycroft.messagebus.message import Message
from mycroft.util.lang import set_active_lang
from mycroft.util.log import LOG
from mycroft.util.parse import normalize
@@ -124,7 +123,6 @@ class ContextManager:
if entity['origin'] != last or entity['origin'] == '':
depth += 1
last = entity['origin']
- print(depth)
result = []
if len(missing_entities) > 0:
@@ -198,10 +196,7 @@ class IntentService:
self.handle_vocab_manifest)
def update_skill_name_dict(self, message):
- """
- Messagebus handler, updates dictionary of if to skill name
- conversions.
- """
+ """Messagebus handler, updates dict of id to skill name conversions."""
self.skill_names[message.data['id']] = message.data['name']
def get_skill_name(self, skill_id):
@@ -245,6 +240,14 @@ class IntentService:
self.active_skills.remove(skill)
def add_active_skill(self, skill_id):
+ """Add a skill or update the position of an active skill.
+
+ The skill is added to the front of the list, if it's already in the
+ list it's removed so there is only a single entry of it.
+
+ Arguments:
+ skill_id (str): identifier of skill to be added.
+ """
# search the list for an existing entry that already contains it
# and remove that reference
if skill_id != '':
@@ -275,8 +278,7 @@ class IntentService:
self.context_manager.inject_context(context_entity)
def send_metrics(self, intent, context, stopwatch):
- """
- Send timing metrics to the backend.
+ """Send timing metrics to the backend.
NOTE: This only applies to those with Opt In.
"""
