MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / get_and_replace

Function get_and_replace

extern/pybind/setup.py:87–94  ·  view source on GitHub ↗
(
    filename: Path, binary: bool = False, **opts: str
)

Source from the content-addressed store, hash-verified

85
86# TODO: use literals & overload (typing extensions or Python 3.8)
87def get_and_replace(
88 filename: Path, binary: bool = False, **opts: str
89) -> Union[bytes, str]:
90 if binary:
91 contents = filename.read_bytes()
92 return string.Template(contents.decode()).substitute(opts).encode()
93
94 return string.Template(filename.read_text()).substitute(opts)
95
96
97# Use our input files instead when making the SDist (and anything that depends

Callers 2

make_release_treeMethod · 0.85
setup.pyFile · 0.85

Calls 2

encodeMethod · 0.80
decodeMethod · 0.80

Tested by

no test coverage detected