MCPcopy Create free account
hub / github.com/gitless-vcs/gitless / _x_file

Function _x_file

gitless/tests/utils.py:115–124  ·  view source on GitHub ↗
(x, fp, contents='')

Source from the content-addressed store, hash-verified

113
114
115def _x_file(x, fp, contents=''):
116 assert not IS_PY2 or isinstance(contents, unicode)
117
118 if not contents:
119 contents = fp
120 dirs, _ = os.path.split(fp)
121 if dirs and not os.path.exists(dirs):
122 os.makedirs(dirs)
123 with io.open(fp, mode=x, encoding=ENCODING) as f:
124 f.write(contents)

Callers 2

write_fileFunction · 0.85
append_to_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected