mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
tests: Moar mypy
This commit is contained in:
parent
6a2ae5630b
commit
69818bd850
1 changed files with 4 additions and 4 deletions
|
@ -246,7 +246,7 @@ class Moulinette18n(object):
|
|||
for n in self._namespaces.values():
|
||||
n.set_locale(locale)
|
||||
|
||||
def g(self, key, *args, **kwargs):
|
||||
def g(self, key: str, *args, **kwargs) -> str:
|
||||
"""Retrieve proper translation for a moulinette key
|
||||
|
||||
Attempt to retrieve value for a key from moulinette translations
|
||||
|
@ -258,7 +258,7 @@ class Moulinette18n(object):
|
|||
"""
|
||||
return self._global.translate(key, *args, **kwargs)
|
||||
|
||||
def n(self, key, *args, **kwargs):
|
||||
def n(self, key: str, *args, **kwargs) -> str:
|
||||
"""Retrieve proper translation for a moulinette key
|
||||
|
||||
Attempt to retrieve value for a key from current loaded namespace
|
||||
|
@ -271,7 +271,7 @@ class Moulinette18n(object):
|
|||
"""
|
||||
return self._namespaces[self._current_namespace].translate(key, *args, **kwargs)
|
||||
|
||||
def key_exists(self, key):
|
||||
def key_exists(self, key: str) -> bool:
|
||||
"""Check if a key exists in the translation files
|
||||
|
||||
Keyword arguments:
|
||||
|
@ -298,7 +298,7 @@ class MoulinetteError(Exception):
|
|||
super(MoulinetteError, self).__init__(msg)
|
||||
self.strerror = msg
|
||||
|
||||
def content(self):
|
||||
def content(self) -> str:
|
||||
return self.strerror
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue