當前位置: 首頁>>代碼示例>>Python>>正文


Python Page.isTalkPage方法代碼示例

本文整理匯總了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
開發者ID:ivanov,項目名稱:sycamore,代碼行數:30,代碼來源:caching.py


注:本文中的Sycamore.Page.Page.isTalkPage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。