r88957 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88956‎ | r88957 | r88958 >
Date:03:22, 27 May 2011
Author:diederik
Status:deferred
Tags:
Comment:
Added command-line support for differ
Modified paths:
  • /trunk/tools/editor_trends/manage.py (modified) (history)

Diff [purge]

Index: trunk/tools/editor_trends/manage.py
@@ -38,6 +38,7 @@
3939 from etl import store
4040 from etl import sort
4141 from etl import transformer
 42+from etl import differ
4243 from analyses import analyzer
4344 from analyses import inventory
4445
@@ -136,6 +137,11 @@
137138 executing all.',
138139 default=[])
139140
 141+ #DIFFER
 142+ parser_diff = subparsers.add_parser('diff',
 143+ help='Create a Mongo collection containing the diffs between revisions.')
 144+ parser_diff.set_defaults(func=diff_launcher)
 145+
140146 #DJANGO
141147 parser_django = subparsers.add_parser('django')
142148 parser_django.add_argument('-e', '--except',
@@ -343,6 +349,18 @@
344350 log.to_csv(logger, rts, 'Finish', 'Transform', transformer_launcher)
345351
346352
 353+def diff_launcher(rts, logger):
 354+ print 'Start creating diff dataset'
 355+ stopwatch = timer.Timer()
 356+ log.to_db(rts, 'dataset', 'diff', stopwatch, event='start')
 357+ log.to_csv(logger, rts, 'Start', 'Diff', diff_launcher)
 358+ differ.launcher(rts)
 359+ stopwatch.elapsed()
 360+ log.to_db(rts, 'dataset', 'diff', stopwatch, event='finish')
 361+ log.to_csv(logger, rts, 'Finish', 'Diff', diff_launcher)
 362+
 363+
 364+
347365 def dataset_launcher(rts, logger):
348366 '''
349367 Dataset launcher is the entry point to generate datasets from the command