本文整理匯總了Python中Sycamore.Page.Page.isTalkPage方法的典型用法代碼示例。如果您正苦於以下問題:Python Page.isTalkPage方法的具體用法?Python Page.isTalkPage怎麽用?Python Page.isTalkPage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sycamore.Page.Page
的用法示例。
在下文中一共展示了Page.isTalkPage方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _consider_talk_link
# 需要導入模塊: from Sycamore.Page import Page [as 別名]
# 或者: from Sycamore.Page.Page import isTalkPage [as 別名]
def _consider_talk_link(self, links):
if not self.request.config.talk_pages:
return links
lower_links = [ link.lower() for link in links ]
from Sycamore.Page import Page
pagename = self.key
page = Page(pagename, self.request)
linkto_name = None
if page.isTalkPage():
article_page = Page(wikiutil.talk_to_article_pagename(pagename),
self.request)
article_pagename = article_page.proper_name()
if article_pagename.lower() not in lower_links:
links.append(article_pagename)
else:
talk_pagename = wikiutil.article_to_talk_pagename(pagename)
talk_page = Page(talk_pagename, self.request)
# add dependency so that editing/creating the talk page
# has an affect on the article page's links
dependency(pagename, talk_pagename.lower(), self.request)
if talk_page.exists():
talk_pagename = talk_page.proper_name()
if talk_pagename.lower() not in lower_links:
links.append(talk_pagename)
return links