本文整理汇总了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
示例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()
示例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"