示例#1
0
 def find_urls(self):
     """Iterate over all urls in the text.  This will only work if the
     parser for this post is available, otherwise an exception is raised.
     The URLs returned are absolute URLs.
     """
     from rezine.parsers import parse
     if self.parser_missing:
         raise TypeError('parser is missing, urls cannot be looked up.')
     found = set()
     this_url = url_for(self, _external=True)
     tree = parse(self.text, self.parser, 'linksearch')
     for node in tree.query('a[href]'):
         href = urljoin(this_url, node.attributes['href'])
         if href not in found:
             found.add(href)
             yield href
示例#2
0
 def find_urls(self):
     """Iterate over all urls in the text.  This will only work if the
     parser for this post is available, otherwise an exception is raised.
     The URLs returned are absolute URLs.
     """
     from rezine.parsers import parse
     if self.parser_missing:
         raise TypeError('parser is missing, urls cannot be looked up.')
     found = set()
     this_url = url_for(self, _external=True)
     tree = parse(self.text, self.parser, 'linksearch')
     for node in tree.query('a[href]'):
         href = urljoin(this_url, node.attributes['href'])
         if href not in found:
             found.add(href)
             yield href
示例#3
0
 def _parse_text(self, text):
     from rezine.parsers import parse
     self.parser_data['body'] = parse(text, self.parser, self.parser_reason)
示例#4
0
 def _parse_text(self, text):
     from rezine.parsers import parse
     self.parser_data['intro'], self.parser_data['body'] = \
         zeml.split_intro(parse(text, self.parser, self.parser_reason))
示例#5
0
 def _parse_text(self, text):
     from rezine.parsers import parse
     self.parser_data['body'] = parse(text, self.parser, self.parser_reason)
示例#6
0
 def _parse_text(self, text):
     from rezine.parsers import parse
     self.parser_data['intro'], self.parser_data['body'] = \
         zeml.split_intro(parse(text, self.parser, self.parser_reason))