MCPcopy Index your code
hub / github.com/python/cpython / patchFile

Function patchFile

Mac/BuildScript/build-installer.py:1400–1413  ·  view source on GitHub ↗
(inPath, outPath)

Source from the content-addressed store, hash-verified

1398 os.chdir(curdir)
1399
1400def patchFile(inPath, outPath):
1401 data = fileContents(inPath)
1402 data = data.replace('$FULL_VERSION', getFullVersion())
1403 data = data.replace('$VERSION', getVersion())
1404 data = data.replace('$MACOSX_DEPLOYMENT_TARGET', ''.join((DEPTARGET, ' or later')))
1405 data = data.replace('$ARCHITECTURES', ", ".join(universal_opts_map[UNIVERSALARCHS]))
1406 data = data.replace('$INSTALL_SIZE', installSize())
1407 data = data.replace('$THIRD_PARTY_LIBS', "\\\n".join(THIRD_PARTY_LIBS))
1408
1409 # This one is not handy as a template variable
1410 data = data.replace('$PYTHONFRAMEWORKINSTALLDIR', '/Library/Frameworks/Python.framework')
1411 fp = open(outPath, 'w')
1412 fp.write(data)
1413 fp.close()
1414
1415def patchScript(inPath, outPath):
1416 major, minor = getVersionMajorMinor()

Callers 2

buildInstallerFunction · 0.85
mainFunction · 0.85

Calls 9

fileContentsFunction · 0.85
getFullVersionFunction · 0.85
getVersionFunction · 0.85
installSizeFunction · 0.85
openFunction · 0.50
replaceMethod · 0.45
joinMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…