def recursive_delete_dir(fullpath):
'''helper to recursively delete a directory'''
success = True
if not isinstance(fullpath, unicode):
fullpath = fullpath.decode("utf-8")
dirs, files = xbmcvfs.listdir(fullpath)
for file in files:
file = file.decode("utf-8")
success = xbmcvfs.delete(os.path.join(fullpath, file))
for directory in dirs:
directory = directory.decode("utf-8")
success = recursive_delete_dir(os.path.join(fullpath, directory))
success = xbmcvfs.rmdir(fullpath)
return success
utils.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录