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


Python Page.buildCache方法代码示例

本文整理汇总了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()
开发者ID:ivanov,项目名称:sycamore,代码行数:12,代码来源:wikidb.py

示例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)
开发者ID:rtucker,项目名称:sycamore,代码行数:18,代码来源:maintenance.py

示例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!"
开发者ID:ivanov,项目名称:sycamore,代码行数:32,代码来源:2006_08_30_acl.py


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