mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Skip all hidden directories in `CatalogRepository
` (#11667)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
parent
5494640890
commit
abf42e901e
@ -27,6 +27,8 @@ Bugs fixed
|
||||
* #11617: ANSI control sequences are stripped from the output when writing to
|
||||
a warnings file with :option:`-w <sphinx-build -w>`.
|
||||
Patch by Bénédikt Tran.
|
||||
* #11666: Skip all hidden directories in ``CatalogRepository.pofiles``.
|
||||
Patch by Aryaz Eghbali.
|
||||
|
||||
Testing
|
||||
-------
|
||||
|
@ -99,9 +99,8 @@ class CatalogRepository:
|
||||
basedir = path.join(locale_dir, self.language, 'LC_MESSAGES')
|
||||
for root, dirnames, filenames in os.walk(basedir):
|
||||
# skip dot-directories
|
||||
for dirname in dirnames:
|
||||
if dirname.startswith('.'):
|
||||
dirnames.remove(dirname)
|
||||
for dirname in [d for d in dirnames if d.startswith('.')]:
|
||||
dirnames.remove(dirname)
|
||||
|
||||
for filename in filenames:
|
||||
if filename.endswith('.po'):
|
||||
|
@ -160,6 +160,8 @@ def test_CatalogRepository(tmp_path):
|
||||
(tmp_path / 'loc2' / 'xx' / 'LC_MESSAGES').mkdir(parents=True, exist_ok=True)
|
||||
(tmp_path / 'loc2' / 'xx' / 'LC_MESSAGES' / 'test1.po').write_text('#', encoding='utf8')
|
||||
(tmp_path / 'loc2' / 'xx' / 'LC_MESSAGES' / 'test7.po').write_text('#', encoding='utf8')
|
||||
(tmp_path / 'loc1' / 'xx' / 'LC_MESSAGES' / '.dotdir2').mkdir(parents=True, exist_ok=True)
|
||||
(tmp_path / 'loc1' / 'xx' / 'LC_MESSAGES' / '.dotdir2' / 'test8.po').write_text('#', encoding='utf8')
|
||||
|
||||
# for language xx
|
||||
repo = i18n.CatalogRepository(tmp_path, ['loc1', 'loc2'], 'xx', 'utf-8')
|
||||
|
Loading…
Reference in New Issue
Block a user