MCPcopy Create free account
hub / github.com/chatmail/core / replace_toml_version

Function replace_toml_version

scripts/set_core_version.py:31–43  ·  view source on GitHub ↗
(relpath, newversion)

Source from the content-addressed store, hash-verified

29
30
31def replace_toml_version(relpath, newversion):
32 p = pathlib.Path(relpath)
33 assert p.exists()
34 tmp_path = str(p) + "_tmp"
35 with open(tmp_path, "w") as f:
36 for line in open(str(p)):
37 m = rex.match(line)
38 if m is not None:
39 print(f"{relpath}: set version={newversion}")
40 f.write(f'version = "{newversion}"\n')
41 else:
42 f.write(line)
43 os.rename(tmp_path, str(p))
44
45
46def read_json_version(relpath):

Callers 1

mainFunction · 0.85

Calls 1

existsMethod · 0.45

Tested by

no test coverage detected