mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Use a Matcher as default argument to simplify type anotation.
This commit is contained in:
parent
6dcdce685d
commit
6740d2d391
@ -22,13 +22,9 @@ from babel.messages.pofile import read_po
|
|||||||
|
|
||||||
from sphinx.errors import SphinxError
|
from sphinx.errors import SphinxError
|
||||||
from sphinx.util import logging
|
from sphinx.util import logging
|
||||||
|
from sphinx.util.matching import Matcher
|
||||||
from sphinx.util.osutil import SEP, relpath, walk
|
from sphinx.util.osutil import SEP, relpath, walk
|
||||||
|
|
||||||
if False:
|
|
||||||
# For type annotation
|
|
||||||
from typing import Union # NOQA
|
|
||||||
from sphinx.util.matching import Matcher # NOQA
|
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -108,8 +104,8 @@ def find_catalog_files(docname, srcdir, locale_dirs, lang, compaction):
|
|||||||
|
|
||||||
def find_catalog_source_files(locale_dirs, locale, domains=None, gettext_compact=False,
|
def find_catalog_source_files(locale_dirs, locale, domains=None, gettext_compact=False,
|
||||||
charset='utf-8', force_all=False,
|
charset='utf-8', force_all=False,
|
||||||
excluded=lambda path: False):
|
excluded=Matcher([])):
|
||||||
# type: (List[unicode], unicode, List[unicode], bool, unicode, bool, Union[Callable[[unicode], bool], Matcher]) -> Set[CatalogInfo] # NOQA
|
# type: (List[unicode], unicode, List[unicode], bool, unicode, bool, Matcher) -> Set[CatalogInfo] # NOQA
|
||||||
"""
|
"""
|
||||||
:param list locale_dirs:
|
:param list locale_dirs:
|
||||||
list of path as `['locale_dir1', 'locale_dir2', ...]` to find
|
list of path as `['locale_dir1', 'locale_dir2', ...]` to find
|
||||||
|
Loading…
Reference in New Issue
Block a user