本文整理汇总了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