r84679 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84678‎ | r84679 | r84680 >
Date:13:47, 24 March 2011
Author:diederik
Status:deferred
Tags:
Comment:
Fixed some exceptions for comment parsing
Modified paths:
  • /trunk/tools/editor_trends/etl/enricher.py (modified) (history)

Diff [purge]

Index: trunk/tools/editor_trends/etl/enricher.py
@@ -293,11 +293,8 @@
294294 def extract_comment_text(revision_id, revision):
295295 comment = {}
296296 text = revision.find('comment')
297 - if text != None:
298 - if text.text == None:
299 - comment[revision_id] = ''
300 - else:
301 - comment[revision_id] = text.text.encode('utf-8')
 297+ if text != None and text.text != None:
 298+ comment[revision_id] = text.text.encode('utf-8')
302299 comment[revision_id] = revision.find('comment').text
303300 return comment
304301

Status & tagging log