Index: trunk/tools/editor_trends/etl/enricher.py |
— | — | @@ -241,14 +241,15 @@ |
242 | 242 | username = extracter.extract_username(contributor) |
243 | 243 | user_id = extracter.extract_contributor_id(contributor) |
244 | 244 | bot = extracter.determine_username_is_bot(contributor, bots=bots) |
245 | | - contributor = {} |
246 | | - contributor['username'] = username |
247 | | - contributor['bot'] = bot |
| 245 | + contributor.clear() |
| 246 | + editor = {} |
| 247 | + editor['username'] = username |
| 248 | + editor['bot'] = bot |
248 | 249 | if user_id != None: |
249 | | - contributor.update(user_id) |
| 250 | + editor.update(user_id) |
250 | 251 | else: |
251 | | - contributor = False |
252 | | - return contributor |
| 252 | + editor = False |
| 253 | + return editor |
253 | 254 | |
254 | 255 | |
255 | 256 | def determine_namespace(title): |
— | — | @@ -258,7 +259,6 @@ |
259 | 260 | } |
260 | 261 | ns = {} |
261 | 262 | if title != None: |
262 | | - #title = title.text |
263 | 263 | for namespace in namespaces: |
264 | 264 | if title.startswith(namespace): |
265 | 265 | ns['namespace'] = namespaces[namespace] |
— | — | @@ -373,9 +373,11 @@ |
374 | 374 | row.update(hash) |
375 | 375 | row.update(size) |
376 | 376 | row.update(revert) |
| 377 | + revision.clear() |
377 | 378 | cache.add(row) |
378 | 379 | |
379 | 380 | |
| 381 | + |
380 | 382 | def parse_xml(buffer): |
381 | 383 | context = iterparse(buffer, events=('end',)) |
382 | 384 | context = iter(context) |