storage.py 文件源码

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

项目:sahriswiki 作者: prologic 项目源码 文件源码
def delete_page(self, title, author=u'', comment=u''):
        """
        Remove empty directories after deleting a page.

        Note that Mercurial doesn't track directories, so we don't have to
        commit after removing empty directories.
        """

        super(WikiSubdirectoryStorage, self).delete_page(title, author, comment)
        file_path = self._file_path(title)
        self._check_path(file_path)
        dir_path = os.path.dirname(file_path)
        try:
            os.removedirs(dir_path)
        except OSError, e:
            pass # Ignore possibly OSError (39) Directory not empty errors.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号