def clear_cache_directory():
for root, dirs, files in os.walk(download_cache_directory):
for d in dirs:
if d == '.git':
dirpath = os.path.join(root,d)
# print('rm dir ' + dirpath)
try:
os.rmdir(dirpath)
except:
pass
for f in files:
if f.endswith('.h') or f.endswith('.m'):
continue
filepath = os.path.join(root, f)
#remove
try:
# print('remove ' + filepath)
os.remove(filepath)
except:
pass
评论列表
文章目录