jenkins-bot has submitted this change and it was merged.
Change subject: [Fix]: Set properly Wikipedia doc_subpages in Family()
......................................................................
[Fix]: Set properly Wikipedia doc_subpages in Family()
Family.doc_subpage for Wikipedia family is now properly set in
Family.__init__().
Bug: T122956
Change-Id: I23e078406f1947b299b562b9a9e9df670a2e2c14
---
M pywikibot/families/wikipedia_family.py
1 file changed, 23 insertions(+), 23 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/families/wikipedia_family.py b/pywikibot/families/wikipedia_family.py
index 23de9d6..fc85045 100644
--- a/pywikibot/families/wikipedia_family.py
+++ b/pywikibot/families/wikipedia_family.py
@@ -363,29 +363,6 @@
'nds', 'co', 'mi', 'mr', 'id', 'lv', 'sw', 'tt', 'uk', 'vo', 'ga',
'na', 'es', 'nl', 'da', 'dk', 'sv', 'test']
- def get_known_families(self, site):
- """Override the family interwiki prefixes for each site."""
- # In Swedish Wikipedia 's:' is part of page title not a family
- # prefix for 'wikisource'.
- if site.code == 'sv':
- d = self.known_families.copy()
- d.pop('s')
- d['src'] = 'wikisource'
- return d
- else:
- return self.known_families
-
- def code2encodings(self, code):
- """Return a list of historical encodings for a specific site."""
- # Historic compatibility
- if code == 'pl':
- return 'utf-8', 'iso8859-2'
- if code == 'ru':
- return 'utf-8', 'iso8859-5'
- if code in self.latin1old:
- return 'utf-8', 'iso-8859-1'
- return self.code2encoding(code),
-
# Subpages for documentation.
# TODO: List is incomplete, to be completed for missing languages.
# TODO: Remove comments for appropriate pages
@@ -414,3 +391,26 @@
'sv': (u'/dok', ),
'uk': (u'/Документація', ),
}
+
+ def get_known_families(self, site):
+ """Override the family interwiki prefixes for each site."""
+ # In Swedish Wikipedia 's:' is part of page title not a family
+ # prefix for 'wikisource'.
+ if site.code == 'sv':
+ d = self.known_families.copy()
+ d.pop('s')
+ d['src'] = 'wikisource'
+ return d
+ else:
+ return self.known_families
+
+ def code2encodings(self, code):
+ """Return a list of historical encodings for a specific site."""
+ # Historic compatibility
+ if code == 'pl':
+ return 'utf-8', 'iso8859-2'
+ if code == 'ru':
+ return 'utf-8', 'iso8859-5'
+ if code in self.latin1old:
+ return 'utf-8', 'iso-8859-1'
+ return self.code2encoding(code)
--
To view, visit https://gerrit.wikimedia.org/r/262724
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I23e078406f1947b299b562b9a9e9df670a2e2c14
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: pagegenerators.py: Allow -random and -randomredirect to work with namespaces
......................................................................
pagegenerators.py: Allow -random and -randomredirect to work with namespaces
Add 'namespaces' argument to the random page generators.
Use -namespaces before -random/-randomredirect while giving args to the
program.
Bug: T119940
Change-Id: I0df00882a6033d2497f5a5e8b48ea0b252c0a463
---
M pywikibot/pagegenerators.py
1 file changed, 27 insertions(+), 12 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index 0d5afdf..46af859 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -134,12 +134,13 @@
-ns:0,2,4
-ns:Help,MediaWiki
- If used with -newpages, -namepace/ns must be provided
- before -newpages.
+ If used with -newpages/-random/-randomredirect,
+ -namespace/ns must be provided before
+ -newpages/-random/-randomredirect.
If used with -recentchanges, efficiency is improved if
- -namepace/ns is provided before -recentchanges.
+ -namespace/ns is provided before -recentchanges.
- If used with -start, -namepace/ns shall contain only one
+ If used with -start, -namespace/ns shall contain only one
value.
-interwiki Work on the given page and all equivalent pages in other
@@ -601,16 +602,29 @@
self.site))
gen = InterwikiPageGenerator(page)
elif arg.startswith('-randomredirect'):
+ # partial workaround for bug T119940
+ # to use -namespace/ns with -randomredirect, -ns must be given
+ # before -randomredirect
+ # otherwise default namespace is 0
+ namespaces = self.namespaces or 0
if len(arg) == 15:
- gen = RandomRedirectPageGenerator(site=self.site)
+ gen = RandomRedirectPageGenerator(site=self.site,
+ namespaces=namespaces)
else:
gen = RandomRedirectPageGenerator(total=int(arg[16:]),
- site=self.site)
+ site=self.site,
+ namespaces=namespaces)
elif arg.startswith('-random'):
+ # partial workaround for bug T119940
+ # to use -namespace/ns with -random, -ns must be given
+ # before -random
+ # otherwise default namespace is 0
+ namespaces = self.namespaces or 0
if len(arg) == 7:
- gen = RandomPageGenerator(site=self.site)
+ gen = RandomPageGenerator(site=self.site, namespaces=namespaces)
else:
- gen = RandomPageGenerator(total=int(arg[8:]), site=self.site)
+ gen = RandomPageGenerator(total=int(arg[8:]), site=self.site,
+ namespaces=namespaces)
elif arg.startswith('-recentchanges'):
if len(arg) >= 15:
total = int(arg[15:])
@@ -2155,7 +2169,7 @@
@deprecated_args(number="total")
-def RandomPageGenerator(total=10, site=None):
+def RandomPageGenerator(total=10, site=None, namespaces=None):
"""
Random page generator.
@@ -2166,12 +2180,12 @@
"""
if site is None:
site = pywikibot.Site()
- for page in site.randompages(total=total):
+ for page in site.randompages(total=total, namespaces=namespaces):
yield page
@deprecated_args(number="total")
-def RandomRedirectPageGenerator(total=10, site=None):
+def RandomRedirectPageGenerator(total=10, site=None, namespaces=None):
"""
Random redirect generator.
@@ -2182,7 +2196,8 @@
"""
if site is None:
site = pywikibot.Site()
- for page in site.randompages(total=total, redirects=True):
+ for page in site.randompages(total=total, namespaces=namespaces,
+ redirects=True):
yield page
--
To view, visit https://gerrit.wikimedia.org/r/262075
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0df00882a6033d2497f5a5e8b48ea0b252c0a463
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Vadiraja.k <vadi.fedx(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Vadiraja.k <vadi.fedx(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: getLanguageLinks should warn if two interwiki links point to the same site
......................................................................
getLanguageLinks should warn if two interwiki links point to the same site
If "result" dictionary has a site as key then warn if it tries to overwrite
that key value.
Bug: T116995
Change-Id: I88cbdc1928d30ff555d4e816205c91ab3a2b46f8
---
M pywikibot/textlib.py
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 0fe92e0..8e73b56 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -785,7 +785,11 @@
if site == insite:
continue
try:
+ previous_key_count = len(result)
result[site] = pywikibot.Page(site, pagetitle)
+ if previous_key_count == len(result):
+ pywikibot.warning('[getLanguageLinks] 2 or more interwiki '
+ 'links point to site %s.' % site)
except pywikibot.InvalidTitle:
pywikibot.output(u'[getLanguageLinks] Text contains invalid '
u'interwiki link [[%s:%s]].'
--
To view, visit https://gerrit.wikimedia.org/r/261210
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I88cbdc1928d30ff555d4e816205c91ab3a2b46f8
Gerrit-PatchSet: 5
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Vadiraja.k <vadi.fedx(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Ricordisamoa <ricordisamoa(a)openmailbox.org>
Gerrit-Reviewer: Vadiraja.k <vadi.fedx(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Expand docstring for pagegenerators.LinkedPageGenerator
......................................................................
Expand docstring for pagegenerators.LinkedPageGenerator
Also added rtype docstring for page.BasePage.linkedPages
Bug: T118423
Change-Id: If575c131b44cb42c7d6d392b55ba35c3cc1398a3
---
M pywikibot/page.py
M pywikibot/pagegenerators.py
2 files changed, 16 insertions(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 34f30b6..62f4023 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -1291,6 +1291,7 @@
@type content: bool
@return: a generator that yields Page objects.
+ @rtype: generator
"""
return self.site.pagelinks(self, namespaces=namespaces, step=step,
total=total, content=content)
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index 0d5afdf..35ce714 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -1218,7 +1218,21 @@
def LinkedPageGenerator(linkingPage, step=None, total=None, content=False):
- """Yield all pages linked from a specific page."""
+ """Yield all pages linked from a specific page.
+
+ See L{pywikibot.page.BasePage.linkedPages} for details.
+
+ @param linkingPage: the page that links to the pages we want
+ @type linkingPage: L{pywikibot.Page}
+ @param step: the limit number of pages to retrieve per API call
+ @type step: int
+ @param total: the total number of pages to iterate
+ @type total: int
+ @param content: if True, retrieve the current content of each linked page
+ @type content: bool
+ @return: a generator that yields Page objects of pages linked to linkingPage
+ @rtype: generator
+ """
return linkingPage.linkedPages(step=step, total=total, content=content)
--
To view, visit https://gerrit.wikimedia.org/r/262667
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If575c131b44cb42c7d6d392b55ba35c3cc1398a3
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Sn1per <geofbot(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Update main copyright year to 2016
......................................................................
Update main copyright year to 2016
Change-Id: I577c931e24c1a3de4c87ee59ef958a5f62f97ce9
---
M LICENSE
M docs/conf.py
2 files changed, 3 insertions(+), 3 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/LICENSE b/LICENSE
index c8f0800..91a8230 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2015 Pywikibot team
+Copyright (c) 2004-2016 Pywikibot team
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
diff --git a/docs/conf.py b/docs/conf.py
index bfe7162..23f0f48 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -47,8 +47,8 @@
master_doc = 'index'
# General information about the project.
-project = u'Pywikibot'
-copyright = u'2015, Pywikibot team'
+project = 'Pywikibot'
+copyright = '2016, Pywikibot team'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
--
To view, visit https://gerrit.wikimedia.org/r/262450
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I577c931e24c1a3de4c87ee59ef958a5f62f97ce9
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [i18n] prepare i18n for using twn further
......................................................................
[i18n] prepare i18n for using twn further
some messages could be ported to twn. But we could use fallback for the given
dicts as first step.
- use wikitext markup inside report method for headlines
- use dict for string formatting
- use fallback for messages which could be merged to twn later
- remove obsolete commons messages; they will fallback to 'en'
- remove unused return value for takesettings method
See also I8163c6985866f2617159e03c433218778d0c334c
Change-Id: I57e7a779a1341a41a8f61dc8f06ca34d17604f05
---
M scripts/checkimages.py
1 file changed, 75 insertions(+), 72 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index b04e6d0..f34a18f 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -82,7 +82,7 @@
# (C) Kyle/Orgullomoore, 2006-2007 (newimage.py)
# (C) Siebrand Mazeland, 2007-2010
# (C) Filnik, 2007-2011
-# (C) Pywikibot team, 2007-2015
+# (C) Pywikibot team, 2007-2016
#
# Distributed under the terms of the MIT license.
#
@@ -192,67 +192,67 @@
# The header of the Unknown extension's message.
delete_immediately_head = {
- 'commons': u"\n== Unknown extension! ==\n",
- 'ar': u"\n== امتداد غير معروف! ==\n",
- 'en': u"\n== Unknown extension! ==\n",
- 'fa': u"\n==بارگذاری تصاویر موجود در انبار==\n",
- 'ga': u"\n== Iarmhír neamhaithnid! ==\n",
- 'fr': u'\n== Extension inconnue ==\n',
- 'hu': u'\n== Ismeretlen kiterjesztésű fájl ==\n',
- 'it': u'\n\n== File non specificato ==\n',
- 'ko': u'\n== 잘못된 파일 형식 ==\n',
- 'ta': u'\n== இனங்காணப்படாத கோப்பு நீட்சி! ==\n',
- 'ur': u"\n== نامعلوم توسیع! ==\n",
- 'zh': u'\n==您上載的檔案格式可能有誤==\n',
+ 'ar': 'امتداد غير معروف!',
+ 'en': 'Unknown extension!',
+ 'fa': 'بارگذاری تصاویر موجود در انبار',
+ 'ga': 'Iarmhír neamhaithnid!',
+ 'fr': 'Extension inconnue',
+ 'hu': 'Ismeretlen kiterjesztésű fájl',
+ 'it': 'File non specificato',
+ 'ko': '잘못된 파일 형식',
+ 'ta': 'இனங்காணப்படாத கோப்பு நீட்சி!',
+ 'ur': 'نامعلوم توسیع!',
+ 'zh': '您上載的檔案格式可能有誤',
}
# Text that will be add if the bot find a unknown extension.
delete_immediately_notification = {
- 'ar': u'الملف [[:File:%s]] يبدو أن امتداده خاطيء, من فضلك تحقق. ~~~~',
- 'commons': u'The [[:File:%s]] file seems to have a wrong extension, please check. ~~~~',
- 'en': u'The [[:File:%s]] file seems to have a wrong extension, please check. ~~~~',
- 'fa': u'به نظر میآید تصویر [[:تصویر:%s]] مسیر نادرستی داشته باشد لطفا بررسی کنید.~~~~',
- 'ga': u'Tá iarmhír mícheart ar an comhad [[:File:%s]], scrúdaigh le d\'thoil. ~~~~',
- 'fr': u'Le fichier [[:File:%s]] semble avoir une mauvaise extension, veuillez vérifier. ~~~~',
- 'hu': u'A [[:Kép:%s]] fájlnak rossz a kiterjesztése, kérlek ellenőrízd. ~~~~',
- 'it': '{{subst:Progetto:Coordinamento/Immagini/Bot/Messaggi/Ext|%s|~~~}} --~~~~',
- 'ko': u'[[:그림:%s]]의 파일 형식이 잘못되었습니다. 확인 바랍니다.--~~~~',
- 'ta': '[[:படிமம்:%s]] இனங்காணப்படாத கோப்பு நீட்சியை கொண்டுள்ளது தயவு செய்து ஒ'
- 'ரு முறை சரி பார்க்கவும் ~~~~',
- 'ur': u'ملف [[:File:%s]] کی توسیع شاید درست نہیں ہے، براہ کرم جانچ لیں۔ ~~~~',
- 'zh': u'您好,你上傳的[[:File:%s]]無法被識別,請檢查您的檔案,謝謝。--~~~~',
+ 'ar': 'الملف %(file)s يبدو أن امتداده خاطيء, من فضلك تحقق.',
+ 'en': 'The %(file)s file seems to have a wrong extension, please check.',
+ 'fa': 'به نظر میآید تصویر %(file)s مسیر نادرستی داشته باشد لطفا بررسی کنید.',
+ 'ga': "Tá iarmhír mícheart ar an comhad %(file)s, scrúdaigh le d'thoil.",
+ 'fr': 'Le fichier %(file)s semble avoir une mauvaise extension, veuillez vérifier.',
+ 'hu': 'A %(file)s fájlnak rossz a kiterjesztése, kérlek ellenőrízd.',
+ 'it': ('A quanto ci risulta, %(file)s sembra non essere un file utile '
+ "all'enciclopedia. Se così non fosse, e' consigliato che tu scriva "
+ "al mio programmatore. Grazie per l'attenzione. "
+ '<u>Questo è un messaggio automatico di</u>'),
+ 'ko': '%(file)s의 파일 형식이 잘못되었습니다. 확인 바랍니다.',
+ 'ta': '%(file)s இனங்காணப்படாத கோப்பு நீட்சியை கொண்டுள்ளது தயவு செய்து ஒ'
+ 'ரு முறை சரி பார்க்கவும்',
+ 'ur': 'ملف %(file)s کی توسیع شاید درست نہیں ہے، براہ کرم جانچ لیں۔',
+ 'zh': '您好,你上傳的%(file)s無法被識別,請檢查您的檔案,謝謝。',
}
# Summary of the delete immediately.
# (e.g: Adding {{db-meta|The file has .%s as extension.}})
msg_del_comm = {
- 'ar': u'بوت: إضافة %s',
- 'commons': u'Bot: Adding %s',
- 'en': u'Bot: Adding %s',
- 'fa': u'ربات: اضافه کردن %s',
- 'ga': u'Róbó: Cuir %s leis',
- 'fr': u'Robot : Ajouté %s',
- 'hu': u'Robot:"%s" hozzáadása',
- 'it': u'Bot: Aggiungo %s',
- 'ja': u'ロボットによる: 追加 %s',
- 'ko': u'로봇 : %s 추가',
- 'ta': u'Bot: Adding %s',
- 'ur': u'روبالہ: اضافہ %s',
- 'zh': u'機器人: 正在新增 %s',
+ 'ar': 'بوت: إضافة %(adding)s',
+ 'en': 'Bot: Adding %(adding)s',
+ 'fa': 'ربات: اضافه کردن %(adding)s',
+ 'ga': 'Róbó: Cuir %(adding)s leis',
+ 'fr': 'Robot : Ajouté %(adding)s',
+ 'hu': 'Robot:"%(adding)s" hozzáadása',
+ 'it': 'Bot: Aggiungo %(adding)s',
+ 'ja': 'ロボットによる: 追加 %(adding)s',
+ 'ko': '로봇 : %(adding)s 추가',
+ 'ta': 'Bot: Adding %(adding)s',
+ 'ur': 'روبالہ: اضافہ %(adding)s',
+ 'zh': '機器人: 正在新增 %(adding)s',
}
# This is the most important header, because it will be used a lot. That's the
# header that the bot will add if the image hasn't the license.
nothing_head = {
- 'ar': u"\n== صورة بدون ترخيص ==\n",
- 'de': u"\n== Bild ohne Lizenz ==\n",
- 'en': u"\n== Image without license ==\n",
- 'fa': u"\n== تصویر بدون اجازہ ==\n",
- 'ga': u"\n== Comhad gan ceadúnas ==\n",
- 'fr': u"\n== Fichier sans licence ==\n",
- 'hu': u"\n== Licenc nélküli kép ==\n",
- 'it': u"\n\n== File senza licenza ==\n",
- 'ur': u"\n== تصویر بدون اجازہ ==\n",
+ 'ar': 'صورة بدون ترخيص',
+ 'de': 'Bild ohne Lizenz',
+ 'en': 'Image without license',
+ 'fa': 'تصویر بدون اجازہ',
+ 'ga': 'Comhad gan ceadúnas',
+ 'fr': 'Fichier sans licence',
+ 'hu': 'Licenc nélküli kép',
+ 'it': 'File senza licenza',
+ 'ur': 'تصویر بدون اجازہ',
}
# That's the text that the bot will add if it doesn't find the license.
# Note: every __botnick__ will be repleaced with your bot's nickname
@@ -337,7 +337,6 @@
# The summary of the report
msg_comm10 = {
- 'commons': u'Bot: Updating the log',
'ar': u'بوت: تحديث السجل',
'de': u'Bot: schreibe Log',
'en': u'Bot: Updating the log',
@@ -365,7 +364,6 @@
HiddenTemplate = {
# Put the other in the page on the project defined below
'commons': [u'Template:Information'],
-
'ar': [u'Template:معلومات'],
'de': [u'Template:Information'],
'en': [u'Template:Information'],
@@ -373,11 +371,9 @@
'fr': [u'Template:Information'],
'ga': [u'Template:Information'],
'hu': [u'Template:Információ', u'Template:Enwiki', u'Template:Azonnali'],
- # Put the other in the page on the project defined below
'it': [u'Template:EDP', u'Template:Informazioni file',
u'Template:Information', u'Template:Trademark',
u'Template:Permissionotrs'],
-
'ja': [u'Template:Information'],
'ko': [u'Template:그림 정보'],
'ta': [u'Template:Information'],
@@ -429,7 +425,9 @@
# Head of the message given to the author
duplicate_user_talk_head = {
- 'it': u'\n\n== File doppio ==\n',
+ 'de': 'Datei-Duplikat',
+ 'en': 'Duplicate file',
+ 'it': 'File doppio',
}
# Message to put in the talk
@@ -440,16 +438,16 @@
# Comment used by the bot while it reports the problem in the uploader's talk
duplicates_comment_talk = {
- 'commons': u'Bot: Dupe file found',
'ar': u'بوت: ملف مكرر تم العثور عليه',
+ 'en': 'Bot: Notify that the file already exists on Commons',
'fa': u'ربات: تصویر تکراری یافت شد',
'it': u"Bot: Notifico il file doppio trovato",
}
# Comment used by the bot while it reports the problem in the image
duplicates_comment_image = {
- 'commons': u'Bot: Tagging dupe file',
'de': u'Bot: Datei liegt auf Commons',
+ 'en': 'Bot: File already on Commons, may be deleted',
'ar': u'بوت: وسم ملف مكرر',
'fa': u'ربات: برچسب زدن بر تصویر تکراری',
'it': u'Bot: File doppio, da cancellare',
@@ -554,7 +552,7 @@
self.rep_page = i18n.translate(self.site, report_page)
self.rep_text = '\n* [[:{0}:%s]] ~~~~~'.format(
self.site.namespaces.FILE.custom_name)
- self.com = i18n.translate(self.site, msg_comm10)
+ self.com = i18n.translate(self.site, msg_comm10, fallback=True)
hiddentemplatesRaw = i18n.translate(self.site, HiddenTemplate)
self.hiddentemplates = set(
[pywikibot.Page(self.site, tmp, ns=self.site.namespaces.TEMPLATE)
@@ -764,7 +762,8 @@
if second_text:
newText = u"%s\n\n%s" % (testoattuale, self.notification2)
else:
- newText = testoattuale + self.head + self.notification
+ newText = '{0}\n\n== {1} ==\n{2}'.format(testoattuale, self.head,
+ self.notification)
try:
self.talk_page.put(newText, summary=commentox, minorEdit=False)
@@ -909,10 +908,13 @@
"""Function to check the duplicated files."""
dupText = i18n.translate(self.site, duplicatesText)
dupRegex = i18n.translate(self.site, duplicatesRegex)
- dupTalkHead = i18n.translate(self.site, duplicate_user_talk_head)
+ dupTalkHead = i18n.translate(self.site, duplicate_user_talk_head,
+ fallback=True)
dupTalkText = i18n.translate(self.site, duplicates_user_talk_text)
- dupComment_talk = i18n.translate(self.site, duplicates_comment_talk)
- dupComment_image = i18n.translate(self.site, duplicates_comment_image)
+ dupComment_talk = i18n.translate(self.site, duplicates_comment_talk,
+ fallback=True)
+ dupComment_image = i18n.translate(self.site, duplicates_comment_image,
+ fallback=True)
imagePage = pywikibot.FilePage(self.site, self.imageName)
hash_found = imagePage.latest_file_info.sha1
duplicates = list(self.site.allimages(sha1=hash_found))
@@ -1157,7 +1159,6 @@
pywikibot.output(u'>> Loaded the real-time page... <<')
else:
pywikibot.output(u'>> No additional settings found! <<')
- return self.settingsData # Useless, but it doesn't harm..
def load_licenses(self):
"""Load the list of the licenses."""
@@ -1314,7 +1315,7 @@
reported = self.report_image(self.imageName)
if reported:
self.report(self.mex_used, self.imageName, self.text_used,
- u"\n%s\n" % self.head_used, None,
+ self.head_used, None,
self.imagestatus_used, self.summary_used)
else:
pywikibot.output(u"Skipping the file...")
@@ -1437,6 +1438,8 @@
break
summary = tupla[5]
head_2 = tupla[6]
+ if head_2.count('==') == 2:
+ head_2 = re.findall('\s*== *(.+?) *==\s*', head_2)[0]
text = tupla[7] % self.imageName
mexCatched = tupla[8]
for k in find_list:
@@ -1494,9 +1497,10 @@
HiddenTN = i18n.translate(self.site, HiddenTemplateNotification)
self.unvertext = i18n.translate(self.site, n_txt)
di = i18n.translate(self.site, delete_immediately)
- dih = i18n.translate(self.site, delete_immediately_head)
- din = i18n.translate(self.site, delete_immediately_notification)
- nh = i18n.translate(self.site, nothing_head)
+ dih = i18n.translate(self.site, delete_immediately_head, fallback=True)
+ din = i18n.translate(self.site, delete_immediately_notification,
+ fallback=True) + ' ~~~~'
+ nh = i18n.translate(self.site, nothing_head, fallback=True)
nn = i18n.translate(self.site, nothing_notification)
dels = i18n.translate(self.site, msg_del_comm, fallback=True)
smwl = i18n.translate(self.site, second_message_without_license)
@@ -1536,19 +1540,18 @@
return True
elif delete:
pywikibot.output(u"%s is not a file!" % self.imageName)
- if not (di and din and dih):
- pywikibot.output(
- "No localized message given for 'delete_immediately' or "
- "'delete_immediately_notification' or "
- "'delete_immediately_head'. Skipping.")
+ if not di:
+ pywikibot.output('No localized message given for '
+ "'delete_immediately'. Skipping.")
return
# Some formatting for delete immediately template
- dels = dels % di
+ dels = dels % {'adding': di}
di = '\n' + di
# Modify summary text
pywikibot.setAction(dels)
canctext = di % extension
- notification = din % self.imageName
+ notification = din % {'file': self.image.title(asLink=True,
+ textlink=True)}
head = dih
self.report(canctext, self.imageName, notification, head)
return True
--
To view, visit https://gerrit.wikimedia.org/r/261360
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I57e7a779a1341a41a8f61dc8f06ca34d17604f05
Gerrit-PatchSet: 6
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Added "Site" to the __all__ variable
......................................................................
Added "Site" to the __all__ variable
Site did not appear in the generated documentation when we used help
(pywikibot). Some IDEs that have intellisense feature depend on the function
to be available in the __all__ variable for suggesting code completion.
Using "from pywikibot import *" did not import Site.
Bug: T122563
Change-Id: I4a1c92a380a443d8a3bd99dc65b9e9f192e43d42
---
M pywikibot/__init__.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 343f1bb..114c204 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -91,7 +91,7 @@
)
__all__ = (
- 'config', 'ui', 'UnicodeMixin', 'translate',
+ 'config', 'ui', 'Site', 'UnicodeMixin', 'translate',
'Page', 'FilePage', 'Category', 'Link', 'User',
'ItemPage', 'PropertyPage', 'Claim',
'html2unicode', 'url2unicode', 'unicode2html',
--
To view, visit https://gerrit.wikimedia.org/r/262425
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4a1c92a380a443d8a3bd99dc65b9e9f192e43d42
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Ani310 <anirudh.gp(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>