Index: trunk/tools/editor_trends/manage.py |
— | — | @@ -38,6 +38,7 @@ |
39 | 39 | from etl import store |
40 | 40 | from etl import sort |
41 | 41 | from etl import transformer |
| 42 | +from etl import differ |
42 | 43 | from analyses import analyzer |
43 | 44 | from analyses import inventory |
44 | 45 | |
— | — | @@ -136,6 +137,11 @@ |
137 | 138 | executing all.', |
138 | 139 | default=[]) |
139 | 140 | |
| 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 | + |
140 | 146 | #DJANGO |
141 | 147 | parser_django = subparsers.add_parser('django') |
142 | 148 | parser_django.add_argument('-e', '--except', |
— | — | @@ -343,6 +349,18 @@ |
344 | 350 | log.to_csv(logger, rts, 'Finish', 'Transform', transformer_launcher) |
345 | 351 | |
346 | 352 | |
| 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 | + |
347 | 365 | def dataset_launcher(rts, logger): |
348 | 366 | ''' |
349 | 367 | Dataset launcher is the entry point to generate datasets from the command |