From 69818bd85008685fa4d7efab620c2c7566023e9a Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 19 Sep 2021 00:34:57 +0200 Subject: [PATCH] tests: Moar mypy --- moulinette/core.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/moulinette/core.py b/moulinette/core.py index 4c0bdcf8..6f6fddd7 100644 --- a/moulinette/core.py +++ b/moulinette/core.py @@ -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