r86546 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86545‎ | r86546 | r86547 >
Date:20:23, 20 April 2011
Author:diederik
Status:deferred
Tags:
Comment:
Typos
Modified paths:
  • /trunk/tools/editor_trends/etl/transformer.py (modified) (history)
  • /trunk/tools/editor_trends/manage.py (modified) (history)

Diff [purge]

Index: trunk/tools/editor_trends/manage.py
@@ -336,7 +336,7 @@
337337 stopwatch = timer.Timer()
338338 log.to_db(rts, 'dataset', 'transform', stopwatch, event='start')
339339 log.to_csv(logger, rts, 'Start', 'Transform', transformer_launcher)
340 - transformer.transform_editors_multi_launcher(rts)
 340+ transformer.transform_editors_single_launcher(rts)
341341 stopwatch.elapsed()
342342 log.to_db(rts, 'dataset', 'transform', stopwatch, event='finish')
343343 log.to_csv(logger, rts, 'Finish', 'Transform', transformer_launcher)
Index: trunk/tools/editor_trends/etl/transformer.py
@@ -48,16 +48,15 @@
4949
5050
5151 class Editor:
52 - def __init__(self, rts, editor_id):
 52+ def __init__(self, db_raw, db_dataset, editor_id):
5353 self.editor_id = editor_id
54 - self.rts = rts
 54+ self.db_raw = db_raw #storage.init_database(self.rts.storage, self.rts.dbname, self.rts.editors_raw)
 55+ self.db_dataset = db_dataset #storage.init_database(self.rts.storage, self.rts.dbname, self.rts.editors_dataset)
5556
5657 def __str__(self):
5758 return '%s' % (self.editor_id)
5859
5960 def __call__(self):
60 - self.db_raw = storage.init_database(self.rts.storage, self.rts.dbname, self.rts.editors_raw)
61 - self.db_dataset = storage.init_database(self.rts.storage, self.rts.dbname, self.rts.editors_dataset)
6261 cutoff = 9
6362 editor = self.db_raw.find_one('editor', self.editor_id)
6463 if editor == None:
@@ -325,10 +324,10 @@
326325
327326 def transform_editors_single_launcher(rts):
328327 print rts.dbname, rts.editors_raw
329 - input_db, output_db, editors = setup_database(rts)
 328+ db_raw, db_dataset, editors = setup_database(rts)
330329 pbar = progressbar.ProgressBar(maxval=len(editors)).start()
331330 for editor in editors:
332 - editor = Editor(editor, input_db, output_db)
 331+ editor = Editor(db_raw, db_dataset, editor)
333332 editor()
334333 pbar.update(pbar.currval + 1)
335334