improve-output: Only show diff in interactive mode without -always flag

This commit is contained in:
2015-11-27 14:10:33 +01:00
parent 5f13da5934
commit e932303c40

View File

@@ -132,9 +132,13 @@ class ChartsBot( ):
"""Update the given page with new text."""
# only save if something was changed (and not just revision)
if text != page.get():
# Show diff only in interactive mode
if not self.always:
# Show the title of the page we're working on.
# Highlight the title in purple.
pywikibot.output(u"\n\n>>> \03{lightpurple}%s\03{default} <<<"
pywikibot.output( u"\n\n>>> \03{lightpurple}%s\03{default} <<<"
% page.title())
# show what was changed
pywikibot.showDiff(page.get(), text)