http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11470
Revision: 11470 Author: drtrigon Date: 2013-04-27 09:56:49 +0000 (Sat, 27 Apr 2013) Log Message: ----------- improvement; use dedicated output/logging functions
Modified Paths: -------------- trunk/pywikipedia/maintenance/preferences.py
Modified: trunk/pywikipedia/maintenance/preferences.py =================================================================== --- trunk/pywikipedia/maintenance/preferences.py 2013-04-27 09:52:20 UTC (rev 11469) +++ trunk/pywikipedia/maintenance/preferences.py 2013-04-27 09:56:49 UTC (rev 11470) @@ -167,9 +167,9 @@ set_for(lang, family, keys, values, verbose) except (SystemExit, KeyboardInterrupt): return - except Exception, e: - pywikibot.output(u'Warning! An exception occured! %s: %s' - % (e.__class__.__name__, str(e))) + except: + pywikibot.exception(tb=True) + pywikibot.warning(u'An exception occured!') log.write('FAILED\t%s\t%s\n' % (family, lang)) else: log.write('SUCCESS\t%s\t%s\n' % (family, lang)) @@ -194,7 +194,7 @@
def main():
- pywikibot.output(u'Warning! This script will set preferences on all ' + pywikibot.warning(u'This script will set preferences on all ' u'configured accounts!') pywikibot.output(u'You have %s accounts configured.' % sum([len(family)
pywikipedia-svn@lists.wikimedia.org