MCPcopy Create free account
hub / github.com/comaps/comaps / make_symlink

Function make_symlink

tools/python/maps_generator/utils/file.py:192–206  ·  view source on GitHub ↗
(target: AnyStr, link_name: AnyStr, force: bool = False)

Source from the content-addressed store, hash-verified

190
191
192def make_symlink(target: AnyStr, link_name: AnyStr, force: bool = False):
193 if force and os.path.lexists(link_name):
194 os.remove(link_name)
195 try:
196 os.symlink(target, link_name)
197 except OSError as e:
198 if e.errno == errno.EEXIST:
199 if os.path.islink(link_name):
200 link = os.readlink(link_name)
201 if os.path.abspath(target) != os.path.abspath(link):
202 raise e
203 else:
204 raise e
205 else:
206 raise e
207
208
209def sign_file(file_path, key_path, signature_path=None):

Callers 3

applyMethod · 0.90
setup_bordersMethod · 0.90

Calls 1

removeMethod · 0.45

Tested by

no test coverage detected