Revision: 6646 Author: nicdumz Date: 2009-04-21 06:57:10 +0000 (Tue, 21 Apr 2009)
Log Message: ----------- Fixing previous commit. **kargs and not kargs adding \n when using the logger
(switching from a DCVS to CVS makes you look stupid ;) )
Modified Paths: -------------- branches/rewrite/pywikibot/bot.py
Modified: branches/rewrite/pywikibot/bot.py =================================================================== --- branches/rewrite/pywikibot/bot.py 2009-04-21 06:39:18 UTC (rev 6645) +++ branches/rewrite/pywikibot/bot.py 2009-04-21 06:57:10 UTC (rev 6646) @@ -469,7 +469,7 @@ """ Only accepts options defined in availableOptions """ - self.setOptions(kwargs) + self.setOptions(**kwargs)
def setOptions(self, **kwargs): """ @@ -478,14 +478,14 @@ # contains the options overriden from defaults self.options = {}
- validOptions = set(availableOptions.iterkeys()) + validOptions = set(Bot.availableOptions.iterkeys()) receivedOptions = set(kwargs.iterkeys())
for opt in receivedOptions & validOptions: self.options[opt] = kwargs[opt]
for opt in receivedOptions - validOptions: - logging.warning(u'%s is not a valid option. It was ignored' % opt) + logging.warning(u'%s is not a valid option. It was ignored\n' % opt)
def getOption(self, option): """ @@ -506,7 +506,7 @@ * 'always' """ if oldtext == newtext: - logging.info(u'No changes were needed on %s' \ + pywikibot.output(u'No changes were needed on %s' \ % page.title(asLink=True)) return
@@ -524,6 +524,6 @@ # Remember the choice self.options['always'] = True
- if choice != 'N': + if choice != 'n': page.put(newtext, async=(choice=='a'))
pywikipedia-svn@lists.wikimedia.org