mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 04:20:07 +01:00
Use pathlib write_text for more situations in build.py
This commit is contained in:
8
build.py
8
build.py
@@ -1330,10 +1330,7 @@ def cmd_sip(options, args):
|
||||
header = min(glob.glob('*.h'))
|
||||
sources = sorted(glob.glob('*.cpp'))
|
||||
del sip_pwd
|
||||
with open(sbf, 'w') as f:
|
||||
f.write("sources = {}\n".format(' '.join(sources)))
|
||||
f.write("headers = {}\n".format(header))
|
||||
|
||||
Path(sbf).write_text(f"sources = {' '.join(sources)}\nheaders = {header}\n")
|
||||
classesNeedingClassInfo = { 'sip_corewxTreeCtrl.cpp' : 'wxTreeCtrl', }
|
||||
|
||||
def processSrc(src, keepHashLines=False):
|
||||
@@ -2212,8 +2209,7 @@ def cmd_sdist(options, args):
|
||||
shutil.rmtree(opj(PDEST, 'docs'), ignore_errors=True)
|
||||
if options.nodoc:
|
||||
os.makedirs(opj(PDEST, 'docs'))
|
||||
with open(opj(PDEST, 'docs', 'README.txt'), 'wt') as f:
|
||||
f.write("The sphinx files and generated docs are not included in this archive.\n")
|
||||
Path(PDEST, 'docs', 'README.txt').write_text("The sphinx files and generated docs are not included in this archive.\n")
|
||||
else:
|
||||
shutil.copytree('docs', opj(PDEST, 'docs'),
|
||||
ignore=shutil.ignore_patterns('html', 'build', '__pycache__', 'cpp'))
|
||||
|
||||
Reference in New Issue
Block a user