metacontainers.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:specto 作者: mrknow 项目源码 文件源码
def _del_path(self, path):

        common.addon.log('Attempting to remove folder: %s' % path, 0)
        if xbmcvfs.exists(path):
            try:
                common.addon.log('Removing folder: %s' % path, 0)
                try:
                    dirs, files = xbmcvfs.listdir(path)
                    for file in files:
                        xbmcvfs.delete(os.path.join(path, file))
                    success = xbmcvfs.rmdir(path)
                    if success == 0:
                        raise
                except Exception, e:
                    try:
                        common.addon.log('Failed to delete path using xbmcvfs: %s' % e, 4)
                        common.addon.log('Attempting to remove with shutil: %s' % path, 0)
                        shutil.rmtree(path)
                    except:
                        raise
            except Exception, e:
                common.addon.log('Failed to delete path: %s' % e, 4)
                return False
        else:
            common.addon.log('Folder does not exist: %s' % path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号