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


Python PageEditor.clean_acl_cache方法代码示例

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


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

示例1: force_revert

# 需要导入模块: from MoinMoin.PageEditor import PageEditor [as 别名]
# 或者: from MoinMoin.PageEditor.PageEditor import clean_acl_cache [as 别名]
 def force_revert(self, pagename, request):
     rev = int(request.form['rev'][0])
     revstr = '%08d' % rev
     oldpg = Page(request, pagename, rev=rev)
     pg = PageEditor(request, pagename)
     _ = request.getText
     msg = _("Thank you for your changes. Your attention to detail is appreciated.")
     try:
         pg._write_file(oldpg.get_raw_body(),
                        action="SAVE/REVERT",
                        extra=revstr)
         pg.clean_acl_cache()
     except pg.SaveError, msg:
         pass
开发者ID:GymWenFLL,项目名称:tpp_libs,代码行数:16,代码来源:MoinSecurityPolicy.py

示例2: do_addrevision

# 需要导入模块: from MoinMoin.PageEditor import PageEditor [as 别名]
# 或者: from MoinMoin.PageEditor.PageEditor import clean_acl_cache [as 别名]
    def do_addrevision(self, filename, pagename, author=u"Scripting Subsystem", comment=u"", trivial = u"No"):
        """ Adds a revision to a page.

        @param filename: name of the file in this package
        @param pagename: name of the target page
        @param author:   user name of the editor (optional)
        @param comment:  comment related to this revision (optional)
        @param trivial:  boolean, if it is a trivial edit
        """
        _ = self.request.getText
        trivial = str2boolean(trivial)

        page = PageEditor(self.request, pagename, do_editor_backup=0, uid_override=author)
        try:
            page.saveText(self.extract_file(filename).decode("utf-8"), 0, trivial=trivial, comment=comment)
        except PageEditor.Unchanged:
            pass

        page.clean_acl_cache()
开发者ID:imosts,项目名称:flume,代码行数:21,代码来源:packages.py

示例3: do_addrevision

# 需要导入模块: from MoinMoin.PageEditor import PageEditor [as 别名]
# 或者: from MoinMoin.PageEditor.PageEditor import clean_acl_cache [as 别名]
    def do_addrevision(self, filename, pagename, author=u"Scripting Subsystem", comment=u"", trivial=u"No"):
        """ Adds a revision to a page.

        @param filename: name of the file in this package
        @param pagename: name of the target page
        @param author:   user name of the editor (optional)
        @param comment:  comment related to this revision (optional)
        @param trivial:  boolean, if it is a trivial edit
        """
        _ = self.request.getText
        trivial = str2boolean(trivial)
        if self.request.user.may.write(pagename):
            page = PageEditor(self.request, pagename, do_editor_backup=0)
            try:
                page.saveText(self.extract_file(filename).decode("utf-8"), 0, trivial=trivial, comment=comment)
            except PageEditor.Unchanged:
                pass
            else:
                self.msg += u"%(pagename)s added \n" % {"pagename": pagename}
                page.clean_acl_cache()
        else:
            self.msg += u"action add revision: not enough rights - nothing done \n"
开发者ID:steveyen,项目名称:moingo,代码行数:24,代码来源:packages.py


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