diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-06-09 00:38:31 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-06-10 23:06:07 +0900 |
commit | f442de643bbf3f2df45578dff665b8f80b980ac4 (patch) | |
tree | 0ec9d3598d29b2afb0bb7292a0d8b7c7023f6223 /sphinx/builders/latex/util.py | |
parent | f9a74b08f9636284f7692fd8f865dbf387c18daf (diff) | |
download | sphinx-git-f442de643bbf3f2df45578dff665b8f80b980ac4.tar.gz |
Migrate to py3 style type annotation: sphinx.builders.latex.util
Diffstat (limited to 'sphinx/builders/latex/util.py')
-rw-r--r-- | sphinx/builders/latex/util.py | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/sphinx/builders/latex/util.py b/sphinx/builders/latex/util.py index 3aa278496..8155d1fd7 100644 --- a/sphinx/builders/latex/util.py +++ b/sphinx/builders/latex/util.py @@ -18,30 +18,25 @@ from sphinx.deprecation import RemovedInSphinx30Warning class ExtBabel(Babel): cyrillic_languages = ('bulgarian', 'kazakh', 'mongolian', 'russian', 'ukrainian') - def __init__(self, language_code, use_polyglossia=False): - # type: (str, bool) -> None + def __init__(self, language_code: str, use_polyglossia: bool = False) -> None: self.language_code = language_code self.use_polyglossia = use_polyglossia self.supported = True super().__init__(language_code or '') - def get_shorthandoff(self): - # type: () -> str + def get_shorthandoff(self) -> str: warnings.warn('ExtBabel.get_shorthandoff() is deprecated.', RemovedInSphinx30Warning, stacklevel=2) from sphinx.writers.latex import SHORTHANDOFF return SHORTHANDOFF - def uses_cyrillic(self): - # type: () -> bool + def uses_cyrillic(self) -> bool: return self.language in self.cyrillic_languages - def is_supported_language(self): - # type: () -> bool + def is_supported_language(self) -> bool: return self.supported - def language_name(self, language_code): - # type: (str) -> str + def language_name(self, language_code: str) -> str: language = super().language_name(language_code) if language == 'ngerman' and self.use_polyglossia: # polyglossia calls new orthography (Neue Rechtschreibung) as @@ -55,8 +50,7 @@ class ExtBabel(Babel): self.supported = False return 'english' # fallback to english - def get_mainlanguage_options(self): - # type: () -> str + def get_mainlanguage_options(self) -> str: """Return options for polyglossia's ``\\setmainlanguage``.""" if self.use_polyglossia is False: return None |