r86081 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86080‎ | r86081 | r86082 >
Date:20:11, 14 April 2011
Author:diederik
Status:deferred
Tags:
Comment:
Added progress information.
Modified paths:
  • /trunk/tools/editor_trends/classes/buffer.py (modified) (history)

Diff [purge]

Index: trunk/tools/editor_trends/classes/buffer.py
@@ -98,13 +98,14 @@
9999 if self.n > 10000:
100100 #print '%s: Emptying buffer %s - buffer size %s' % (datetime.datetime.now(), self.id, len(self.revisions))
101101 self.store()
 102+ self.n = 0
102103 else:
103104 self.n += 1
104105
105106 def simplify(self, revision):
106107 row = []
107108 for key in self.keys:
108 - row.append(value.decode('utf-8'))
 109+ row.append(revision[key].decode('utf-8'))
109110 return row
110111
111112 def stringify(self, revision):
@@ -189,6 +190,7 @@
190191 self.lock.release(file_id)
191192 del self.revisions[file_id]
192193 wait = True
 194+ print 'Buffer size: %s' % len(self.revisions.keys())
193195 # t1 = datetime.datetime.now()
194196 # print 'Worker %s: %s revisions took %s' % (self.process_id,
195197 # len([1]),