r84704 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84703‎ | r84704 | r84705 >
Date:20:28, 24 March 2011
Author:diederik
Status:deferred
Tags:
Comment:
Fixed a small memory leak.
Modified paths:
  • /trunk/tools/editor_trends/etl/enricher.py (modified) (history)

Diff [purge]

Index: trunk/tools/editor_trends/etl/enricher.py
@@ -257,8 +257,8 @@
258258 'User Talk': 3,
259259 }
260260 ns = {}
261 - if title.text != None:
262 - title = title.text
 261+ if title != None:
 262+ #title = title.text
263263 for namespace in namespaces:
264264 if title.startswith(namespace):
265265 ns['namespace'] = namespaces[namespace]
@@ -324,8 +324,8 @@
325325
326326
327327 def create_variables(article, cache, bots):
328 - title = article['title'].text
329 - namespace = determine_namespace(article['title'])
 328+ title = article['title']
 329+ namespace = determine_namespace(title)
330330
331331 if namespace != False:
332332 cache.stats.count_articles += 1
@@ -379,7 +379,7 @@
380380
381381 article = {}
382382 id = False
383 - article[root.tag] = root
 383+ article[root.tag] = root.text
384384 article['revisions'] = []
385385 for event, elem in context:
386386 if event == 'end' and elem.tag == 'revision':
@@ -388,6 +388,7 @@
389389 article[elem.tag] = elem
390390 id = True
391391
 392+ root.clear()
392393 return article
393394
394395

Status & tagging log