Changeset 749:53688022b592 in hatta-dev
Legend:
- Unmodified
- Added
- Removed
-
hatta.py
r748 r749 1475 1475 """Updates the content of the database, needs locks around.""" 1476 1476 1477 mime = page_mime(title)1478 if not mime.startswith('text/'):1479 self.update_words(title, '', cursor=cursor)1480 return1481 1477 if text is None: 1478 get_text = getattr(page, 'plain_text', lambda: u'') 1482 1479 try: 1483 text = self.storage.page_text(title)1480 text = get_text() 1484 1481 except werkzeug.exceptions.NotFound: 1485 1482 text = u'' 1486 extract_links = getattr(page, 'extract_links', None) 1487 if extract_links is not None: 1488 links = extract_links(text) 1489 self.update_links(title, links, cursor=cursor) 1483 extract_links = getattr(page, 'extract_links', lambda: []) 1484 if text: 1485 self.update_links(title, extract_links(text), cursor=cursor) 1490 1486 self.update_words(title, text, cursor=cursor) 1491 1487 … … 1949 1945 yield werkzeug.html(line) 1950 1946 yield '</pre>' 1947 1948 def plain_text(self): 1949 """ 1950 Get the content of the page with all markup removed, used for 1951 indexing. 1952 """ 1953 1954 return self.storage.page_text(self.title) 1955 1951 1956 1952 1957 def view_content(self, lines=None):
Note: See TracChangeset
for help on using the changeset viewer.
