mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
commit
453fe5ec1a
@ -122,7 +122,7 @@ class Config(object):
|
|||||||
rst_epilog = (None, 'env', string_classes),
|
rst_epilog = (None, 'env', string_classes),
|
||||||
rst_prolog = (None, 'env', string_classes),
|
rst_prolog = (None, 'env', string_classes),
|
||||||
trim_doctest_flags = (True, 'env'),
|
trim_doctest_flags = (True, 'env'),
|
||||||
primary_domain = ('py', 'env', [NoneType]),
|
primary_domain = ('py', 'env', [NoneType]), # type: ignore
|
||||||
needs_sphinx = (None, None, string_classes),
|
needs_sphinx = (None, None, string_classes),
|
||||||
needs_extensions = ({}, None),
|
needs_extensions = ({}, None),
|
||||||
manpages_url = (None, 'env'),
|
manpages_url = (None, 'env'),
|
||||||
|
@ -120,7 +120,7 @@ def generate_autosummary_docs(sources, output_dir=None, suffix='.rst',
|
|||||||
else:
|
else:
|
||||||
if template_dir:
|
if template_dir:
|
||||||
template_dirs.insert(0, template_dir)
|
template_dirs.insert(0, template_dir)
|
||||||
template_loader = FileSystemLoader(template_dirs) # type: ignore
|
template_loader = FileSystemLoader(template_dirs)
|
||||||
template_env = SandboxedEnvironment(loader=template_loader)
|
template_env = SandboxedEnvironment(loader=template_loader)
|
||||||
template_env.filters['underline'] = _underline
|
template_env.filters['underline'] = _underline
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class _TranslationProxy(UserString, object):
|
|||||||
# replace function from UserString; it instantiates a self.__class__
|
# replace function from UserString; it instantiates a self.__class__
|
||||||
# for the encoding result
|
# for the encoding result
|
||||||
|
|
||||||
def encode(self, encoding=None, errors=None):
|
def encode(self, encoding=None, errors=None): # type: ignore
|
||||||
# type: (unicode, unicode) -> str
|
# type: (unicode, unicode) -> str
|
||||||
if encoding:
|
if encoding:
|
||||||
if errors:
|
if errors:
|
||||||
@ -82,7 +82,7 @@ class _TranslationProxy(UserString, object):
|
|||||||
return dir(text_type)
|
return dir(text_type)
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
# type: () -> Iterator[unicode]
|
# type: () -> Iterator
|
||||||
return iter(self.data)
|
return iter(self.data)
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
@ -97,15 +97,15 @@ class _TranslationProxy(UserString, object):
|
|||||||
# type: () -> unicode
|
# type: () -> unicode
|
||||||
return text_type(self.data)
|
return text_type(self.data)
|
||||||
|
|
||||||
def __add__(self, other):
|
def __add__(self, other): # type: ignore
|
||||||
# type: (unicode) -> unicode
|
# type: (unicode) -> unicode
|
||||||
return self.data + other
|
return self.data + other
|
||||||
|
|
||||||
def __radd__(self, other):
|
def __radd__(self, other): # type: ignore
|
||||||
# type: (unicode) -> unicode
|
# type: (unicode) -> unicode
|
||||||
return other + self.data
|
return other + self.data
|
||||||
|
|
||||||
def __mod__(self, other):
|
def __mod__(self, other): # type: ignore
|
||||||
# type: (unicode) -> unicode
|
# type: (unicode) -> unicode
|
||||||
return self.data % other
|
return self.data % other
|
||||||
|
|
||||||
@ -113,11 +113,11 @@ class _TranslationProxy(UserString, object):
|
|||||||
# type: (unicode) -> unicode
|
# type: (unicode) -> unicode
|
||||||
return other % self.data
|
return other % self.data
|
||||||
|
|
||||||
def __mul__(self, other):
|
def __mul__(self, other): # type: ignore
|
||||||
# type: (Any) -> unicode
|
# type: (Any) -> unicode
|
||||||
return self.data * other
|
return self.data * other
|
||||||
|
|
||||||
def __rmul__(self, other):
|
def __rmul__(self, other): # type: ignore
|
||||||
# type: (Any) -> unicode
|
# type: (Any) -> unicode
|
||||||
return other * self.data
|
return other * self.data
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ class _TranslationProxy(UserString, object):
|
|||||||
# type: (Tuple[Callable, Tuple[unicode]]) -> None
|
# type: (Tuple[Callable, Tuple[unicode]]) -> None
|
||||||
self._func, self._args = tup
|
self._func, self._args = tup
|
||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key): # type: ignore
|
||||||
# type: (Any) -> unicode
|
# type: (Any) -> unicode
|
||||||
return self.data[key]
|
return self.data[key]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user