Fix typing in IntentCategoryModel.

This commit is contained in:
Remco Burema 2019-06-28 12:04:04 +02:00
parent 2843fc903b
commit 6b918dbd1d

View file

@ -19,14 +19,14 @@ class IntentCategoryModel(ListModel):
#Translations to user-visible string. Ordered by weight.
#TODO: Create a solution for this name and weight to be used dynamically.
name_translation = collections.OrderedDict()
name_translation = collections.OrderedDict() #type: "collections.OrderedDict[str,str]"
name_translation["default"] = catalog.i18nc("@label", "Default")
name_translation["engineering"] = catalog.i18nc("@label", "Engineering")
name_translation["smooth"] = catalog.i18nc("@label", "Smooth")
## Creates a new model for a certain intent category.
# \param The category to list the intent profiles for.
def __init__(self, intent_category: str):
def __init__(self, intent_category: str) -> None:
super().__init__()
self._intent_category = intent_category
@ -35,7 +35,7 @@ class IntentCategoryModel(ListModel):
self.addRoleName(self.WeightRole, "weight")
## Updates the list of intents.
def update(self):
def update(self) -> None:
available_categories = IntentManager.getInstance().currentAvailableIntentCategories()
result = []
for category in available_categories: