MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / CleanWiki

Function CleanWiki

site/source/get_wiki.py:45–60  ·  view source on GitHub ↗

Delete the wiki clone directory and all contained files.

()

Source from the content-addressed store, hash-verified

43
44
45def CleanWiki():
46 """Delete the wiki clone directory and all contained files."""
47
48 def errorhandler(func, path, exc_info):
49 # where func is os.listdir, os.remove, or os.rmdir; path is the argument to that function that caused it to fail; and exc_info is a tuple returned by sys.exc_info()
50 print(func)
51 print(path)
52 print(exc_info)
53 os.chmod(path, stat.S_IWRITE)
54 os.remove(path)
55
56 try:
57 shutil.rmtree(output_dir, ignore_errors=False, onerror=errorhandler)
58 print('Old wiki clone removed')
59 except OSError:
60 print('No directory to clean found')
61
62
63def CloneWiki():

Callers 1

CloneWikiFunction · 0.85

Calls 1

printFunction · 0.50

Tested by

no test coverage detected