MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / write

Function write

modules/engine/basic_meta/_deprecated/configure.py:46–56  ·  view source on GitHub ↗
(path, content)

Source from the content-addressed store, hash-verified

44
45
46def write(path, content):
47 RE_PYTHON_ADDR = re.compile(r"<.+? object at 0x[0-9a-fA-F]+>")
48 directory = os.path.dirname(path)
49 if not os.path.exists(directory):
50 os.makedirs(directory, exist_ok=True)
51 open(path, "wb").write(content.encode("utf-8"))
52
53 python_addr = RE_PYTHON_ADDR.search(content)
54 if python_addr:
55 abort('Found "{}" in {} ({})'.format(
56 python_addr.group(0), os.path.basename(path), path))
57
58
59def abort(message):

Callers 1

mainFunction · 0.70

Calls 7

groupMethod · 0.80
abortFunction · 0.70
compileMethod · 0.45
writeMethod · 0.45
encodeMethod · 0.45
searchMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected