| Index: trunk/tools/editor_trends/etl/store.py |
| — | — | @@ -44,7 +44,7 @@ |
| 45 | 45 | |
| 46 | 46 | editor_cache = cache.EditorCache(collection) |
| 47 | 47 | prev_contributor = -1 |
| 48 | | - edits = 0 |
| | 48 | + #edits = 0 |
| 49 | 49 | while True: |
| 50 | 50 | try: |
| 51 | 51 | filename = tasks.get(block=False) |
| — | — | @@ -64,19 +64,21 @@ |
| 65 | 65 | contributor = line[0] |
| 66 | 66 | #print 'Parsing %s' % contributor |
| 67 | 67 | 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 |
| 74 | 74 | edits += 1 |
| 75 | 75 | date = text_utils.convert_timestamp_to_datetime_utc(line[1]) |
| 76 | 76 | article_id = int(line[2]) |
| 77 | 77 | username = line[3].encode(settings.encoding) |
| | 78 | + ns = int(line[4]) |
| 78 | 79 | value = {'date': date, |
| 79 | 80 | 'article': article_id, |
| 80 | | - 'username': username} |
| | 81 | + 'username': username, |
| | 82 | + 'ns': ns} |
| 81 | 83 | editor_cache.add(contributor, value) |
| 82 | 84 | prev_contributor = contributor |
| 83 | 85 | fh.close() |