http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10930
Revision: 10930 Author: drtrigon Date: 2013-01-15 17:17:46 +0000 (Tue, 15 Jan 2013) Log Message: ----------- follow-up; to r10921 more 'print' changed to 'output'
Modified Paths: -------------- trunk/pywikipedia/clean_sandbox.py trunk/pywikipedia/pywikibot/comms/http.py trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/clean_sandbox.py =================================================================== --- trunk/pywikipedia/clean_sandbox.py 2013-01-15 15:24:23 UTC (rev 10929) +++ trunk/pywikipedia/clean_sandbox.py 2013-01-15 17:17:46 UTC (rev 10930) @@ -197,7 +197,7 @@ else: diff = minutesDiff(sandboxPage.editTime(), time.strftime("%Y%m%d%H%M%S", time.gmtime())) if pywikibot.verbose: - print sandboxPage.editTime(), time.strftime("%Y%m%d%H%M%S", time.gmtime()) + pywikibot.output(str((sandboxPage.editTime(), time.strftime("%Y%m%d%H%M%S", time.gmtime())))) #Is the last edit more than 5 minutes ago? if diff >= self.delay: sandboxPage.put(translatedContent, translatedMsg)
Modified: trunk/pywikipedia/pywikibot/comms/http.py =================================================================== --- trunk/pywikipedia/pywikibot/comms/http.py 2013-01-15 15:24:23 UTC (rev 10929) +++ trunk/pywikipedia/pywikibot/comms/http.py 2013-01-15 17:17:46 UTC (rev 10930) @@ -211,7 +211,8 @@ try: text = unicode(text, charset, errors = 'strict') except UnicodeDecodeError, e: - print e + if verbose: + output(u'%s' %e) if no_hostname: pywikibot.output(u'ERROR: Invalid characters found on %s, replaced by \ufffd.' % uri) else:
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2013-01-15 15:24:23 UTC (rev 10929) +++ trunk/pywikipedia/wikipedia.py 2013-01-15 17:17:46 UTC (rev 10930) @@ -6240,7 +6240,7 @@ text = unicode(text, charset, errors = 'strict') except UnicodeDecodeError, e: if verbose: - output(e) + output(u'%s' %e) output(u'ERROR: Invalid characters found on %s://%s%s, replaced by \ufffd.' % (self.protocol(), self.hostname(), address)) # We use error='replace' in case of bad encoding.
pywikipedia-svn@lists.wikimedia.org