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

Function create_if_not_exist_path

tools/python/maps_generator/generator/env.py:44–51  ·  view source on GitHub ↗

Creates directory if it doesn't exist and logs; throws exception on error

(path: AnyStr)

Source from the content-addressed store, hash-verified

42
43
44def create_if_not_exist_path(path: AnyStr):
45 """Creates directory if it doesn't exist and logs; throws exception on error"""
46 if not os.path.exists(path):
47 try:
48 os.makedirs(path)
49 logger.info(f"Created {path}")
50 except FileExistsError:
51 pass
52
53
54def create_if_not_exist(func: Callable[..., AnyStr]) -> Callable[..., AnyStr]:

Callers 4

applyMethod · 0.90
wrapperFunction · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected