r81353 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81352‎ | r81353 | r81354 >
Date:23:26, 1 February 2011
Author:diederik
Status:deferred
Tags:
Comment:
Two changes:
1) Store namespace variable for each edit
2) Store all editors, no cutoff anymore, that needs to be taken care of at the db level.
Modified paths:
  • /trunk/tools/editor_trends/etl/store.py (modified) (history)

Diff [purge]

Index: trunk/tools/editor_trends/etl/store.py
@@ -44,7 +44,7 @@
4545
4646 editor_cache = cache.EditorCache(collection)
4747 prev_contributor = -1
48 - edits = 0
 48+ #edits = 0
4949 while True:
5050 try:
5151 filename = tasks.get(block=False)
@@ -64,19 +64,21 @@
6565 contributor = line[0]
6666 #print 'Parsing %s' % contributor
6767 if prev_contributor != contributor:
68 - if edits > 9:
69 - editor_cache.add(prev_contributor, 'NEXT')
70 - print 'Stored %s' % prev_contributor
71 - else:
72 - editor_cache.clear(prev_contributor)
73 - edits = 0
 68+ #if edits > 9:
 69+ editor_cache.add(prev_contributor, 'NEXT')
 70+ print 'Stored %s' % prev_contributor
 71+ #else:
 72+ # editor_cache.clear(prev_contributor)
 73+ #edits = 0
7474 edits += 1
7575 date = text_utils.convert_timestamp_to_datetime_utc(line[1])
7676 article_id = int(line[2])
7777 username = line[3].encode(settings.encoding)
 78+ ns = int(line[4])
7879 value = {'date': date,
7980 'article': article_id,
80 - 'username': username}
 81+ 'username': username,
 82+ 'ns': ns}
8183 editor_cache.add(contributor, value)
8284 prev_contributor = contributor
8385 fh.close()

Status & tagging log