MCPcopy
hub / github.com/deadc0de6/dotdrop / edit_content

Function edit_content

tests/helpers.py:101–108  ·  view source on GitHub ↗

edit file content

(path, newcontent, binary=False)

Source from the content-addressed store, hash-verified

99
100
101def edit_content(path, newcontent, binary=False):
102 """edit file content"""
103 mode = 'w'
104 if binary:
105 mode = 'wb'
106 # pylint: disable=W1514
107 with open(path, mode) as file:
108 file.write(newcontent)
109
110
111def create_dir(path):

Callers 4

test_updateMethod · 0.90
test_compareMethod · 0.90
test_importMethod · 0.90

Calls

no outgoing calls

Tested by 4

test_updateMethod · 0.72
test_compareMethod · 0.72
test_importMethod · 0.72