Browse Source

Remove unused argument, and improve documentation

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

16
patacrep/latex/__init__.py

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

Loading…
Cancel
Save