Skip to content

Commit

Permalink
Fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfreak committed Aug 15, 2017
1 parent 3dc7590 commit cfb67aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plumbum/cli/i18n.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import gettext
from typing import Tuple
import pkg_resources

def get_translation_for(package_name: str) -> gettext.NullTranslations:
def get_translation_for(package_name): # type: (str) -> gettext.NullTranslations
'find and return gettext translation for package'
if '.' in package_name:
package_name = '.'.join(package_name.split('.')[:-1])
Expand All @@ -16,7 +15,8 @@ def get_translation_for(package_name: str) -> gettext.NullTranslations:
return gettext.translation(package_name, localedir=localedir, fallback=True)


def get_translation_functions(package_name: str, names: Tuple[str, ...]=('gettext',)):
def get_translation_functions(package_name, names=('gettext',)):
# type: (str, Tuple[str, ...])
'finds and installs translation functions for package'
translation = get_translation_for(package_name)
return [getattr(translation, x) for x in names]

0 comments on commit cfb67aa

Please sign in to comment.