Changeset 946:b12a04d25c3d
- Timestamp:
- 01/10/09 22:32:12 (3 years ago)
- Branch:
- default
- Files:
-
- 3 edited
-
CHANGES (modified) (1 diff)
-
zine/importers/__init__.py (modified) (1 diff)
-
zine/importers/feed.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGES
r925 r946 25 25 dropdown. 26 26 - fixed importing of ZXA feeds with tags. 27 - improved importing of ZXA feeds (importers import the correct 28 syntax instead of HTML now) 27 29 - fixed wrong content type exporting in ZXA feeds. 28 30 - fixed bug in tag-cloud query. Too many items were counted for -
zine/importers/__init__.py
r910 r946 170 170 uid=old_post.uid) 171 171 if old_post.parser_data is not None: 172 post.parser_data = old_post.parser_data 172 post.parser_data.clear() 173 post.parser_data.update(old_post.parser_data) 173 174 yield u'<li><strong>%s</strong>' % escape(post.title) 174 175 -
zine/importers/feed.py
r910 r946 31 31 32 32 33 def _get_text_content(elements ):33 def _get_text_content(elements, fallback=True): 34 34 """Return the text content from the best element match.""" 35 if not elements:36 return u''37 35 for element in elements: 38 36 if element.attrib.get('type') == 'text': 39 37 return element.text or u'' 40 for element in elements: 41 if element.attrib.get('type') == 'html': 42 return to_text(element) 43 return to_text(elements[0]) 38 if fallback: 39 if not elements: 40 return u'' 41 for element in elements: 42 if element.attrib.get('type') == 'html': 43 return to_text(element) 44 return to_text(elements[0]) 44 45 45 46 … … 394 395 if author is None: 395 396 element = self._lookup_user(self._dependencies, 396 id= dependency)[0]397 id=str(dependency))[0] 397 398 author = Author( 398 399 element.findtext(zine.username), … … 431 432 432 433 def postprocess_post(self, post): 434 post.parser_data = _parser_data(post.element.findtext(zine.parser_data)) 435 content = _get_text_content(post.element.findall(atom.content), 436 fallback=False) 437 if content is not None: 438 post.body = content 433 439 content_type = post.element.findtext(zine.content_type) 434 440 if content_type is not None: … … 455 461 dependency = author.attrib.get('dependency') 456 462 if dependency is not None: 457 author = self._get_author( author)463 author = self._get_author(dependency) 458 464 email = www = None 459 465 else:
Note: See TracChangeset
for help on using the changeset viewer.