MCPcopy
hub / github.com/plotly/dash / _clean_path

Method _clean_path

dash/development/build_process.py:44–55  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

42
43 @staticmethod
44 def _clean_path(path):
45 if os.path.exists(path):
46 logger.warning("🚨 %s already exists, remove it!", path)
47 try:
48 if os.path.isfile(path):
49 os.remove(path)
50 if os.path.isdir(path):
51 shutil.rmtree(path)
52 except OSError:
53 sys.exit(1)
54 else:
55 logger.warning("🚨 %s doesn't exist, no action taken", path)
56
57 @job("clean all the previous assets generated by build tool")
58 def clean(self):

Callers 1

cleanMethod · 0.95

Calls 3

exitMethod · 0.80
existsMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected