improve-output: Only show diff in interactive mode without -always flag
This commit is contained in:
18
chartsbot.py
18
chartsbot.py
@@ -132,13 +132,17 @@ class ChartsBot( ):
|
|||||||
"""Update the given page with new text."""
|
"""Update the given page with new text."""
|
||||||
# only save if something was changed (and not just revision)
|
# only save if something was changed (and not just revision)
|
||||||
if text != page.get():
|
if text != page.get():
|
||||||
# Show the title of the page we're working on.
|
|
||||||
# Highlight the title in purple.
|
# Show diff only in interactive mode
|
||||||
pywikibot.output(u"\n\n>>> \03{lightpurple}%s\03{default} <<<"
|
if not self.always:
|
||||||
% page.title())
|
|
||||||
# show what was changed
|
# Show the title of the page we're working on.
|
||||||
pywikibot.showDiff(page.get(), text)
|
# Highlight the title in purple.
|
||||||
pywikibot.output(u'Comment: %s' % comment)
|
pywikibot.output( u"\n\n>>> \03{lightpurple}%s\03{default} <<<"
|
||||||
|
% page.title())
|
||||||
|
# show what was changed
|
||||||
|
pywikibot.showDiff(page.get(), text)
|
||||||
|
pywikibot.output(u'Comment: %s' % comment)
|
||||||
|
|
||||||
if self.always or pywikibot.input_yn(
|
if self.always or pywikibot.input_yn(
|
||||||
u'Do you want to accept these changes?',
|
u'Do you want to accept these changes?',
|
||||||
|
|||||||
Reference in New Issue
Block a user