Skip to content

Uso de pahlib en conf.py #1171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,15 @@

if not os.environ.get('SPHINX_GETTEXT') == 'True':
# Override all the files from ``.overrides`` directory
import glob
for root, dirs, files in os.walk('.overrides'):
for fname in files:
if fname == 'README.rst' and root == '.overrides':
continue
destroot = root.replace('.overrides', '').lstrip('/')
outputdir = os.path.join(
'cpython',
'Doc',
destroot,
fname,
)
os.system(f'ln -nfs `pwd`/{root}/{fname} {outputdir}')
from pathlib import Path
overrides_paths = Path('.overrides')

for path in overrides_paths.glob('**/*.*'):
if path.name == 'README.rst' and path.parent == '.overrides':
continue
destroot = str(path.parent).replace('.overrides', '').lstrip('/')
outputdir = Path('cpython/Doc') / destroot / path.name
os.system(f'ln -nfs `pwd`/{path.parent}/{path.name} {outputdir}')

gettext_compact = False
locale_dirs = ['../locales', 'cpython/locales'] # relative to the sourcedir
Expand Down