MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / replace_rc_version

Function replace_rc_version

deploy.py:41–55  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

39]
40
41def replace_rc_version (version):
42 source_rc_path = rc_path
43 target_rc_path = rc_path + '.tmp'
44 with open(target_rc_path, 'w', encoding='utf-16-le') as fw, open(source_rc_path, 'r', encoding=rc_encoding) as f:
45 for line in f:
46 m = version_str.match (line)
47 if m:
48 line = re.sub (version_str, r'\g<1>{}\3'.format ('.'.join (version)), line)
49 for pattern in comma_version_str:
50 m = pattern.match (line)
51 if m:
52 line = re.sub (pattern, r'\g<1>{}\3'.format (','.join (version) + ',0'), line)
53 fw.write (line)
54 os.remove (source_rc_path)
55 os.rename (target_rc_path, source_rc_path)
56
57def zip(src, dst):
58 zf = zipfile.ZipFile(dst, "w", zipfile.ZIP_DEFLATED)

Callers 1

deploy.pyFile · 0.85

Calls 3

subMethod · 0.80
matchMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected