r85986 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85985‎ | r85986 | r85987 >
Date:19:48, 13 April 2011
Author:diederik
Status:deferred
Tags:
Comment:
Added progress information.
Modified paths:
  • /trunk/tools/editor_trends/etl/extracter.py (modified) (history)

Diff [purge]

Index: trunk/tools/editor_trends/etl/extracter.py
@@ -124,6 +124,7 @@
125125 id = False
126126 ns = False
127127 parse = False
 128+ count_articles = 0
128129
129130 try:
130131 for event, elem in context:
@@ -138,8 +139,8 @@
139140 current_namespace = variables.determine_namespace(title, namespaces, include_ns)
140141 if current_namespace != False:
141142 parse = True
142 - cache.count_articles += 1
143 - if cache.count_articles % 10000 == 0:
 143+ count_articles += 1
 144+ if count_articles % 10000 == 0:
144145 print 'Worker %s parsed %s articles' % (process_id, cache.count_articles)
145146
146147 elem.clear()
@@ -149,7 +150,6 @@
150151 clear = False
151152 else:
152153 counts = datacompetition_parse_revision(revision, xml_namespace, bots, counts)
153 - cache.count_revisions += 1
154154 clear = True
155155 if clear:
156156 elem.clear()