MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / copy_strip

Function copy_strip

tools/python-3.11.9-amd64/Lib/idlelib/help.py:250–280  ·  view source on GitHub ↗

Copy idle.html to idlelib/help.html, stripping trailing whitespace. Files with trailing whitespace cannot be pushed to the git cpython repository. For 3.x (on Windows), help.html is generated, after editing idle.rst on the master branch, with sphinx-build -bhtml . build/html

()

Source from the content-addressed store, hash-verified

248
249
250def copy_strip(): # pragma: no cover
251 """Copy idle.html to idlelib/help.html, stripping trailing whitespace.
252
253 Files with trailing whitespace cannot be pushed to the git cpython
254 repository. For 3.x (on Windows), help.html is generated, after
255 editing idle.rst on the master branch, with
256 sphinx-build -bhtml . build/html
257 python_d.exe -c "from idlelib.help import copy_strip; copy_strip()"
258 Check build/html/library/idle.html, the help.html diff, and the text
259 displayed by Help => IDLE Help. Add a blurb and create a PR.
260
261 It can be worthwhile to occasionally generate help.html without
262 touching idle.rst. Changes to the master version and to the doc
263 build system may result in changes that should not changed
264 the displayed text, but might break HelpParser.
265
266 As long as master and maintenance versions of idle.rst remain the
267 same, help.html can be backported. The internal Python version
268 number is not displayed. If maintenance idle.rst diverges from
269 the master version, then instead of backporting help.html from
270 master, repeat the procedure above to generate a maintenance
271 version.
272 """
273 src = join(abspath(dirname(dirname(dirname(__file__)))),
274 'Doc', 'build', 'html', 'library', 'idle.html')
275 dst = join(abspath(dirname(__file__)), 'help.html')
276 with open(src, 'rb') as inn,\
277 open(dst, 'wb') as out:
278 for line in inn:
279 out.write(line.rstrip() + b'\n')
280 print(f'{src} copied to {dst}')
281
282
283def show_idlehelp(parent):

Callers

nothing calls this directly

Calls 7

joinFunction · 0.90
abspathFunction · 0.90
dirnameFunction · 0.90
openFunction · 0.50
printFunction · 0.50
writeMethod · 0.45
rstripMethod · 0.45

Tested by

no test coverage detected