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


Python Page.getPageLinks方法代码示例

本文整理汇总了Python中MoinMoin.Page.Page.getPageLinks方法的典型用法代码示例。如果您正苦于以下问题:Python Page.getPageLinks方法的具体用法?Python Page.getPageLinks怎么用?Python Page.getPageLinks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MoinMoin.Page.Page的用法示例。


在下文中一共展示了Page.getPageLinks方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: xmlrpc_listLinks

# 需要导入模块: from MoinMoin.Page import Page [as 别名]
# 或者: from MoinMoin.Page.Page import getPageLinks [as 别名]
    def xmlrpc_listLinks(self, pagename):
        """
        list links for a given page
        @param pagename: the page name
        @rtype: list
        @return: links of the page, structs, with the following elements
            * name (string) : The page name or URL the link is to, UTF-8 encoding.
            * type (int) : The link type. Zero (0) for internal Wiki
              link, one (1) for external link (URL - image link, whatever).
        """
        pagename = self._instr(pagename)

        # User may read page?
        if not self.request.user.may.read(pagename):
            return self.notAllowedFault()

        page = Page(self.request, pagename)

        # Non existing page?
        if not page.exists():
            return self.noSuchPageFault()
        
        links_out = []
        for link in page.getPageLinks(self.request):
            links_out.append({ 'name': self._outstr(link), 'type': 0 })
        return links_out
开发者ID:mikejamesthompson,项目名称:orgsites,代码行数:28,代码来源:wikirpc.py

示例2: _getPages

# 需要导入模块: from MoinMoin.Page import Page [as 别名]
# 或者: from MoinMoin.Page.Page import getPageLinks [as 别名]
def _getPages(request, pagename):
    """ Return a (filtered) list of pages names.
    """
    page = Page(request, pagename)
    #links = page.parsePageLinks(request)
    links = page.getPageLinks(request)
    return links
开发者ID:130s,项目名称:roswiki,代码行数:9,代码来源:PageNavi.py

示例3: mainloop

# 需要导入模块: from MoinMoin.Page import Page [as 别名]
# 或者: from MoinMoin.Page.Page import getPageLinks [as 别名]
    def mainloop(self):
        self.init_request()
        request = self.request

        # make cache related to pagelinks entries of a page
        pages = request.rootpage.getPageList(user='', exists=1)
        for pagename in pages:
            page = Page(request, pagename)
            request.page = page
            p = page.getPageLinks(request)
开发者ID:steveyen,项目名称:moingo,代码行数:12,代码来源:makecache.py

示例4: _index_page_rev

# 需要导入模块: from MoinMoin.Page import Page [as 别名]
# 或者: from MoinMoin.Page.Page import getPageLinks [as 别名]
    def _index_page_rev(self, request, connection, pagename, revno, mode='update'):
        """ Index a page revision.

        @param request: request suitable for indexing
        @param connection: the Indexer connection object
        @param pagename: the page name
        @param revno: page revision number (int)
        @param mode: 'add' = just add, no checks
                     'update' = check if already in index and update if needed (mtime)
        """
        page = Page(request, pagename, rev=revno)
        request.page = page # XXX for what is this needed?

        wikiname = request.cfg.interwikiname or u"Self"
        revision = str(page.get_real_rev())
        itemid = "%s:%s:%s" % (wikiname, pagename, revision)
        mtime = page.mtime_usecs()

        doc = self._get_document(connection, itemid, mtime, mode)
        logging.debug("%s %s %r" % (pagename, revision, doc))
        if doc:
            mimetype = 'text/%s' % page.pi['format']  # XXX improve this

            fields = {}
            fields['wikiname'] = wikiname
            fields['pagename'] = pagename
            fields['attachment'] = '' # this is a real page, not an attachment
            fields['mtime'] = str(mtime)
            fields['revision'] = revision
            fields['title'] = pagename
            fields['content'] = page.get_raw_body()
            fields['lang'], fields['stem_lang'] = self._get_languages(page)
            fields['author'] = page.edit_info().get('editor', '?')

            multivalued_fields = {}
            multivalued_fields['mimetype'] = [mt for mt in [mimetype] + mimetype.split('/')]
            multivalued_fields['domain'] = self._get_domains(page)
            multivalued_fields['linkto'] = page.getPageLinks(request)
            multivalued_fields['category'] = self._get_categories(page)

            self._add_fields_to_document(request, doc, fields, multivalued_fields)

            try:
                connection.replace(doc)
            except xappy.IndexerError, err:
                logging.warning("IndexerError at %r %r %r (%s)" % (
                    wikiname, pagename, revision, str(err)))
开发者ID:Kartstig,项目名称:engineering-inventions-wiki,代码行数:49,代码来源:indexing.py

示例5: testGetPageLinks

# 需要导入模块: from MoinMoin.Page import Page [as 别名]
# 或者: from MoinMoin.Page.Page import getPageLinks [as 别名]
 def testGetPageLinks(self):
     page = Page(self.request, u"FrontPage")
     assert u'WikiSandBox' in page.getPageLinks(self.request)
开发者ID:Glottotopia,项目名称:aagd,代码行数:5,代码来源:test_Page.py


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