Browse Source

Remove unused argument, and improve documentation

pull/176/head
Louis 9 years ago
parent
commit
5cfe8cd0f1
  1. 14
      patacrep/latex/__init__.py

14
patacrep/latex/__init__.py

@ -145,11 +145,11 @@ def checklanguage(lang):
)
)
def lang2babel(lang, *, raise_unknown=False):
"""Return the language used by babel, corresponding to the language code"""
try:
def lang2babel(lang):
"""Return the language used by babel, corresponding to the language code
Raises an `UnknownLanguage` exception if the `lang` argument is not known,
the :attr:`fallback` attribute of the exception being the existing
alternative language that can be used instead.
"""
return BABEL_LANGUAGES[checklanguage(lang)]
except UnknownLanguage as error:
if raise_unknown:
raise
return error.babel

Loading…
Cancel
Save