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

Function write

modules/engine/basic_meta/_deprecated/luabind_imgui.py:28–38  ·  view source on GitHub ↗
(path, content)

Source from the content-addressed store, hash-verified

26 abort(exceptions.text_error_template().render())
27
28def write(path, content):
29 RE_PYTHON_ADDR = re.compile(r"<.+? object at 0x[0-9a-fA-F]+>")
30 directory = os.path.dirname(path)
31 if not os.path.exists(directory):
32 os.makedirs(directory, exist_ok=True)
33 open(path, "wb").write(content.encode("utf-8"))
34
35 python_addr = RE_PYTHON_ADDR.search(content)
36 if python_addr:
37 abort('Found "{}" in {} ({})'.format(
38 python_addr.group(0), os.path.basename(path), path))
39
40BASE = os.path.dirname(os.path.realpath(__file__).replace("\\", "/"))
41

Callers 1

luabind_imgui.pyFile · 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