Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3ecbb9b

Browse files
authored
Omitir directorio .overrides/logo para ln y mejoras (#1840)
- Se omite el directorio logo, para que `ln` no genere warnings.- Se cambian algunas cosas en el archivo `conf.py` para solucionaralgunos warnings de flake8
1 parentd3518a3 commit3ecbb9b

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

‎conf.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,28 @@
1313
#
1414
# $ sphinx-build -b html -d _build/doctrees -D language=es . _build/html
1515

16-
importsys,os,time
16+
importsys
17+
importos
18+
importtime
1719
sys.path.append(os.path.abspath('cpython/Doc/tools/extensions'))
1820
sys.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.
2127
sys.path.insert(0,os.path.abspath('cpython/Doc'))
2228
fromconfimport*
2329

2430
# Call patchlevel with the proper path to get the version from
2531
# instead of hardcoding it
26-
importpatchlevel
27-
version,release=patchlevel.get_header_version_info(os.path.abspath('cpython/Doc'))
32+
frompatchlevelimportget_header_version_info
33+
version,release=get_header_version_info(os.path.abspath('cpython/Doc'))
2834

2935
project='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

3239
html_theme_path= ['cpython/Doc/tools']
3340
templates_path= ['cpython/Doc/tools/templates']
@@ -61,14 +68,18 @@
6168
extensions=_extensions
6269

6370

64-
ifnotos.environ.get('SPHINX_GETTEXT')=='True':
71+
ifos.environ.get('SPHINX_GETTEXT')isNone:
6572
# Override all the files from ``.overrides`` directory
6673
frompathlibimportPath
6774
overrides_paths=Path('.overrides')
6875

6976
forpathinoverrides_paths.glob('**/*.*'):
7077
ifpath.name=='README.rst'andpath.parent=='.overrides':
7178
continue
79+
# Skip the files in the .overrides/logo directory
80+
# to avoid ln issues.
81+
ifstr(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}')
@@ -85,6 +96,7 @@
8596
_stdauthor,'manual'),
8697
]
8798

99+
88100
defsetup(app):
89101

90102
defadd_contributing_banner(app,doctree):
@@ -101,10 +113,13 @@ def add_contributing_banner(app, doctree):
101113
return
102114

103115
fromdocutilsimportnodes,core
116+
fromtextwrapimportdedent
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

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp