r84678 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84677‎ | r84678 | r84679 >
Date:13:46, 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
@@ -290,8 +290,14 @@
291291 return revert
292292
293293
294 -def add_comment(revision_id, revision):
 294+def extract_comment_text(revision_id, revision):
295295 comment = {}
 296+ 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')
296302 comment[revision_id] = revision.find('comment').text
297303 return comment
298304

Status & tagging log