r85067 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85066‎ | r85067 | r85068 >
Date:14:56, 31 March 2011
Author:diederik
Status:deferred
Tags:
Comment:
Minor streamlining
Modified paths:
  • /trunk/tools/editor_trends/utils/log.py (modified) (history)

Diff [purge]

Index: trunk/tools/editor_trends/utils/log.py
@@ -75,19 +75,19 @@
7676 coll.update({'hash': hash}, {'$set': {'tasks': tasks}})
7777
7878
79 -def log_to_csv(logger, settings, **kwargs):
 79+def log_to_csv(logger, settings, message, verb, function, **kwargs):
8080 '''
8181 Writes detailed log information to logs / projectname_date.csv
8282 '''
83 - message = kwargs.pop('message')
84 - verb = kwargs.pop('verb')
85 - function = kwargs.pop('function')
8683 logger.debug('%s\tStarting %s' \
8784 % (datetime.datetime.now(), function.func_name))
8885 if message:
8986 logger.debug('%s\t%s' % (datetime.datetime.now(), message))
9087
91 - max_length = max([len(prop) for prop in kwargs if type(prop) != type(True)])
 88+ try:
 89+ max_length = max([len(prop) for prop in kwargs if type(prop) != type(True)])
 90+ except ValueError:
 91+ max_length = 0
9292 max_tabs = max_length // settings.tab_width
9393 res = max_length % settings.tab_width
9494 if res > 0: