当前位置: 首页>>代码示例>>Python>>正文


Python AttachFile.remove_attachment方法代码示例

本文整理汇总了Python中MoinMoin.action.AttachFile.remove_attachment方法的典型用法代码示例。如果您正苦于以下问题:Python AttachFile.remove_attachment方法的具体用法?Python AttachFile.remove_attachment怎么用?Python AttachFile.remove_attachment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MoinMoin.action.AttachFile的用法示例。


在下文中一共展示了AttachFile.remove_attachment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: nuke_page

# 需要导入模块: from MoinMoin.action import AttachFile [as 别名]
# 或者: from MoinMoin.action.AttachFile import remove_attachment [as 别名]
def nuke_page(request, pagename):
    """ completely delete a page, everything in the pagedir """
    attachments = AttachFile._get_files(request, pagename)
    for attachment in attachments:
        AttachFile.remove_attachment(request, pagename, attachment)
    page = PageEditor(request, pagename, do_editor_backup=False)
    page.deletePage()
    # really get rid of everything there:
    fpath = page.getPagePath(check_create=0)
    shutil.rmtree(fpath, True)
开发者ID:happytk,项目名称:moin,代码行数:12,代码来源:__init__.py

示例2: xmlrpc_deleteAttachment

# 需要导入模块: from MoinMoin.action import AttachFile [as 别名]
# 或者: from MoinMoin.action.AttachFile import remove_attachment [as 别名]
    def xmlrpc_deleteAttachment(self, pagename, attachname):
        """
        Deletes attachment <attachname> of page <pagename>.

        @param pagename: pagename (utf-8)
        @param attachname: attachment name (utf-8)
        @rtype: bool
        @return: True on success
        """
        pagename = self._instr(pagename)

        if not self.request.user.may.delete(pagename):
            return xmlrpclib.Fault(1, 'You are not allowed to delete attachments on this page.')

        attachname = wikiutil.taintfilename(self._instr(attachname))
        filename = AttachFile.getFilename(self.request, pagename, attachname)
        AttachFile.remove_attachment(self.request, pagename, attachname)
        return xmlrpclib.Boolean(1)
开发者ID:Kartstig,项目名称:engineering-inventions-wiki,代码行数:20,代码来源:__init__.py


注:本文中的MoinMoin.action.AttachFile.remove_attachment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。