當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。