MCPcopy Create free account
hub / github.com/VCIP-RGBD/DFormer / extant_file

Function extant_file

utils/pyt_utils.py:228–236  ·  view source on GitHub ↗

'Type' for argparse - checks that file exists but does not open.

(x)

Source from the content-addressed store, hash-verified

226
227
228def extant_file(x):
229 """
230 'Type' for argparse - checks that file exists but does not open.
231 """
232 if not os.path.exists(x):
233 # Argparse uses the ArgumentTypeError to give a rejection message like:
234 # error: argument input: x does not exist
235 raise argparse.ArgumentTypeError("{0} does not exist".format(x))
236 return x
237
238
239def link_file(src, target):

Callers

nothing calls this directly

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected