http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11569
Revision: 11569
Author: siebrand
Date: 2013-05-20 11:57:43 +0000 (Mon, 20 May 2013)
Log Message:
-----------
Localisation updates from http://translatewiki.net.
Modified Paths:
--------------
branches/rewrite/scripts/i18n/pywikibot.py
branches/rewrite/scripts/i18n/redirect.py
branches/rewrite/scripts/i18n/weblinkchecker.py
Modified: branches/rewrite/scripts/i18n/pywikibot.py
===================================================================
--- branches/rewrite/scripts/i18n/pywikibot.py 2013-05-20 11:30:52 UTC (rev 11568)
+++ branches/rewrite/scripts/i18n/pywikibot.py 2013-05-20 11:57:43 UTC (rev 11569)
@@ -285,7 +285,7 @@
'he': {
'pywikibot-enter-xml-filename': u'נא להזין את שם קובץ ה־XML עם הדאמפ:',
'pywikibot-enter-page-processing': u'איזה דף יש לעבד?',
- 'pywikibot-enter-file-links-processing': u'קישורים לאיזה דף תמונה יש לעבד?',
+ 'pywikibot-enter-file-links-processing': u'קישורים לאיזה דף קובץ יש לעבד?',
'pywikibot-enter-namespace-number': u'נא להזין את שם מרחב השם לפי המספר שלו:',
'pywikibot-enter-new-text': u'נא להזין את הטקסט החדש:',
'pywikibot-enter-category-name': u'נא להזין את שם הקטגוריה:',
@@ -293,10 +293,11 @@
},
# Author: Dj
# Author: R-Joe
+ # Author: Tacsipacsi
'hu': {
'pywikibot-enter-xml-filename': u'Add meg az XML dump fájl nevét:',
'pywikibot-enter-page-processing': u'Melyik lapot kell feldolgozni?',
- 'pywikibot-enter-file-links-processing': u'Melyik képre mutató hivatkozásokat kell feldolgozni?',
+ 'pywikibot-enter-file-links-processing': u'Melyik fájlra mutató hivatkozásokat kell feldolgozni?',
'pywikibot-enter-namespace-number': u'Add meg a névteret a számával:',
'pywikibot-enter-new-text': u'Add meg az új szöveget:',
'pywikibot-enter-category-name': u'Add meg a kategória nevet:',
@@ -335,7 +336,7 @@
'ja': {
'pywikibot-enter-xml-filename': u'XML ダンプのファイル名を入力:',
'pywikibot-enter-page-processing': u'どのページを処理しますか?',
- 'pywikibot-enter-file-links-processing': u'どの画像ページヘのリンクを処理しますか?',
+ 'pywikibot-enter-file-links-processing': u'どのファイルページヘのリンクを処理しますか?',
'pywikibot-enter-namespace-number': u'名前空間の番号を入力:',
'pywikibot-enter-new-text': u'新しいテキストを入力:',
'pywikibot-enter-category-name': u'カテゴリ名を入力:',
@@ -665,10 +666,11 @@
'pywikibot-enter-finished-browser': u'请在浏览器作业完成后按下Enter键。',
},
# Author: Justincheng12345
+ # Author: Simon Shek
'zh-hant': {
'pywikibot-enter-xml-filename': u'請輸入XML Dump的檔案名稱:',
'pywikibot-enter-page-processing': u'甚麼頁面需要處理?',
- 'pywikibot-enter-file-links-processing': u'甚麼圖像的連接需要處理?',
+ 'pywikibot-enter-file-links-processing': u'甚麼檔案的連接需要處理?',
'pywikibot-enter-namespace-number': u'請輸入名字空間編號:',
'pywikibot-enter-new-text': u'請輸入新文字:',
'pywikibot-enter-category-name': u'請輸入分類名稱:',
Modified: branches/rewrite/scripts/i18n/redirect.py
===================================================================
--- branches/rewrite/scripts/i18n/redirect.py 2013-05-20 11:30:52 UTC (rev 11568)
+++ branches/rewrite/scripts/i18n/redirect.py 2013-05-20 11:57:43 UTC (rev 11569)
@@ -11,12 +11,13 @@
},
# Author: Csisc
# Author: Lloffiwr
+ # Author: Nemo bis
# Author: Xqt
# Author: ZxxZxxZ
'qqq': {
'redirect-fix-double': u'Edit summary when the bot fixes double redirects. <code>%(to)s</code> displays the new redirect target as a wiki link.',
- 'redirect-remove-broken': u'Edit summary when the bot tags a deleted or non-existent page for speedy deletion. The message was designed for use on en:Wikipedia. The internal links are to pages on the English Wikipedia, [http://en.wikipedia.org/wiki/Wikipedia:CSD#G8 here] and [http://en.wikipedia.org/wiki/Wikipedia:Redirect here]. They won\'t work anywhere except on the English Wikipedia, as they stand.',
- 'redirect-fix-broken-moved': u'Edit summary when the bot fixes a broken redirect to a moved page whose origin has been deleted. <code>%(to)s</code> displays the new redirect target as a wiki link.',
+ 'redirect-remove-broken': u'Edit summary when the bot tags a deleted or non-existent page for speedy deletion. The message was designed for use on en.wikipedia. The internal links are to pages on the English Wikipedia, [http://en.wikipedia.org/wiki/Wikipedia:CSD#G8 here] and [http://en.wikipedia.org/wiki/Wikipedia:Redirect here]. They won\'t work anywhere except on the English Wikipedia, as they stand.',
+ 'redirect-fix-broken-moved': u'Edit summary when the bot fixes a broken redirect to a moved page whose origin has been deleted.\nParameters:\n* <code>%(to)s</code>: the new redirect target, as a wiki link.',
'redirect-fix-loop': u'Edit summary when the bot fixes redirect loops. <code>%(to)s</code> displays the new redirect target as a wiki link.',
'redirect-remove-loop': u'Edit summary when the bot tags a redirect loop for speedy deletion. The internal links are to pages on the English Wikipedia, [http://en.wikipedia.org/wiki/Wikipedia:CSD#G8 here] and [http://en.wikipedia.org/wiki/Wikipedia:Redirect here]. They won\'t work anywhere except on the English Wikipedia, as they stand.',
'redirect-broken-redirect-template': u'Template for speedy deletion of broken redirect or redirect loops which the bot tags onto the redirect page. This message may contain additional informations like template parameters or reasons for the deletion request.\n\nNOTE: If this system message is not given for a language code, speedy deletion request by a bot is not supported on your site except there is a bot with sysop flag.\n\n{{doc-important|Only use your deletion template like <code><nowiki>{{delete}}</nowiki></code> which exist on your local project.}}',
@@ -240,9 +241,11 @@
'redirect-broken-redirect-template': u'{{Löschen|Defekte Weiterleitung}}',
},
# Author: Erdemaslancan
+ # Author: Gorizon
'diq': {
'redirect-fix-double': u'Boti Tespitê hetanayışê dıleti heta %(to)s',
'redirect-remove-broken': u'[[WP:CSD#G8|G8]]: [[Wikipedia:Redirect|Hetenayış]]: pela besternê yana pelaya cı nêasena',
+ 'redirect-fix-broken-moved': u'Bot: Hetenayışe xırabi hedefe pela %(to)s vurneno',
'redirect-fix-loop': u'Boti %(to)s rê hetanayışo dılet deke',
'redirect-remove-loop': u'[[WP:CSD#G8|G8]]: [[Wikipedia:Redirect|Hetenayış]] re formê etiketi vıraşt.',
'redirect-broken-redirect-template': u'{{bestere|m1}}',
@@ -690,6 +693,10 @@
'redirect-remove-loop': u'Robot: Målet for omdirigeringen danner en omdirigeringsløkke',
'redirect-broken-redirect-template': u'{{hurtigslett|Feilaktig omdirigering}}',
},
+ # Author: Xqt
+ 'nv': {
+ 'redirect-fix-double': u'Bot: dah astsihígíí łahgo áyiilaa -> %(to)s',
+ },
# Author: Geitost
# Author: Xqt
'pdc': {
@@ -701,12 +708,13 @@
'redirect-fix-double': u'Bot: E doppelte Waiterlaitung vabessat zu %(to)s',
},
# Author: BeginaFelicysym
+ # Author: Nemo bis
# Author: Sp5uhe
# Author: Ty221
'pl': {
'redirect-fix-double': u'Robot naprawił podwójne przekierowanie do %(to)s',
'redirect-remove-broken': u'Robot: przekierowanie do usuniętej lub nieistniejącej strony',
- 'redirect-fix-broken-moved': u'Bot: Poprawa urwanych przekierowań - przeniesiono cel do %(to)',
+ 'redirect-fix-broken-moved': u'Bot: Poprawa urwanych przekierowań - przeniesiono cel do %(to)s',
'redirect-fix-loop': u'Robot: Naprawa pętli przekierowań do %(to)s',
'redirect-remove-loop': u'Robot: pętla przekierowań',
'redirect-broken-redirect-template': u'{{ek|przekierowanie do usuniętej lub nieistniejącej stron}}',
@@ -929,8 +937,9 @@
'redirect-fix-double': u'روبالہ: درستگی دوہرا رجوع مکرر بجانب %(to)s',
},
# Author: CoderSI
+ # Author: Xqt
'uz': {
- 'redirect-broken-redirect-template': u'{{db-r1}}',
+ 'redirect-broken-redirect-template': u'!!!Fuzzy{{db-r1}}',
},
# Author: Alunardon90
# Author: Candalua
Modified: branches/rewrite/scripts/i18n/weblinkchecker.py
===================================================================
--- branches/rewrite/scripts/i18n/weblinkchecker.py 2013-05-20 11:30:52 UTC (rev 11568)
+++ branches/rewrite/scripts/i18n/weblinkchecker.py 2013-05-20 11:57:43 UTC (rev 11569)
@@ -89,7 +89,9 @@
# Author: Gorizon
# Author: Mirzali
'diq': {
+ 'weblinkchecker-archive_msg': u'Pela webi arşiw da interneti de nımneya ya. Hewl wersiyone arşiwi re diqqet bıkeri [%(URL)s].',
'weblinkchecker-caption': u'Gıreyo merde',
+ 'weblinkchecker-summary': u'Bot: Teber gre de rapera xeberkerdış',
},
# Author: Airon90
'eo': {
@@ -249,7 +251,7 @@
# Author: Rezonansowy
# Author: Ty221
'pl': {
- 'weblinkchecker-archive_msg': u'%(URL)s',
+ 'weblinkchecker-archive_msg': u'Ta strona została zapisana przez Archiwum Internetowe. Proszę sprawdzić czy jakieś strony nie linkują do tej zarchiwizowanej wersji : %(URL)s',
'weblinkchecker-caption': u'Niedziałający link',
'weblinkchecker-summary': u'Robot zgłasza niedostępny link zewnętrzny',
'weblinkchecker-report': u'W ciągu kilku automatycznych kontroli następujący link zewnętrzny był niedostępny. Proszę, sprawdź linki naprawdę "martwe" i w takim przypadku należy skorygować lub usunąć go!',
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11566
Revision: 11566
Author: xqt
Date: 2013-05-20 08:37:04 +0000 (Mon, 20 May 2013)
Log Message:
-----------
docstrings from rewrite, some minor changes
Modified Paths:
--------------
trunk/pywikipedia/pagegenerators.py
Modified: trunk/pywikipedia/pagegenerators.py
===================================================================
--- trunk/pywikipedia/pagegenerators.py 2013-05-20 07:42:02 UTC (rev 11565)
+++ trunk/pywikipedia/pagegenerators.py 2013-05-20 08:37:04 UTC (rev 11566)
@@ -14,7 +14,7 @@
¶ms;
"""
#
-# (C) Pywikipedia bot team, 2005-2010
+# (C) Pywikipedia bot team, 2005-2013
#
# Distributed under the terms of the MIT license.
#
@@ -661,8 +661,8 @@
"""Iterate pages from a list in a text file.
The file must contain page links between double-square-brackets or, in
- alternative, separated by newlines, and return them as a list of Page
- objects. The generator will yield each corresponding Page object.
+ alternative, separated by newlines. The generator will yield each
+ corresponding Page object.
@param filename: the name of the file that should be read. If no name is
given, the generator prompts the user.
@@ -677,8 +677,8 @@
R = re.compile(ur'\[\[(.+?)(?:\]\]|\|)') # title ends either before | or before ]]
pageTitle = None
for pageTitle in R.findall(f.read()):
- # If the link doesn't refer to this site, the Page constructor
- # will automatically choose the correct site.
+ # If the link is in interwiki format, the Page object may reside
+ # on a different Site than the default.
# This makes it possible to work on different wikis using a single
# text file, but also could be dangerous because you might
# inadvertently change pages on another wiki!
@@ -1268,19 +1268,19 @@
def main(*args):
try:
genFactory = GeneratorFactory()
- for arg in pywikibot.handleArgs():
+ for arg in pywikibot.handleArgs(*args):
if not genFactory.handleArg(arg):
- pywikibot.showHelp('pagegenerators')
+ pywikibot.showHelp()
break
else:
gen = genFactory.getCombinedGenerator()
if gen:
i = 0
for page in gen:
- i+=1
+ i += 1
pywikibot.output("%4d: %s" % (i, page.title()), toStdout = True)
else:
- pywikibot.showHelp('pagegenerators')
+ pywikibot.showHelp()
finally:
pywikibot.stopme()
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11565
Revision: 11565
Author: xqt
Date: 2013-05-20 07:42:02 +0000 (Mon, 20 May 2013)
Log Message:
-----------
- fix for bug #3613589
- update from trunk: yield page links separated by newlines
Modified Paths:
--------------
branches/rewrite/pywikibot/pagegenerators.py
Modified: branches/rewrite/pywikibot/pagegenerators.py
===================================================================
--- branches/rewrite/pywikibot/pagegenerators.py 2013-05-19 23:53:02 UTC (rev 11564)
+++ branches/rewrite/pywikibot/pagegenerators.py 2013-05-20 07:42:02 UTC (rev 11565)
@@ -643,8 +643,9 @@
def TextfilePageGenerator(filename=None, site=None):
"""Iterate pages from a list in a text file.
- The file must contain page links between double-square-brackets. The
- generator will yield each corresponding Page object.
+ The file must contain page links between double-square-brackets or, in
+ alternative, separated by newlines. The generator will yield each
+ corresponding Page object.
@param filename: the name of the file that should be read. If no name is
given, the generator prompts the user.
@@ -656,13 +657,22 @@
if site is None:
site = pywikibot.Site()
f = codecs.open(filename, 'r', config.textfile_encoding)
+ linkmatch = None
for linkmatch in pywikibot.link_regex.finditer(f.read()):
# If the link is in interwiki format, the Page object may reside
# on a different Site than the default.
# This makes it possible to work on different wikis using a single
# text file, but also could be dangerous because you might
# inadvertently change pages on another wiki!
- yield pywikibot.Page(pywikibot.Link(linkmatch.groups("title"), site))
+ yield pywikibot.Page(pywikibot.Link(linkmatch.group("title"), site))
+ if linkmatch is None:
+ f.seek(0)
+ for title in f:
+ title = title.strip()
+ if '|' in title:
+ title = title[:title.index('|')]
+ if title:
+ yield pywikibot.Page(site, title)
f.close()