1313#
1414# $ sphinx-build -b html -d _build/doctrees -D language=es . _build/html
1515
16- import sys , os , time
16+ import sys
17+ import os
18+ import time
1719sys .path .append (os .path .abspath ('cpython/Doc/tools/extensions' ))
1820sys .path .append (os .path .abspath ('cpython/Doc/includes' ))
1921
2022# Import all the Sphinx settings from cpython
23+ # This import will trigger warnings on the 'Include/patchlevel.h'
24+ # not being found, because it execute the content of the whole file,
25+ # and there there is a local call to 'get_header_version' like the one
26+ # we have in a few lines.
2127sys .path .insert (0 , os .path .abspath ('cpython/Doc' ))
2228from conf import *
2329
2430# Call patchlevel with the proper path to get the version from
2531# instead of hardcoding it
26- import patchlevel
27- version , release = patchlevel . get_header_version_info (os .path .abspath ('cpython/Doc' ))
32+ from patchlevel import get_header_version_info
33+ version , release = get_header_version_info (os .path .abspath ('cpython/Doc' ))
2834
2935project = 'Python en Español'
30- copyright = '2001-%s, Python Software Foundation' % time .strftime ('%Y' )
36+ year = time .strftime ("%Y" )
37+ copyright = f'2001-{ year } , Python Software Foundation'
3138
3239html_theme_path = ['cpython/Doc/tools' ]
3340templates_path = ['cpython/Doc/tools/templates' ]
6168 extensions = _extensions
6269
6370
64- if not os .environ .get ('SPHINX_GETTEXT' ) == 'True' :
71+ if os .environ .get ('SPHINX_GETTEXT' ) is None :
6572 # Override all the files from ``.overrides`` directory
6673 from pathlib import Path
6774 overrides_paths = Path ('.overrides' )
6875
6976 for path in overrides_paths .glob ('**/*.*' ):
7077 if path .name == 'README.rst' and path .parent == '.overrides' :
7178 continue
79+ # Skip the files in the .overrides/logo directory
80+ # to avoid ln issues.
81+ if str (path .parent ).endswith ("logo" ):
82+ continue
7283 destroot = str (path .parent ).replace ('.overrides' , '' ).lstrip ('/' )
7384 outputdir = Path ('cpython/Doc' ) / destroot / path .name
7485 os .system (f'ln -nfs `pwd`/{ path .parent } /{ path .name } { outputdir } ' )
8596 _stdauthor , 'manual' ),
8697]
8798
99+
88100def setup (app ):
89101
90102 def add_contributing_banner (app , doctree ):
@@ -101,10 +113,13 @@ def add_contributing_banner(app, doctree):
101113 return
102114
103115 from docutils import nodes , core
116+ from textwrap import dedent
104117
105- message = '¡Ayúdanos a traducir la documentación oficial de Python al Español! ' \
106- f'Puedes encontrar más información en `Como contribuir </es/{ version } /CONTRIBUTING.html>`_. ' \
107- 'Ayuda a acercar Python a más personas de habla hispana.'
118+ message = dedent (f"""\
119+ ¡Ayúdanos a traducir la documentación oficial de Python al Español!
120+ Puedes encontrar más información en `Como contribuir </es/{ version } /CONTRIBUTING.html>`_.
121+ Ayuda a acercar Python a más personas de habla hispana.
122+ """ )
108123
109124 paragraph = core .publish_doctree (message )[0 ]
110125 banner = nodes .note (ids = ['contributing-banner' ])
0 commit comments