jenkins-bot merged this change.

View Change

Approvals: Dvorapa: Looks good to me, but someone else must approve Dalba: Looks good to me, approved jenkins-bot: Verified
[i18n] Use touch edit summary from twn

Also import i18n on top of the file and reorder imports

Bug: T199042
Change-Id: I552d6fc668515a0417910f069f9406480a77e8dc
---
M pywikibot/page.py
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/pywikibot/page.py b/pywikibot/page.py
index 1fbd1c2..6f21abd 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -29,18 +29,17 @@
from warnings import warn

import pywikibot
+from pywikibot import config, i18n, textlib
from pywikibot.comms import http
-from pywikibot import config
+from pywikibot.data.api import APIError
from pywikibot.exceptions import (
AutoblockUser,
NotEmailableError,
SiteDefinitionError,
UserRightsError,
)
-from pywikibot.data.api import APIError
from pywikibot.family import Family
from pywikibot.site import DataSite, Namespace, need_version
-from pywikibot import textlib
from pywikibot.tools import (
compute_file_hash,
UnicodeMixin, ComparableMixin, DotReadableDict,
@@ -49,8 +48,7 @@
ModuleDeprecationWrapper as _ModuleDeprecationWrapper, PY2,
first_upper, redirect_func, remove_last_args,
)
-from pywikibot.tools.ip import ip_regexp
-from pywikibot.tools.ip import is_IP
+from pywikibot.tools.ip import is_IP, ip_regexp

if not PY2:
unicode = basestring = str
@@ -1338,7 +1336,6 @@
self.text = cc_toolkit.change(old)
if summary and old.strip().replace(
'\r\n', '\n') != self.text.strip().replace('\r\n', '\n'):
- from pywikibot import i18n
summary += i18n.twtranslate(self.site, 'cosmetic_changes-append')
return summary

@@ -1425,7 +1422,8 @@
if self.exists():
# ensure always get the page text and not to change it.
del self.text
- self.save(summary='Pywikibot touch edit', watch='nochange',
+ summary = i18n.twtranslate(self.site, 'pywikibot-touch')
+ self.save(summary=summary, watch='nochange',
minor=False, botflag=botflag, force=True,
asynchronous=False, callback=callback,
apply_cosmetic_changes=False, nocreate=True, **kwargs)

To view, visit change 487580. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I552d6fc668515a0417910f069f9406480a77e8dc
Gerrit-Change-Number: 487580
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki@gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot (75)