jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/615448 )
Change subject: [4.0] remove Python 2 code parts in generate_user_files.py
......................................................................
[4.0] remove Python 2 code parts in generate_user_files.py
Change-Id: I3f74db4dab1bbf03f3929ca9b09971465abdfd1e
---
M generate_user_files.py
1 file changed, 2 insertions(+), 6 deletions(-)
Approvals:
Matěj Suchánek: Looks good to me, approved
jenkins-bot: Verified
diff --git a/generate_user_files.py b/generate_user_files.py
index e9657df..701b670 100755
--- a/generate_user_files.py
+++ b/generate_user_files.py
@@ -6,20 +6,16 @@
#
# Distributed under the terms of the MIT license.
#
-from __future__ import absolute_import, division, unicode_literals
-
import codecs
-from collections import namedtuple
import os
import re
import sys
+from collections import namedtuple
from textwrap import fill
from generate_family_file import _import_with_no_user_config
-if sys.version_info[0] == 2:
- from future_builtins import filter
# DISABLED_SECTIONS cannot be copied; variables must be set manually
DISABLED_SECTIONS = {'USER INTERFACE SETTINGS', # uses sys
@@ -135,7 +131,7 @@
else:
known_langs = []
- if len(known_langs) == 0:
+ if not known_langs:
pywikibot.output('There were no known languages found in {}.'
.format(fam.name))
default_lang = None
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/615448
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I3f74db4dab1bbf03f3929ca9b09971465abdfd1e
Gerrit-Change-Number: 615448
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/615429 )
Change subject: Only run cosmetic changes on wikitext pages
......................................................................
Only run cosmetic changes on wikitext pages
Cosmetic changes have been written for wikitext. Running them on other
types of pages, such as Lua modules or CSS/JS pages, may not be
desirable.
Also simplify the method using dict.get and use parenthesis for
readability.
Change-Id: Ia6f2e6e20504d327cc1475468322e316fe8fd301
---
M pywikibot/page/__init__.py
1 file changed, 7 insertions(+), 9 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index 8d7dea7..ff9812f 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -1309,7 +1309,7 @@
cc=None, quiet=False, **kwargs):
"""Helper function for save()."""
link = self.title(as_link=True)
- if cc or cc is None and config.cosmetic_changes:
+ if cc or (cc is None and config.cosmetic_changes):
summary = self._cosmetic_changes_hook(summary)
done = self.site.editpage(self, summary=summary, minor=minor,
@@ -1330,20 +1330,18 @@
else the old edit summary.
@rtype: str
"""
- if self.isTalkPage() or \
+ if self.isTalkPage() or self.content_model != 'wikitext' or \
pywikibot.calledModuleName() in config.cosmetic_changes_deny_script:
return summary
family = self.site.family.name
if config.cosmetic_changes_mylang_only:
- cc = ((family == config.family
- and self.site.lang == config.mylang)
- or family in config.cosmetic_changes_enable
- and self.site.lang in config.cosmetic_changes_enable[family])
+ cc = ((family == config.family and self.site.lang == config.mylang)
+ or self.site.lang in config.cosmetic_changes_enable.get(
+ family, []))
else:
cc = True
- cc = (cc and not
- (family in config.cosmetic_changes_disable
- and self.site.lang in config.cosmetic_changes_disable[family]))
+ cc = cc and self.site.lang not in config.cosmetic_changes_disable.get(
+ family, [])
if not cc:
return summary
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/615429
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ia6f2e6e20504d327cc1475468322e316fe8fd301
Gerrit-Change-Number: 615429
Gerrit-PatchSet: 4
Gerrit-Owner: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/615190 )
Change subject: Add misspellingCategory for Arabic Wikipedia (arwiki)
......................................................................
Add misspellingCategory for Arabic Wikipedia (arwiki)
Change-Id: I30bf703082af15201f978e2eaa0dbf5d68cce724
---
M scripts/misspelling.py
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/misspelling.py b/scripts/misspelling.py
index 7a7c454..897cf4c 100755
--- a/scripts/misspelling.py
+++ b/scripts/misspelling.py
@@ -56,6 +56,7 @@
# Optional: if there is a category, one can use the -start
# parameter.
misspellingCategory = {
+ 'ar': 'تحويلات أخطاء إملائية',
# da: only contains date redirects at the moment
'da': 'Omdirigeringer af fejlstavninger',
'de': ('Kategorie:Wikipedia:Falschschreibung',
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/615190
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I30bf703082af15201f978e2eaa0dbf5d68cce724
Gerrit-Change-Number: 615190
Gerrit-PatchSet: 2
Gerrit-Owner: Meno25 <meno25mail(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged