MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / write_py_family

Function write_py_family

tests/test_pipeline.c:22470–22490  ·  view source on GitHub ↗

One Python family per subject: parse / load / validate / write, each with * a docstring, so the functions' corpus has the subject words to match. */

Source from the content-addressed store, hash-verified

22468/* One Python family per subject: parse / load / validate / write, each with
22469 * a docstring, so the functions' corpus has the subject words to match. */
22470static void write_py_family(const char *base, const char *subject) {
22471 char path[512];
22472 snprintf(path, sizeof(path), "%s/%s.py", base, subject);
22473 char body[4096];
22474 snprintf(body, sizeof(body),
22475 "def parse_%s_config(path):\n"
22476 " \"\"\"Parse the %s config file and return the parsed %s settings.\"\"\"\n"
22477 " return load_%s_config(path)\n\n"
22478 "def load_%s_config(path):\n"
22479 " \"\"\"Load the %s config from disk and validate every %s field.\"\"\"\n"
22480 " cfg = {}\n validate_%s_config(cfg)\n return cfg\n\n"
22481 "def validate_%s_config(cfg):\n"
22482 " \"\"\"Check the %s config for missing fields.\"\"\"\n"
22483 " return cfg is not None\n\n"
22484 "def write_%s_config(path, cfg):\n"
22485 " \"\"\"Write the %s config back to disk after validating it.\"\"\"\n"
22486 " validate_%s_config(cfg)\n",
22487 subject, subject, subject, subject, subject, subject, subject, subject, subject,
22488 subject, subject, subject, subject);
22489 th_write_file(path, body);
22490}
22491
22492/* The candidate count, and the bad rows, of one section (its QN contains
22493 * heading and its file ends in ext): p must be the format's curve value at

Callers 1

test_pipeline.cFile · 0.85

Calls 1

th_write_fileFunction · 0.85

Tested by

no test coverage detected