本文整理汇总了Python中Sycamore.Page.Page.buildCache方法的典型用法代码示例。如果您正苦于以下问题:Python Page.buildCache方法的具体用法?Python Page.buildCache怎么用?Python Page.buildCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sycamore.Page.Page
的用法示例。
在下文中一共展示了Page.buildCache方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: rebuild_page_cache
# 需要导入模块: from Sycamore.Page import Page [as 别名]
# 或者: from Sycamore.Page.Page import buildCache [as 别名]
def rebuild_page_cache():
"""
Rebuilds the page cache.
"""
if not request.generating_cache and not request.previewing_page:
from Sycamore import caching
from Sycamore.Page import Page
page = Page(dict['pagename'], request)
if page.exists():
page.buildCache()
示例2: build
# 需要导入模块: from Sycamore.Page import Page [as 别名]
# 或者: from Sycamore.Page.Page import buildCache [as 别名]
def build(wiki_name, pname, doprint=False, req=None, super=False):
given_req = True
if not req:
req = request.RequestDummy(wiki_name=wiki_name)
given_req = False
page = Page(pname, req)
page.buildCache()
if super:
wikiutil.macro_delete_checks(page)
if not given_req:
req.db_disconnect()
if doprint:
print " -->", pname.encode(config.charset)
示例3: get_group_members
# 需要导入模块: from Sycamore.Page import Page [as 别名]
# 或者: from Sycamore.Page.Page import buildCache [as 别名]
group = wikiacl.Group(groupname, req)
groupdict = get_group_members(groupname, req)
group.update(groupdict)
group.save()
print " ", admin_group, "->", 'Admin'
group = wikiacl.Group('Admin', req)
groupdict = get_group_members(admin_group, req)
group.update(groupdict)
group.save()
print " ", banned_group, "->", 'Banned'
group = wikiacl.Group('Banned', req)
groupdict = get_group_members(banned_group, req)
group.update(groupdict)
group.save()
# note on group page that this is not how it's defined any more
for groupname in defined_user_groups + [admin_group, banned_group]:
p = Page(groupname, req)
if p.exists():
new_body = p.get_raw_body() + '\n\n' + group_changed_message
p.set_raw_body(new_body)
req.cursor.execute("UPDATE curPages set text=%(new_body)s where name=%(pagename)s and wiki_id=%(wiki_id)s", {'new_body':new_body, 'pagename':p.page_name, 'wiki_id':req.config.wiki_id}, isWrite=True)
req.cursor.execute("UPDATE allPages set text=%(new_body)s where name=%(pagename)s and editTime=%(mtime)s and wiki_id=%(wiki_id)s", {'new_body':new_body, 'pagename':p.page_name, 'mtime':p.mtime(), 'wiki_id':req.config.wiki_id}, isWrite=True)
p.buildCache()
req.db_disconnect()
print "..Done!"