http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10765
Revision: 10765 Author: xqt Date: 2012-12-06 08:58:32 +0000 (Thu, 06 Dec 2012) Log Message: ----------- strip trailing whitespace
Modified Paths: -------------- trunk/pywikipedia/noreferences.py trunk/pywikipedia/subster.py trunk/pywikipedia/subster_irc.py
Modified: trunk/pywikipedia/noreferences.py =================================================================== --- trunk/pywikipedia/noreferences.py 2012-12-03 16:31:53 UTC (rev 10764) +++ trunk/pywikipedia/noreferences.py 2012-12-06 08:58:32 UTC (rev 10765) @@ -26,7 +26,7 @@ and the bot will only work on that single page.
If neither a page title nor a page generator is given, it takes all pages from -the default maintenance category. +the default maintenance category.
It is strongly recommended not to run this script over the entire article namespace (using the -start) parameter, as that would consume too much
Modified: trunk/pywikipedia/subster.py =================================================================== --- trunk/pywikipedia/subster.py 2012-12-03 16:31:53 UTC (rev 10764) +++ trunk/pywikipedia/subster.py 2012-12-06 08:58:32 UTC (rev 10765) @@ -8,9 +8,9 @@
Look at https://wiki.toolserver.org/view/Mail how to setup mail handling. The following code was used in file '$HOME/.forward+subster': ---- --- --- --- --- --- --- --- --- --- +--- --- --- --- --- --- --- --- --- ---
~/data/subster/mail_inbox
---- --- --- --- --- --- --- --- --- --- +--- --- --- --- --- --- --- --- --- --- in order to enable mail (mbox style) storage in given file for address: drtrigon+subster@toolserver.org
@@ -212,7 +212,7 @@ if page.title() in self._flagenable: flags.update( self._flagenable[page.title()] ) pywikibot.output(u'Flags used for writing: %s' % flags) - self.save( page, substed_content, + self.save( page, substed_content, (head + u' ' + msg) % {'tags':", ".join(substed_tags)}, **flags ) else: @@ -242,7 +242,7 @@ (exception_only, result) = pywikibot.gettraceback(exc_info) substed_content += ast.literal_eval(self._param_default['error']) %\ {'error': bot_config['ErrorTemplate'] %\ - ( pywikibot.Timestamp.now().isoformat(' '), + ( pywikibot.Timestamp.now().isoformat(' '), u' ' + result.replace(u'\n', u'\n ').rstrip() ) } substed_tags.append( u'>error:BotMagicWords<' )
@@ -260,7 +260,7 @@ substed_content += ast.literal_eval(item['error']) %\ {'error': bot_config['ErrorTemplate'] %\ ( item['value'], - pywikibot.Timestamp.now().isoformat(' '), + pywikibot.Timestamp.now().isoformat(' '), u' ' + result.replace(u'\n', u'\n ').rstrip() ) } substed_tags.append( u'>error:%s<' % item['value'] )
@@ -403,7 +403,7 @@ exec(self._code + (bot_config['CodeTemplate'] % func), scope, scope) external_data = DATA[0] logging.getLogger('subster').debug( external_data ) - + # 5.) subst content var_regex = self.get_var_regex(value) content = var_regex.sub((self._var_regex_str%{'var':value,'cont':external_data}), content, int(param['count'])) @@ -551,7 +551,7 @@ if sender in unique: (j, timestmp_j) = unique[sender]
- if (timestmp >= timestmp_j): + if (timestmp >= timestmp_j): remove.append( j ) else: remove.append( i )
Modified: trunk/pywikipedia/subster_irc.py =================================================================== --- trunk/pywikipedia/subster_irc.py 2012-12-03 16:31:53 UTC (rev 10764) +++ trunk/pywikipedia/subster_irc.py 2012-12-06 08:58:32 UTC (rev 10765) @@ -116,8 +116,8 @@ p = [p] if (source == p[0]): pywikibot.output(u'DIFFLINK: target=%s, source=%s, params=%s' % (target, source, params)) - text = u'[[%s]] / [[User:%s]] / %s' % ( page, - user, + text = u'[[%s]] / [[User:%s]] / %s' % ( page, + user, match.group('summary').decode(self.site.encoding()) ) self.do_check(target, params=(text, params['flags']))
pywikipedia-svn@lists.wikimedia.org