lists.wikimedia.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
List overview
Download
Pywikipedia-svn
July 2013
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
pywikipedia-svn@lists.wikimedia.org
5 participants
77 discussions
Start a n
N
ew thread
SVN: [11731] trunk/pywikipedia/externals/__init__.py
by drtrigon@svn.wikimedia.org
08 Jul '13
08 Jul '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11731
Revision: 11731 Author: drtrigon Date: 2013-07-08 17:42:58 +0000 (Mon, 08 Jul 2013) Log Message: ----------- bug fix; ask user for permission BEFORE downloading and installing external code Modified Paths: -------------- trunk/pywikipedia/externals/__init__.py Modified: trunk/pywikipedia/externals/__init__.py =================================================================== --- trunk/pywikipedia/externals/__init__.py 2013-07-08 16:52:06 UTC (rev 11730) +++ trunk/pywikipedia/externals/__init__.py 2013-07-08 17:42:58 UTC (rev 11731) @@ -33,7 +33,7 @@ modules_needed = { 'patch.exe': ({}, # for win32 only, unix/linux is already equipped with a patch tool { 'url': '
http://downloads.sourceforge.net/project/gnuwin32/patch/2.5.9-7/patch-2.5.9…
', - 'path': 'bin/patch.exe'}), # OK + 'path': 'bin/patch.exe'}), # OK 'crontab': ({}, #{ 'url': '
https://github.com/josiahcarlson/parse-crontab/archive/master.zip
', # 'path': 'parse-crontab-master/crontab',}), # OK @@ -96,7 +96,7 @@ '_ocropus': ({}, {}, { 'url': '
https://code.google.com/p/ocropus
', - 'rev': 'ocropus-0.6'}), # OK + 'rev': 'ocropus-0.6'}), # OK # TODO: vvv (further clean-up and unlink - check with 'svn list') # 'opencv': $ svn propedit svn:externals externals/. # opencv
https://svn.toolserver.org/svnroot/drtrigon/externals/opencv
@@ -288,7 +288,7 @@ def download_install(package, module, path): - if package: + if package and show_question(module): lowlevel_warning(u'Download package "%s" from %s' % (module, package['url'])) import mimetypes @@ -311,7 +311,7 @@ % (module, os.path.join(path, module))) if len(mime) > 1: import StringIO - if mime[1] == 'zip' or mime[1] == 'x-zip-compressed': + if mime[1] in ['zip', 'x-zip-compressed']: import zipfile arch = zipfile.ZipFile(StringIO.StringIO(response.read())) elif mime[1] == 'x-tar': @@ -347,7 +347,7 @@ def mercurial_repo_install(package, module, path): - if package: + if package and show_question(module): cmd = 'hg clone' lowlevel_warning(u'Mercurial clone "%s" from %s' % (module, package['url'])) @@ -373,10 +373,11 @@ return if download_install(modules_needed[m][1], m, path): return - if mercurial_repo_install(modules_needed[m][2], m, path): + if (len(modules_needed[m]) > 2) and\ + mercurial_repo_install(modules_needed[m][2], m, path): return - pywikibot.error(u'Package "%s" could not be found nor installed!' % m) + lowlevel_warning(u'Package "%s" could not be found nor installed!' % m) def check_setup_all():
1
0
0
0
SVN: [11730] branches/rewrite/pywikibot/page.py
by legoktm@svn.wikimedia.org
08 Jul '13
08 Jul '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11730
Revision: 11730 Author: legoktm Date: 2013-07-08 16:52:06 +0000 (Mon, 08 Jul 2013) Log Message: ----------- Restructure qualifiers to be stored in a dictionary, like claims are stored in ItemPage. Modified Paths: -------------- branches/rewrite/pywikibot/page.py Modified: branches/rewrite/pywikibot/page.py =================================================================== --- branches/rewrite/pywikibot/page.py 2013-07-08 09:12:38 UTC (rev 11729) +++ branches/rewrite/pywikibot/page.py 2013-07-08 16:52:06 UTC (rev 11730) @@ -2641,7 +2641,7 @@ if self.isQualifier and self.isReference: raise ValueError(u'Claim cannot be both a qualifier and reference.') self.sources = [] - self.qualifiers = [] + self.qualifiers = {} self.target = None self.snaktype = 'value' self.on_item = None # The item it's on @@ -2679,7 +2679,11 @@ if 'qualifiers' in data: for prop in data['qualifiers']: for qualifier in data['qualifiers'][prop]: - claim.qualifiers.append(Claim.qualifierFromJSON(site, qualifier)) + qual = Claim.qualifierFromJSON(site, qualifier) + if prop in claim.qualifiers: + claim.qualifiers[prop].append(qual) + else: + claim.qualifiers[prop] = [qual] return claim @staticmethod
1
0
0
0
SVN: [11729] branches/rewrite/scripts/featured.py
by xqt@svn.wikimedia.org
08 Jul '13
08 Jul '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11729
Revision: 11729 Author: xqt Date: 2013-07-08 09:12:38 +0000 (Mon, 08 Jul 2013) Log Message: ----------- first step using wikidata fpr featured.py Modified Paths: -------------- branches/rewrite/scripts/featured.py Modified: branches/rewrite/scripts/featured.py =================================================================== --- branches/rewrite/scripts/featured.py 2013-07-08 07:57:51 UTC (rev 11728) +++ branches/rewrite/scripts/featured.py 2013-07-08 09:12:38 UTC (rev 11729) @@ -75,6 +75,15 @@ return [page for page in p.getReferences(follow_redirects=False, onlyTemplateInclusion=True)] +def DATA(site, name, hide): + dp = pywikibot.ItemPage(site.data_repository(), name) + cat = pywikibot.Category(site, dp.getSitelink(site)) + for article in cat.articles(endsort=hide): + yield article + if hide: + for article in cat.articles(startFrom=unichr(ord(hide) + 1)): + yield article + # ALL wikis use 'Link FA', and sometimes other localized templates. # We use _default AND the localized ones template = { @@ -130,115 +139,7 @@ } featured_name = { - 'af': (BACK, u"Voorbladster"), - 'als': (CAT, u"Wikipedia:Bsunders glungener Artikel"), - 'am': (CAT, u"Wikipedia:Featured article"), - 'an': (CAT, u"Articlos destacatos"), - 'ang': (CAT, u"Fulgōd ȝeƿritu"), - 'ar': (CAT, u"مقالات مختارة"), - 'ast': (CAT, u"Uiquipedia:Artículos destacaos"), - 'az': (BACK, u"Seçilmiş məqalə"), - 'bar': (CAT, u"Berig"), - 'bat-smg': (CAT, u"Vikipedėjės pavīzdėnē straipsnē"), - 'be-x-old': (CAT, u"Вікіпэдыя:Абраныя артыкулы"), - 'bg': (CAT, u"Избрани статии"), - 'bn': (BACK, u"নির্বাচিত নিবন্ধ"), - 'br': (CAT, u"Pennadoù eus an dibab"), - 'bs': (CAT, u"Odabrani članci"), - 'ca': (CAT, u"Llista d'articles de qualitat"), - 'ceb': (CAT, u"Mga napiling artikulo"), - 'cs': (CAT, u"Wikipedie:Nejlepší články"), - 'cy': (BACK, u"Erthygl ddethol"), - 'da': (CAT, u"Fremragende artikler"), - 'de': (CAT, u"Wikipedia:Exzellent"), - 'dv': (BACK, u"Featured article"), - 'el': (BACK, u"Αξιόλογο άρθρο"), - 'en': (CAT, u"Featured articles"), - 'eo': (CAT, u"Elstaraj artikoloj"), - 'es': (BACK, u"Artículo destacado"), - 'et': (CAT, u"Eeskujulikud artiklid"), - 'eu': (CAT, u"Nabarmendutako artikuluak"), - 'ext': (BACK, u"Destacau"), - 'fa': (BACK, u"مقاله برگزیده"), - 'fi': (CAT, u"Suositellut sivut"), - 'fo': (CAT, u"Mánaðargrein"), - 'fr': (CAT, u"Article de qualité"), - 'frr': (BACK, u"Exzellent"), - 'gl': (CAT, u"Wikipedia:Artigos de calidade"), - 'gv': (CAT, u"Artyn reiht"), - 'he': (CAT, u"ערכים מומלצים"), - 'hi': (BACK, u"निर्वाचित लेख"), - 'hr': (CAT, u"Izabrani članci"), - 'hsb': (CAT, u"Ekscelentny"), - 'hu': (CAT, u"Kiemelt cikkek"), - 'hy': (BACK, u"Ընտրված հոդված"), - 'ia': (CAT, u"Wikipedia:Articulos eminente"), - 'id': (BACK, u"Featured article"), - 'is': (CAT, u"Wikipedia:Úrvalsgreinar"), - 'it': (CAT, u"Voci in vetrina"), - 'ja': (BACK, u"Featured article"), - 'ka': (CAT, u"რჩეული სტატიები"), - 'kk': (CAT, u"Уикипедия:Таңдаулы мақалалар"), - 'kl': (CAT, u"Anbefalet"), - 'km': (BACK, u"អត្ថបទពិសេស"), - 'kn': (BACK, u"ವಿಶೇಷ ಲೇಖನ"), - 'ko': (CAT, u"알찬 글"), - 'krc': (CAT, u"Википедия:Сайланнган статьяла"), - 'kv': (CAT, u"Википедия:Бур гижӧдъяс"), - 'la': (CAT, u"Paginae mensis"), - 'lad': (CAT, u"Artikolos valutosos"), - 'li': (CAT, u"Wikipedia:Sjterartikele"), - 'lmo': (CAT, u"Articol ben faa"), - 'lo': (CAT, u"ບົດຄວາມດີເດັ່ນ"), - 'lt': (CAT, u"Vikipedijos pavyzdiniai straipsniai"), - 'lv': (CAT, u"Vērtīgi raksti"), - 'mk': (BACK, u"Избрана"), - 'ml': (BACK, u"Featured"), - 'mt': (CAT, u"Artikli fil-vetrina"), - 'mr': (CAT, u"मुखपृष्ठ सदर लेख"), - 'ms': (BACK, u"Rencana pilihan"), - 'nah': (BACK, u"Featured article"), - 'nds-nl': (BACK, u"Etelazie"), - 'nl': (CAT, u"Wikipedia:Etalage-artikelen"), - 'nn': (BACK, u"God artikkel"), - 'no': (CAT, u"Utmerkede artikler"), - 'nv': (CAT, u"Naaltsoos nizhónígo ályaaígíí"), - 'oc': (CAT, u"Article de qualitat"), - 'pl': (CAT, u"Artykuły na medal"), - 'pt': (CAT, u"!Artigos destacados"), - 'qu': (CAT, u"Wikipidiya:Kusa qillqa"), - 'ro': (CAT, u"Articole de calitate"), - 'ru': (BACK, u"Избранная статья"), - 'sco': (CAT, u"Featurt"), - 'sh': (CAT, u"Izabrani članci"), - 'simple': (CAT, u"Very good articles"), - 'sk': (BACK, u"Perfektný článok"), - 'sl': (CAT, u"Vsi izbrani članki"), - 'sq': (BACK, u"Artikulli perfekt"), - 'sr': (CAT, u"Изабрани"), - 'sv': (CAT, u"Wikipedia:Utmärkta artiklar"), - 'sw': (BACK, u"Makala_nzuri_sana"), - 'szl': (CAT, u"Wyrůżńůne artikle"), - 'ta': (CAT, u"சிறப்புக் கட்டுரைகள்"), - 'te': (CAT, u"విశేషవ్యాసాలు"), - 'th': (BACK, u"บทความคัดสรร"), - 'tl': (BACK, u"Napiling artikulo"), - 'tn': (CAT, u"Featured articles"), - 'tr': (BACK, u"Seçkin madde"), - 'tt': (CAT, u"Сайланган мәкаләләр"), - 'udm': (CAT, u"Википедия:Быръем статьяос"), - 'uk': (CAT, u"Вибрані статті"), - 'ur': (CAT, u"منتخب مقالے"), - 'uz': (CAT, u"Vikipediya:Tanlangan maqolalar"), - 'vec': (BACK, u"Vetrina"), - 'vi': (CAT, u"Bài viết chọn lọc"), - 'vo': (CAT, u"Yegeds gudik"), - 'wa': (CAT, u"Raspepyî årtike"), - 'yi': (CAT, u"רעקאמענדירטע ארטיקלען"), - 'yo': (BACK, u"Àyọkà pàtàkì"), - 'zh': (CAT, u"特色条目"), - 'zh-classical': (CAT, u"卓著"), - 'zh-yue': (BACK, u"正文"), + 'wikidata': (DATA, u'Q4387444'), } good_name = { @@ -318,6 +219,7 @@ def featuredArticles(site, pType): + code = site.lang articles = [] if pType == 'good': info = good_name @@ -327,17 +229,18 @@ info = lists_name else: info = featured_name + code = 'wikidata' try: - method = info[site.lang][0] + method = info[code][0] except KeyError: pywikibot.error( u'language %s doesn\'t has %s category source.' - % (site.lang, pType)) + % (code, pType)) return - name = info[site.lang][1] + name = info[code][1] # hide #-sorted items on en-wiki try: - hide = info[site.lang][2] + hide = info[code][2] except IndexError: hide = None raw = method(site, name, hide) @@ -661,9 +564,9 @@ config.simulate) except KeyboardInterrupt: pywikibot.output('\nQuitting program...') - finally: - if not nocache: - pickle.dump(cache, file(filename, "wb")) +## finally: +## if not nocache: +## pickle.dump(cache, file(filename, "wb")) if __name__ == "__main__":
1
0
0
0
SVN: [11728] branches/rewrite/scripts/i18n
by siebrand@svn.wikimedia.org
08 Jul '13
08 Jul '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11728
Revision: 11728 Author: siebrand Date: 2013-07-08 07:57:51 +0000 (Mon, 08 Jul 2013) Log Message: ----------- Localisation updates from
http://translatewiki.net
. Modified Paths: -------------- branches/rewrite/scripts/i18n/archivebot.py branches/rewrite/scripts/i18n/basic.py branches/rewrite/scripts/i18n/category.py branches/rewrite/scripts/i18n/category_redirect.py branches/rewrite/scripts/i18n/editarticle.py branches/rewrite/scripts/i18n/interwiki.py branches/rewrite/scripts/i18n/movepages.py branches/rewrite/scripts/i18n/pywikibot.py branches/rewrite/scripts/i18n/redirect.py branches/rewrite/scripts/i18n/spellcheck.py branches/rewrite/scripts/i18n/thirdparty.py branches/rewrite/scripts/i18n/weblinkchecker.py Modified: branches/rewrite/scripts/i18n/archivebot.py =================================================================== --- branches/rewrite/scripts/i18n/archivebot.py 2013-07-08 05:39:05 UTC (rev 11727) +++ branches/rewrite/scripts/i18n/archivebot.py 2013-07-08 07:57:51 UTC (rev 11728) @@ -430,7 +430,7 @@ # Author: Akoppad 'kn': { 'archivebot-older-than': u'ಇದಕ್ಕಿಂತ ಹಳೆಯದಾದ', - 'archivebot-page-summary': u'ರೋಬೋಟ್: ಸಂಗ್ರಹಿಸಿಟ್ಟುಕೊಳ್ಳುವ% (ಎಣಿಕೆ) d {{ಬಹುವಚನ:% (ಎಣಿಕೆ) D | ಎಳೆ | ಎಳೆಗಳನ್ನು}} (% (ಏಕೆ) ರು) % ಗೆ (ಸಂಗ್ರಹಗಳು) ರು.', + 'archivebot-page-summary': u'ರೋಬೋಟ್: ಸಂಗ್ರಹಿಸಿಟ್ಟುಕೊಳ್ಳುವ% (ಎಣಿಕೆ) d {{ಬಹುವಚನ:% (ಎಣಿಕೆ) D | ಎಳೆ | ಎಳೆಗಳ}} (% (ಏಕೆ) ರು) % ಗೆ (ಸಂಗ್ರಹಗಳು) ರು.', 'archivebot-archiveheader': u'{{ಮಾತಿನ ಸಂಗ್ರಹ }}', 'archivebot-archive-full': u'(ಪೂರ್ಣ ಸಂಗ್ರಹ )', 'archivebot-archive-summary': u'ರೋಬೋಟ್: ಸಂಗ್ರಹಿಸಿಟ್ಟುಕೊಳ್ಳುವ% (ಎಣಿಕೆ) d {{ಬಹುವಚನ:% (ಎಣಿಕೆ) D | ಎಳೆ | ಎಳೆಗಳನ್ನು}} ನಿಂದ [[% (ನಿಂದ) ರು]].', Modified: branches/rewrite/scripts/i18n/basic.py =================================================================== --- branches/rewrite/scripts/i18n/basic.py 2013-07-08 05:39:05 UTC (rev 11727) +++ branches/rewrite/scripts/i18n/basic.py 2013-07-08 07:57:51 UTC (rev 11728) @@ -241,6 +241,10 @@ 'ku': { 'basic-changing': u'Robot: Diguherîne ...', }, + # Author: Викиней + 'ky': { + 'basic-changing': u'Бот: Өзгөртүү...', + }, # Author: George Animal # Author: UV 'la': { Modified: branches/rewrite/scripts/i18n/category.py =================================================================== --- branches/rewrite/scripts/i18n/category.py 2013-07-08 05:39:05 UTC (rev 11727) +++ branches/rewrite/scripts/i18n/category.py 2013-07-08 07:57:51 UTC (rev 11728) @@ -907,16 +907,16 @@ }, # Author: Akoppad 'kn': { - 'category-version-history': u'ರೋಬೋಟ್: %(oldcat) ನ ಮಾಜಿ ಇತಿಹಾಸದ ಆವೃತ್ತಿಯನ್ನು ಉಳಿಸಲಾಗುತ್ತಿದೆ', - 'category-changing': u'ರೋಬೋಟ್:%(oldcat) ಯನ್ನು % (newcat) ಗೆ ಬದಲಾಯಿಸುವುದು', - 'category-adding': u'ರೋಬೋಟ್: ವರ್ಗಗಳನ್ನು ಸೇರಿಸುವುದು', + 'category-version-history': u'ರೋಬೋಟ್: %(oldcat)ನ ಮಾಜಿ ಇತಿಹಾಸದ ಆವೃತ್ತಿಯನ್ನು ಉಳಿಸಲಾಗುತ್ತಿದೆ', + 'category-changing': u'ರೋಬೋಟ್:%(oldcat)ಯನ್ನು % (newcat)ಗೆ ಬದಲಾಯಿಸುವುದು', + 'category-adding': u'ರೋಬೋಟ್: [[:ವರ್ಗ:%(newcat)s|%(newcat)s]] ವರ್ಗಗಳನ್ನು ಸೇರಿಸುವುದು', 'category-also-in': u'(ಇದರಲ್ಲಿಯು %(alsocat)s)', 'category-was-disbanded': u'ರೋಬೋಟ್: ವರ್ಗ ವಿಸರ್ಜಿಸಲಾಯಿತು', - 'category-replacing': u'ರೋಬೋಟ್: %(oldcat) ಯನ್ನು % (newcat)ಗೆ ಬದಲಾಯಿಸುವುದು', + 'category-replacing': u'ರೋಬೋಟ್: %(oldcat)ಯನ್ನು % (newcat)ಗೆ ಬದಲಾಯಿಸುವುದು', 'category-removing': u'ರೋಬೋಟ್: %(oldcat) ಇಂದ ತೆಗೆದುಹಾಕಲಾಗುತ್ತಿದೆ', 'category-was-moved': u'ರೋಬೋಟ್: ವರ್ಗವನ್ನು [[:Category:%(newcat)s|%(title)s]]ಗೆ ಸರಿಸಲಾಗುತ್ತಿದೆ', 'category-renamed': u'ರೋಬೋಟ್: %s. Authors: %s ಇಂದ ಸರಿಸಲಾಗಿದೆ', - 'category-section-title': u'ಮಾಜಿ %(oldcat)ನ ಪುಟದ ಇತಿಹಾಸ', + 'category-section-title': u'ಮಾಜಿ %(oldcat)ನ ಪುಟದ ಇತಿಹಾಸ', }, # Author: 아라 'ko': { @@ -924,7 +924,7 @@ 'category-changing': u'로봇: %(oldcat)s에서 %(newcat)s(으)로 바꿈', 'category-adding': u'로봇: [[:Category:%(newcat)s|%(newcat)s]] 분류 추가', 'category-also-in': u'(%(alsocat)s에도 들어 있습니다)', - 'category-was-disbanded': u'로봇: 분류를 폐지했습니다', + 'category-was-disbanded': u'로봇: 분류를 폐지함', 'category-replacing': u'로봇: %(oldcat)s(을)를 %(newcat)s(으)로 분류를 바꿈', 'category-removing': u'로봇: %(oldcat)s 제거', 'category-was-moved': u'로봇: 분류를 [[:Category:%(newcat)s|%(title)s]](으)로 옮겼습니다', @@ -1225,6 +1225,7 @@ 'category-replacing': u'Robot: kategorie %(oldcat)s is vervöngen deur %(newcat)s', 'category-removing': u'Bot: vortehaold uut %(oldcat)s', 'category-was-moved': u'Bot: kategorie is herneumd naor [[:Category:%(newcat)s|%(title)s]]', + 'category-renamed': u'Robot: herneumd van %s. Auteurs: %s', 'category-section-title': u'Paginageschiedenisse van veurmaolige %(oldcat)s', 'category-listifying': u'Bot: lieste van %(fromcat)s (%(num)d pagina\'s)', }, Modified: branches/rewrite/scripts/i18n/category_redirect.py =================================================================== --- branches/rewrite/scripts/i18n/category_redirect.py 2013-07-08 05:39:05 UTC (rev 11727) +++ branches/rewrite/scripts/i18n/category_redirect.py 2013-07-08 07:57:51 UTC (rev 11728) @@ -474,7 +474,7 @@ 'category_redirect-add-template': u'로봇: 유지 보스에 대한 분류 넘겨주기 틀 추가', 'category_redirect-edit-request': u'다음 보호된 문서는 분류 링크 업데이트가 필요하다고 감지했습니다: %(itemlist)s', 'category_redirect-edit-request-item': u'* %(title)s(은)는 %(newcat)s(으)로 넘겨주기한 %(oldcat)s에 속해 있습니다', - 'category_redirect-fix-double': u'로봇: 이중 넘겨주기 고침', + 'category_redirect-fix-double': u'로봇: 이중 넘겨주기를 고침', }, # Author: Purodha 'ksh': { @@ -485,6 +485,11 @@ 'category_redirect-edit-request-item': u'* %(title)s es en %(oldcat)s, un dat es en Ömleidung op %(newcat)s', 'category_redirect-fix-double': u'Bot: Dubbel Ömlëijdong fottjemaat.', }, + # Author: Викиней + 'ky': { + 'category_redirect-comment': u'Категория багыттамаларын тейлөөчү бот', + 'category_redirect-fix-double': u'Бот: Кош багыттаманы оңдоо', + }, 'la': { 'category_redirect-fix-double': u'automaton: rectificatio redirectionis duplicis', }, Modified: branches/rewrite/scripts/i18n/editarticle.py =================================================================== --- branches/rewrite/scripts/i18n/editarticle.py 2013-07-08 05:39:05 UTC (rev 11727) +++ branches/rewrite/scripts/i18n/editarticle.py 2013-07-08 07:57:51 UTC (rev 11728) @@ -184,6 +184,10 @@ 'ksh': { 'editarticle-edit': u'Vun Hand mem Botprojramm jeändert: %(description)s', }, + # Author: Викиней + 'ky': { + 'editarticle-edit': u'Боттун жардамы аркылуу колго оңдоо: %(description)s', + }, # Author: Robby 'lb': { 'editarticle-edit': u'Manuell Ännerungen mam Bot: %(description)s', Modified: branches/rewrite/scripts/i18n/interwiki.py =================================================================== --- branches/rewrite/scripts/i18n/interwiki.py 2013-07-08 05:39:05 UTC (rev 11727) +++ branches/rewrite/scripts/i18n/interwiki.py 2013-07-08 07:57:51 UTC (rev 11728) @@ -954,6 +954,7 @@ }, # Author: Hugo.arg # Author: Xqt + # Author: Викиней 'ky': { 'interwiki-modifying': u'робот өзгөрттү: %(modifying)s', 'interwiki-adding-modifying': u'робот кошту: %(adding)s өзгөрттү: %(modifying)s', @@ -962,6 +963,7 @@ 'interwiki-adding': u'робот кошту: %(adding)s', 'interwiki-removing': u'робот өчүрдү: %(removing)s', 'interwiki-removing-modifying': u'робот өчүрдү: %(removing)s өзгөрттү: %(modifying)s', + 'interwiki-modifying-from': u'Бот өзгөрттү: %(from)sдан %(modifying)sга', }, # Author: UV 'la': { Modified: branches/rewrite/scripts/i18n/movepages.py =================================================================== --- branches/rewrite/scripts/i18n/movepages.py 2013-07-08 05:39:05 UTC (rev 11727) +++ branches/rewrite/scripts/i18n/movepages.py 2013-07-08 07:57:51 UTC (rev 11728) @@ -178,12 +178,16 @@ }, # Author: 아라 'ko': { - 'movepages-moving': u'로봇: 문서 이동함', + 'movepages-moving': u'로봇: 문서를 이동함', }, # Author: Purodha 'ksh': { 'movepages-moving': u'Bot: di Sigg wood ömjenannt', }, + # Author: Викиней + 'ky': { + 'movepages-moving': u'Боттун жардамы менен өзгөртүлгөн барактар', + }, # Author: Robby 'lb': { 'movepages-moving': u'Bot: Säit geréckelt', Modified: branches/rewrite/scripts/i18n/pywikibot.py =================================================================== --- branches/rewrite/scripts/i18n/pywikibot.py 2013-07-08 05:39:05 UTC (rev 11727) +++ branches/rewrite/scripts/i18n/pywikibot.py 2013-07-08 07:57:51 UTC (rev 11728) @@ -369,7 +369,7 @@ 'ko': { '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'분류 이름을 입력하세요:', @@ -465,6 +465,16 @@ 'pywikibot-enter-category-name': u'Sila masukkan nama kategori:', 'pywikibot-enter-finished-browser': u'Tekan Enter selepas siap dalam pelayar.', }, + # Author: Servien + 'nds-nl': { + 'pywikibot-enter-xml-filename': u'Geef de bestaandsnaam van n XML-dump op:', + 'pywikibot-enter-page-processing': u'Welke zied mut verwarkt wörden?', + 'pywikibot-enter-file-links-processing': u'Koppelingen naor welke bestaandszied mutten verwarkt wörden?', + 'pywikibot-enter-namespace-number': u'Geef n naamruumtenummer op:', + 'pywikibot-enter-new-text': u'Geef de nieje tekste op:', + 'pywikibot-enter-category-name': u'Geef de kategorienaam op:', + 'pywikibot-enter-finished-browser': u'Druk op "Enter" a\'j klaor bin in de webkieker.', + }, # Author: Eukesh 'new': { 'pywikibot-enter-xml-filename': u'XML दम्पया फाइलनेम तियादिसँ:', @@ -672,11 +682,12 @@ 'pywikibot-enter-finished-browser': u'Bấm Enter sau khi sửa đổi xong trong trình duyệt.', }, # Author: Anakmalaysia + # Author: Qiyue2001 # Author: Yfdyh000 'zh': { '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-07-08 05:39:05 UTC (rev 11727) +++ branches/rewrite/scripts/i18n/redirect.py 2013-07-08 07:57:51 UTC (rev 11728) @@ -655,6 +655,7 @@ 'nds-nl': { 'redirect-fix-double': u'Bot: dubbele deurverwiezing verbeterd naor %(to)s', 'redirect-remove-broken': u'Bot: de doelpagina van de deurverwiezing besteet niet', + 'redirect-fix-broken-moved': u'Robot: kapotte deurverwiezing verbeterd deur anpassing naor herneumden doelzied %(to)s', 'redirect-fix-loop': u'Bot: deurverwiessirkel naor %(to)s erepareerd', 'redirect-remove-loop': u'Bot: deurverwiezing verwis weer naor zichzelf', 'redirect-broken-redirect-template': u'{{vort|Kapotte deurverwiezing of deurverwijzing naor vort-edaone pagina}}', Modified: branches/rewrite/scripts/i18n/spellcheck.py =================================================================== --- branches/rewrite/scripts/i18n/spellcheck.py 2013-07-08 05:39:05 UTC (rev 11727) +++ branches/rewrite/scripts/i18n/spellcheck.py 2013-07-08 07:57:51 UTC (rev 11728) @@ -157,6 +157,10 @@ 'ms': { 'spellcheck-checking': u'Penyemak ejaan dibantu bot', }, + # Author: Servien + 'nds-nl': { + 'spellcheck-checking': u'Spellingskontraole', + }, # Author: Eukesh 'new': { 'spellcheck-checking': u'बट-ग्वहालिया हिज्जे निरिक्षक', Modified: branches/rewrite/scripts/i18n/thirdparty.py =================================================================== --- branches/rewrite/scripts/i18n/thirdparty.py 2013-07-08 05:39:05 UTC (rev 11727) +++ branches/rewrite/scripts/i18n/thirdparty.py 2013-07-08 07:57:51 UTC (rev 11728) @@ -24,6 +24,7 @@ # Author: DrTrigon # Author: EugeneZelenko # Author: McDutchie + # Author: Shirayuki # Author: Siebrand 'qqq': { 'thirdparty-drtrigonbot-sum_disc-summary-head': u'Summary line first part.', @@ -42,7 +43,7 @@ 'thirdparty-drtrigonbot-sum_disc-summary-clean': u'Summary line second part if there are additional results and old get removed.', 'thirdparty-drtrigonbot-sum_disc-summary-mod': u'Summary line second part if the page had to be modified due to new results. Parameters:\n* %(num)i is the numer of entries\n* %(page)s is the page that was updated', 'thirdparty-drtrigonbot-sum_disc-notify-maintmsg': u'First part of message if it is a extraordinary maintenance message.\n\n(It\'s a system message that can only be triggered by the bot maintainer. Thus it\'s not important to translate the text.)', - 'thirdparty-drtrigonbot-sum_disc-parse-end': u'Message footer for bot report output.', + 'thirdparty-drtrigonbot-sum_disc-parse-end': u'Message footer for bot report output. Parameters:\n* %(sign)s - signature (<code><nowiki>~~~~</nowiki></code>)', }, # Author: Csisc 'aeb': { @@ -384,6 +385,11 @@ 'thirdparty-drtrigonbot-sum_disc-notify-notify': u'Hysbysiad', 'thirdparty-drtrigonbot-subster-summary-mod': u'yn diweddaru %(tags)s tag(s)', 'thirdparty-drtrigonbot-sum_disc-notify-closed': u'Caewyd y drafodaeth', + 'thirdparty-drtrigonbot-sum_disc-summary-add': u'Ychwanegwyd crynodeb o\'r drafodaeth: %(num)i cofnod', + 'thirdparty-drtrigonbot-sum_disc-notify-changed': u'Cafwyd newid ar y drafodaeth', + 'thirdparty-drtrigonbot-sum_disc-summary-clean': u'Ychwanegwyd crynodeb o\'r drafodaeth ynghyd â glanhad: %(num)i cofnod', + 'thirdparty-drtrigonbot-sum_disc-summary-mod': u'Diweddarwyd crynodeb y drafodaeth: %(num)i cofnod yn y dudalen %(page)s', + 'thirdparty-drtrigonbot-sum_disc-notify-maintmsg': u'NEGES BOT', }, # Author: Christian List # Author: Kaare Modified: branches/rewrite/scripts/i18n/weblinkchecker.py =================================================================== --- branches/rewrite/scripts/i18n/weblinkchecker.py 2013-07-08 05:39:05 UTC (rev 11727) +++ branches/rewrite/scripts/i18n/weblinkchecker.py 2013-07-08 07:57:51 UTC (rev 11728) @@ -74,6 +74,7 @@ # Author: Lloffiwr 'cy': { 'weblinkchecker-caption': u'Dolen ddiffrwyth', + 'weblinkchecker-summary': u'Bot: Yn adrodd nad oes modd cyrraedd cyswllt allanol', }, # Author: Steenth 'da': { @@ -264,6 +265,13 @@ 'weblinkchecker-summary': u'Lenk-Bot: Weblenk geiht nich mehr', 'weblinkchecker-report': u'De Bot hett en poor Mal al versöcht, disse Siet optoropen un kunn dor nich bikamen. Schall man een nakieken, wat de Siet noch dor is un den Lenk richten oder rutnehmen.', }, + # Author: Servien + 'nds-nl': { + 'weblinkchecker-archive_msg': u'Disse webstee steet op-esleugen in t Internet Archive. Overweeg te koppelen naor n zied uut t archief: [%(URL)s].', + 'weblinkchecker-caption': u'Dooie verwiezing', + 'weblinkchecker-summary': u'Robot: melding (tiejelik) onbereikbaore uutgaonde verwiezing', + 'weblinkchecker-report': u'Uut enkele automatiese kontraoles bleek dat de uutgaonde verwiezing die hieronder steet onbereikbaor is. Kiek effen nao of de verwiezing inderdaod onbereikbaor is. Geerne disse tekste vortdoon nao n suksesvolle kontraole of naodat de uutgaonde verwiezing vortedaon of verbeterd is.', + }, # Author: Siebrand 'nl': { 'weblinkchecker-archive_msg': u'Deze website is bewaard in het Internet Archive. Overweeg te koppelen naar een gearchiveerde pagina: [%(URL)s].',
1
0
0
0
SVN: [11727] trunk/pywikipedia/.gitreview
by legoktm@svn.wikimedia.org
07 Jul '13
07 Jul '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11727
Revision: 11727 Author: legoktm Date: 2013-07-08 05:39:05 +0000 (Mon, 08 Jul 2013) Log Message: ----------- Add .gitreview file for git migration Added Paths: ----------- trunk/pywikipedia/.gitreview Added: trunk/pywikipedia/.gitreview =================================================================== --- trunk/pywikipedia/.gitreview (rev 0) +++ trunk/pywikipedia/.gitreview 2013-07-08 05:39:05 UTC (rev 11727) @@ -0,0 +1,6 @@ +[gerrit] +host=gerrit.wikimedia.org +port=29418 +project=pywikibot/compat.git +defaultbranch=master +defaultrebase=0
1
0
0
0
SVN: [11726] branches/rewrite/.gitreview
by legoktm@svn.wikimedia.org
07 Jul '13
07 Jul '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11726
Revision: 11726 Author: legoktm Date: 2013-07-08 05:36:35 +0000 (Mon, 08 Jul 2013) Log Message: ----------- Add .gitreview file for git migration Added Paths: ----------- branches/rewrite/.gitreview Added: branches/rewrite/.gitreview =================================================================== --- branches/rewrite/.gitreview (rev 0) +++ branches/rewrite/.gitreview 2013-07-08 05:36:35 UTC (rev 11726) @@ -0,0 +1,6 @@ +[gerrit] +host=gerrit.wikimedia.org +port=29418 +project=pywikibot/core.git +defaultbranch=master +defaultrebase=0
1
0
0
0
SVN: [11725] branches/rewrite/scripts/featured.py
by xqt@svn.wikimedia.org
07 Jul '13
07 Jul '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11725
Revision: 11725 Author: xqt Date: 2013-07-07 17:48:18 +0000 (Sun, 07 Jul 2013) Log Message: ----------- fix for Page.site Modified Paths: -------------- branches/rewrite/scripts/featured.py Modified: branches/rewrite/scripts/featured.py =================================================================== --- branches/rewrite/scripts/featured.py 2013-07-07 17:27:02 UTC (rev 11724) +++ branches/rewrite/scripts/featured.py 2013-07-07 17:48:18 UTC (rev 11725) @@ -71,7 +71,7 @@ def BACK(site, name, hide): - p = pywikibot.Page(site, name, defaultNamespace=10) + p = pywikibot.Page(site, name, ns=10) return [page for page in p.getReferences(follow_redirects=False, onlyTemplateInclusion=True)] @@ -346,7 +346,7 @@ articles.append(p) # Article talk (like in English) elif p.namespace() == 1 and site.lang != 'el': - articles.append(pywikibot.Page(p.site(), + articles.append(pywikibot.Page(p.site, p.title(withNamespace=False))) pywikibot.output( '\03{lightred}** wikipedia:%s has %i %s articles\03{default}' @@ -663,7 +663,6 @@ pywikibot.output('\nQuitting program...') finally: if not nocache: - return pickle.dump(cache, file(filename, "wb"))
1
0
0
0
SVN: [11724] branches/rewrite/scripts/featured.py
by xqt@svn.wikimedia.org
07 Jul '13
07 Jul '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11724
Revision: 11724 Author: xqt Date: 2013-07-07 17:27:02 +0000 (Sun, 07 Jul 2013) Log Message: ----------- use iterlanglinks since interwiki() is empty with wikidata Modified Paths: -------------- branches/rewrite/scripts/featured.py Modified: branches/rewrite/scripts/featured.py =================================================================== --- branches/rewrite/scripts/featured.py 2013-07-07 17:09:51 UTC (rev 11723) +++ branches/rewrite/scripts/featured.py 2013-07-07 17:27:02 UTC (rev 11724) @@ -360,17 +360,13 @@ oursite = pywikibot.getSite() if page.isRedirectPage(): page = page.getRedirectTarget() - try: - iw = page.interwiki() - except: - pywikibot.output(u"%s -> no interwiki, giving up" % page.title()) - return ourpage = None - for p in iw: - if p.site() == oursite: - ourpage = p + for link in page.iterlanglinks(): + if link.site == oursite: + ourpage = pywikibot.Page(link) break + if not ourpage: if not quiet: pywikibot.output(u"%s -> no corresponding page in %s" @@ -400,16 +396,12 @@ % ourpage.title()) return - try: - iw = ourpage.interwiki() - except: - return - - backpage is None - for p in iw: - if p.site() == page.site(): - backpage = p + backpage = None + for link in ourpage.iterlanglinks(): + if link.site == page.site: + backpage = pywikibot.Page(link) break + if not backpage: pywikibot.output(u"%s -> no back interwiki ref" % page.title()) return
1
0
0
0
SVN: [11723] trunk/pywikipedia/featured.py
by xqt@svn.wikimedia.org
07 Jul '13
07 Jul '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11723
Revision: 11723 Author: xqt Date: 2013-07-07 17:09:51 +0000 (Sun, 07 Jul 2013) Log Message: ----------- fix for prev. commit Modified Paths: -------------- trunk/pywikipedia/featured.py Modified: trunk/pywikipedia/featured.py =================================================================== --- trunk/pywikipedia/featured.py 2013-07-07 16:51:44 UTC (rev 11722) +++ trunk/pywikipedia/featured.py 2013-07-07 17:09:51 UTC (rev 11723) @@ -405,7 +405,7 @@ except: return - backpage is None + backpage = None for p in iw: if p.site() == page.site(): backpage = p
1
0
0
0
SVN: [11722] trunk/pywikipedia/featured.py
by xqt@svn.wikimedia.org
07 Jul '13
07 Jul '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11722
Revision: 11722 Author: xqt Date: 2013-07-07 16:51:44 +0000 (Sun, 07 Jul 2013) Log Message: ----------- pep9 changes from rewrite branch r11721 Modified Paths: -------------- trunk/pywikipedia/featured.py Modified: trunk/pywikipedia/featured.py =================================================================== --- trunk/pywikipedia/featured.py 2013-07-07 16:44:15 UTC (rev 11721) +++ trunk/pywikipedia/featured.py 2013-07-07 16:51:44 UTC (rev 11722) @@ -43,30 +43,35 @@ # # (C) Maxim Razin, 2005 # (C) Leonardo Gregianin, 2005-2008 -# (C) xqt, 2009-2012 +# (C) xqt, 2009-2013 # (C) Pywikipedia bot team, 2005-2012 # # Distributed under the terms of the MIT license. # -import sys, re, pickle, os.path +import os.path +import pickle +import re +import sys from copy import copy import wikipedia as pywikibot from pywikibot import i18n import catlib, config from pagegenerators import PreloadingGenerator + def CAT(site, name, hide): name = site.namespace(14) + ':' + name cat=catlib.Category(site, name) for article in cat.articles(endsort=hide): yield article if hide: - for article in cat.articles(startFrom=unichr(ord(hide)+1)): + for article in cat.articles(startFrom=unichr(ord(hide) + 1)): yield article + def BACK(site, name, hide): - p=pywikibot.Page(site, name, defaultNamespace=10) + p = pywikibot.Page(site, name, defaultNamespace=10) return [page for page in p.getReferences(follow_redirects=False, onlyTemplateInclusion=True)] @@ -77,7 +82,7 @@ 'als': ['LinkFA'], 'an': ['Destacato', 'Destacau'], 'ar': [u'وصلة مقالة مختارة'], - 'ast':['Enllaz AD'], + 'ast': ['Enllaz AD'], 'az': ['Link FM'], 'br': ['Liamm PuB', 'Lien AdQ'], 'ca': [u'Enllaç AD', 'Destacat'], @@ -87,7 +92,7 @@ 'es': ['Destacado'], 'eu': ['NA lotura'], 'fr': ['Lien AdQ'], - 'fur':['Leam VdC'], + 'fur': ['Leam VdC'], 'ga': ['Nasc AR'], 'hi': ['Link FA', 'Lien AdQ'], 'is': [u'Tengill ÚG'], @@ -114,7 +119,7 @@ 'nn': ['Link AA'], 'no': ['Link AA'], 'pt': ['Bom interwiki'], - #'tr': ['Link GA', 'Link KM'], +## 'tr': ['Link GA', 'Link KM'], 'vi': [u'Liên kết bài chất lượng tốt'], 'wo': ['Lien BA'], } @@ -125,77 +130,77 @@ } featured_name = { - 'af': (BACK,u"Voorbladster"), - 'als':(CAT, u"Wikipedia:Bsunders glungener Artikel"), + 'af': (BACK, u"Voorbladster"), + 'als': (CAT, u"Wikipedia:Bsunders glungener Artikel"), 'am': (CAT, u"Wikipedia:Featured article"), 'an': (CAT, u"Articlos destacatos"), - 'ang':(CAT, u"Fulgōd ȝeƿritu"), + 'ang': (CAT, u"Fulgōd ȝeƿritu"), 'ar': (CAT, u"مقالات مختارة"), - 'ast':(CAT, u"Uiquipedia:Artículos destacaos"), - 'az': (BACK,u"Seçilmiş məqalə"), - 'bar':(CAT, u"Berig"), + 'ast': (CAT, u"Uiquipedia:Artículos destacaos"), + 'az': (BACK, u"Seçilmiş məqalə"), + 'bar': (CAT, u"Berig"), 'bat-smg': (CAT, u"Vikipedėjės pavīzdėnē straipsnē"), - 'be-x-old':(CAT, u"Вікіпэдыя:Абраныя артыкулы"), + 'be-x-old': (CAT, u"Вікіпэдыя:Абраныя артыкулы"), 'bg': (CAT, u"Избрани статии"), - 'bn': (BACK,u"নির্বাচিত নিবন্ধ"), + 'bn': (BACK, u"নির্বাচিত নিবন্ধ"), 'br': (CAT, u"Pennadoù eus an dibab"), 'bs': (CAT, u"Odabrani članci"), 'ca': (CAT, u"Llista d'articles de qualitat"), - 'ceb':(CAT, u"Mga napiling artikulo"), + 'ceb': (CAT, u"Mga napiling artikulo"), 'cs': (CAT, u"Wikipedie:Nejlepší články"), - 'cy': (BACK,u"Erthygl ddethol"), + 'cy': (BACK, u"Erthygl ddethol"), 'da': (CAT, u"Fremragende artikler"), 'de': (CAT, u"Wikipedia:Exzellent"), 'dv': (BACK, u"Featured article"), - 'el': (BACK,u"Αξιόλογο άρθρο"), + 'el': (BACK, u"Αξιόλογο άρθρο"), 'en': (CAT, u"Featured articles"), 'eo': (CAT, u"Elstaraj artikoloj"), 'es': (BACK, u"Artículo destacado"), 'et': (CAT, u"Eeskujulikud artiklid"), 'eu': (CAT, u"Nabarmendutako artikuluak"), - 'ext':(BACK,u"Destacau"), - 'fa': (BACK,u"مقاله برگزیده"), + 'ext': (BACK, u"Destacau"), + 'fa': (BACK, u"مقاله برگزیده"), 'fi': (CAT, u"Suositellut sivut"), 'fo': (CAT, u"Mánaðargrein"), 'fr': (CAT, u"Article de qualité"), - 'frr':(BACK,u"Exzellent"), + 'frr': (BACK, u"Exzellent"), 'gl': (CAT, u"Wikipedia:Artigos de calidade"), 'gv': (CAT, u"Artyn reiht"), 'he': (CAT, u"ערכים מומלצים"), - 'hi': (BACK,u"निर्वाचित लेख"), + 'hi': (BACK, u"निर्वाचित लेख"), 'hr': (CAT, u"Izabrani članci"), - 'hsb':(CAT, u"Ekscelentny"), + 'hsb': (CAT, u"Ekscelentny"), 'hu': (CAT, u"Kiemelt cikkek"), - 'hy': (BACK,u"Ընտրված հոդված"), + 'hy': (BACK, u"Ընտրված հոդված"), 'ia': (CAT, u"Wikipedia:Articulos eminente"), 'id': (BACK, u"Featured article"), 'is': (CAT, u"Wikipedia:Úrvalsgreinar"), 'it': (CAT, u"Voci in vetrina"), - 'ja': (BACK,u"Featured article"), + 'ja': (BACK, u"Featured article"), 'ka': (CAT, u"რჩეული სტატიები"), 'kk': (CAT, u"Уикипедия:Таңдаулы мақалалар"), 'kl': (CAT, u"Anbefalet"), - 'km': (BACK,u"អត្ថបទពិសេស"), - 'kn': (BACK,u"ವಿಶೇಷ ಲೇಖನ"), + 'km': (BACK, u"អត្ថបទពិសេស"), + 'kn': (BACK, u"ವಿಶೇಷ ಲೇಖನ"), 'ko': (CAT, u"알찬 글"), - 'krc':(CAT, u"Википедия:Сайланнган статьяла"), + 'krc': (CAT, u"Википедия:Сайланнган статьяла"), 'kv': (CAT, u"Википедия:Бур гижӧдъяс"), 'la': (CAT, u"Paginae mensis"), - 'lad':(CAT, u"Artikolos valutosos"), + 'lad': (CAT, u"Artikolos valutosos"), 'li': (CAT, u"Wikipedia:Sjterartikele"), - 'lmo':(CAT, u"Articol ben faa"), + 'lmo': (CAT, u"Articol ben faa"), 'lo': (CAT, u"ບົດຄວາມດີເດັ່ນ"), 'lt': (CAT, u"Vikipedijos pavyzdiniai straipsniai"), 'lv': (CAT, u"Vērtīgi raksti"), 'mk': (BACK, u"Избрана"), - 'ml': (BACK,u"Featured"), + 'ml': (BACK, u"Featured"), 'mt': (CAT, u"Artikli fil-vetrina"), 'mr': (CAT, u"मुखपृष्ठ सदर लेख"), - 'ms': (BACK,u"Rencana pilihan"), - 'nah':(BACK,u"Featured article"), + 'ms': (BACK, u"Rencana pilihan"), + 'nah': (BACK, u"Featured article"), 'nds-nl': (BACK, u"Etelazie"), 'nl': (CAT, u"Wikipedia:Etalage-artikelen"), - 'nn': (BACK,u"God artikkel"), + 'nn': (BACK, u"God artikkel"), 'no': (CAT, u"Utmerkede artikler"), 'nv': (CAT, u"Naaltsoos nizhónígo ályaaígíí"), 'oc': (CAT, u"Article de qualitat"), @@ -204,33 +209,33 @@ 'qu': (CAT, u"Wikipidiya:Kusa qillqa"), 'ro': (CAT, u"Articole de calitate"), 'ru': (BACK, u"Избранная статья"), - 'sco':(CAT, u"Featurt"), + 'sco': (CAT, u"Featurt"), 'sh': (CAT, u"Izabrani članci"), 'simple': (CAT, u"Very good articles"), - 'sk': (BACK,u"Perfektný článok"), + 'sk': (BACK, u"Perfektný článok"), 'sl': (CAT, u"Vsi izbrani članki"), - 'sq': (BACK,u"Artikulli perfekt"), + 'sq': (BACK, u"Artikulli perfekt"), 'sr': (CAT, u"Изабрани"), 'sv': (CAT, u"Wikipedia:Utmärkta artiklar"), - 'sw': (BACK,u"Makala_nzuri_sana"), - 'szl':(CAT, u"Wyrůżńůne artikle"), + 'sw': (BACK, u"Makala_nzuri_sana"), + 'szl': (CAT, u"Wyrůżńůne artikle"), 'ta': (CAT, u"சிறப்புக் கட்டுரைகள்"), 'te': (CAT, u"విశేషవ్యాసాలు"), - 'th': (BACK,u"บทความคัดสรร"), - 'tl': (BACK,u"Napiling artikulo"), + 'th': (BACK, u"บทความคัดสรร"), + 'tl': (BACK, u"Napiling artikulo"), 'tn': (CAT, u"Featured articles"), - 'tr': (BACK,u"Seçkin madde"), + 'tr': (BACK, u"Seçkin madde"), 'tt': (CAT, u"Сайланган мәкаләләр"), - 'udm':(CAT, u"Википедия:Быръем статьяос"), + 'udm': (CAT, u"Википедия:Быръем статьяос"), 'uk': (CAT, u"Вибрані статті"), 'ur': (CAT, u"منتخب مقالے"), 'uz': (CAT, u"Vikipediya:Tanlangan maqolalar"), - 'vec':(BACK,u"Vetrina"), + 'vec': (BACK, u"Vetrina"), 'vi': (CAT, u"Bài viết chọn lọc"), 'vo': (CAT, u"Yegeds gudik"), 'wa': (CAT, u"Raspepyî årtike"), 'yi': (CAT, u"רעקאמענדירטע ארטיקלען"), - 'yo': (BACK,u"Àyọkà pàtàkì"), + 'yo': (BACK, u"Àyọkà pàtàkì"), 'zh': (CAT, u"特色条目"), 'zh-classical': (CAT, u"卓著"), 'zh-yue': (BACK, u"正文"), @@ -242,7 +247,7 @@ 'cs': (CAT, u"Wikipedie:Dobré články"), 'da': (CAT, u"Gode artikler"), 'de': (CAT, u"Wikipedia:Lesenswert"), - #'dsb':(CAT, u"Naraźenje za pógódnośenje"), +## 'dsb': (CAT, u"Naraźenje za pógódnośenje"), 'en': (CAT, u"Wikipedia good articles"), 'eo': (CAT, u"Legindaj artikoloj"), 'es': (CAT, u"Wikipedia:Artículos buenos"), @@ -250,12 +255,12 @@ 'fa': (CAT, u"مقالههای خوب"), 'fi': (CAT, u"Hyvät artikkelit"), 'fr': (CAT, u"Bon article"), - 'hsb':(CAT, u"Namjet za pohódnoćenje"), - 'id': (BACK,u"Artikel bagus"), + 'hsb': (CAT, u"Namjet za pohódnoćenje"), + 'id': (BACK, u"Artikel bagus"), 'is': (CAT, u"Wikipedia:Gæðagreinar"), - 'ja': (BACK,u"Good article"), + 'ja': (BACK, u"Good article"), 'ko': (CAT, u"좋은 글"), - 'ksh':(CAT, u"Joode Aatikkel"), + 'ksh': (CAT, u"Joode Aatikkel"), 'lt': (CAT, u"Vertingi straipsniai"), 'lv': (CAT, u"Labi raksti"), 'no': (CAT, u"Anbefalte artikler"), @@ -265,9 +270,9 @@ 'ro': (BACK, u"Articol bun"), 'ru': (CAT, u"Википедия:Хорошие статьи по алфавиту"), 'simple': (CAT, u"Good articles"), - 'sr': (BACK,u"Иконица добар"), + 'sr': (BACK, u"Иконица добар"), 'sv': (CAT, u"Wikipedia:Bra artiklar"), - 'tr': (BACK,u"Kaliteli madde"), + 'tr': (BACK, u"Kaliteli madde"), 'uk': (CAT, u"Вікіпедія:Добрі статті"), 'uz': (CAT, u"Vikipediya:Yaxshi maqolalar"), 'yi': (CAT, u"וויקיפעדיע גוטע ארטיקלען"), @@ -283,7 +288,7 @@ 'fa': (BACK, u"فهرست برگزیده"), 'id': (BACK, u'Featured list'), 'ja': (BACK, u'Featured List'), - 'ksh':(CAT, u"Joode Leß"), + 'ksh': (CAT, u"Joode Leß"), 'no': (BACK, u'God liste'), 'pl': (BACK, u'Medalista'), 'pt': (BACK, u'Anexo destacado'), @@ -295,7 +300,8 @@ 'zh': (BACK, u'特色列表'), } -# Third parameter is the sort key indicating articles to hide from the given list +# Third parameter is the sort key indicating articles to hide from the given +# list former_name = { 'ca': (CAT, u"Arxiu de propostes de la retirada de la distinció"), 'en': (CAT, u"Wikipedia former featured articles", "#"), @@ -310,8 +316,9 @@ 'zh': (CAT, u"已撤销的特色条目"), } + def featuredArticles(site, pType): - articles=[] + articles = [] if pType == 'good': info = good_name elif pType == 'former': @@ -335,10 +342,10 @@ hide = None raw = method(site, name, hide) for p in raw: - if p.namespace() == 0: # Article + if p.namespace() == 0: # Article articles.append(p) # Article talk (like in English) - elif p.namespace() == 1 and site.lang <> 'el': + elif p.namespace() == 1 and site.lang != 'el': articles.append(pywikibot.Page(p.site(), p.title(withNamespace=False))) pywikibot.output( @@ -347,30 +354,34 @@ for p in articles: yield copy(p) + def findTranslated(page, oursite=None, quiet=False): if not oursite: - oursite=pywikibot.getSite() + oursite = pywikibot.getSite() if page.isRedirectPage(): page = page.getRedirectTarget() try: - iw=page.interwiki() + iw = page.interwiki() except: pywikibot.output(u"%s -> no interwiki, giving up" % page.title()) - return None - ourpage=None + return + + ourpage = None for p in iw: - if p.site()==oursite: - ourpage=p + if p.site() == oursite: + ourpage = p break if not ourpage: if not quiet: pywikibot.output(u"%s -> no corresponding page in %s" % (page.title(), oursite)) - return None + return + if not ourpage.exists(): pywikibot.output(u"%s -> our page doesn't exist: %s" % (page.title(), ourpage.title())) - return None + return + if ourpage.isRedirectPage(): ourpage = ourpage.getRedirectTarget() pywikibot.output(u"%s -> corresponding page is %s" @@ -378,25 +389,31 @@ if ourpage.namespace() != 0: pywikibot.output(u"%s -> not in the main namespace, skipping" % page.title()) - return None + return + if ourpage.isRedirectPage(): pywikibot.output(u"%s -> double redirect, skipping" % page.title()) - return None + return + if not ourpage.exists(): - pywikibot.output(u"%s -> page doesn't exist, skipping" % ourpage.title()) - return None + pywikibot.output(u"%s -> page doesn't exist, skipping" + % ourpage.title()) + return + try: iw = ourpage.interwiki() except: - return None - backpage=None + return + + backpage is None for p in iw: if p.site() == page.site(): backpage = p break if not backpage: pywikibot.output(u"%s -> no back interwiki ref" % page.title()) - return None + return + if backpage == page: # everything is ok return ourpage @@ -407,9 +424,9 @@ return ourpage pywikibot.output(u"%s -> back interwiki ref target is %s" % (page.title(), backpage.title())) - return None -def getTemplateList (lang, pType): + +def getTemplateList(lang, pType): if pType == 'good': try: templates = template_good[lang] @@ -422,7 +439,7 @@ templates += template_lists['_default'] except KeyError: templates = template_lists['_default'] - else: #pType in ['former', 'featured'] + else: # pType in ['former', 'featured'] try: templates = template[lang] templates += template['_default'] @@ -430,6 +447,7 @@ templates = template['_default'] return templates + def featuredWithInterwiki(fromsite, tosite, template_on_top, pType, quiet, dry=False): if not fromsite.lang in cache: @@ -438,36 +456,39 @@ cache[fromsite.lang][tosite.lang] = {} cc = cache[fromsite.lang][tosite.lang] if nocache: - cc={} + cc = {} templatelist = getTemplateList(tosite.lang, pType) findtemplate = '(' + '|'.join(templatelist) + ')' - re_Link_FA=re.compile(ur"\{\{%s\|%s\}\}" - % (findtemplate.replace(u' ', u'[ _]'), - fromsite.lang), re.IGNORECASE) + re_Link_FA = re.compile(ur"\{\{%s\|%s\}\}" + % (findtemplate.replace(u' ', u'[ _]'), + fromsite.lang), re.IGNORECASE) gen = featuredArticles(fromsite, pType) gen = PreloadingGenerator(gen) - - pairs=[] + pairs = [] for a in gen: if a.title() < afterpage: continue + if u"/" in a.title() and a.namespace() != 0: pywikibot.output(u"%s is a subpage" % a.title()) continue + if a.title() in cc: - pywikibot.output(u"(cached) %s -> %s"%(a.title(), cc[a.title()])) + pywikibot.output(u"(cached) %s -> %s" % (a.title(), cc[a.title()])) continue + if a.isRedirectPage(): - a=a.getRedirectTarget() + a = a.getRedirectTarget() try: if not a.exists(): pywikibot.output(u"source page doesn't exist: %s" % a.title()) continue + atrans = findTranslated(a, tosite, quiet) - if pType!='former': + if pType != 'former': if atrans: - text=atrans.get() - m=re_Link_FA.search(text) + text = atrans.get() + m = re_Link_FA.search(text) if m: pywikibot.output(u"(already done)") else: @@ -475,14 +496,13 @@ if (not interactive or pywikibot.input( u'Connecting %s -> %s. Proceed? [Y/N]' - % (a.title(), atrans.title())) in ['Y', 'y'] - ): + % (a.title(), atrans.title())) in ['Y', 'y']): site = pywikibot.getSite() comment = pywikibot.setAction( i18n.twtranslate(site, 'featured-' + pType, {'page': unicode(a)})) ### Moving {{Link FA|xx}} to top of interwikis ### - if template_on_top == True: + if template_on_top: # Getting the interwiki iw = pywikibot.getLanguageLinks(text, site) # Removing the interwiki @@ -493,35 +513,35 @@ text = pywikibot.replaceLanguageLinks(text, iw, site) - ### Placing {{Link FA|xx}} right next to corresponding interwiki ### + # Placing {{Link FA|xx}} right next to + # corresponding interwiki else: - text=(text[:m.end()] - + (u" {{%s|%s}}" % (templatelist[0], - fromsite.lang)) - + text[m.end():]) + text = (text[:m.end()] + + (u" {{%s|%s}}" % (templatelist[0], + fromsite.lang)) + + text[m.end():]) if not dry: try: atrans.put(text, comment) except pywikibot.LockedPage: pywikibot.output(u'Page %s is locked!' % atrans.title()) - cc[a.title()]=atrans.title() + cc[a.title()] = atrans.title() else: if atrans: - text=atrans.get() - m=re_Link_FA.search(text) + text = atrans.get() + m = re_Link_FA.search(text) if m: # insert just before interwiki if (not interactive or pywikibot.input( u'Connecting %s -> %s. Proceed? [Y/N]' - % (a.title(), atrans.title())) in ['Y', 'y'] - ): + % (a.title(), atrans.title())) in ['Y', 'y']): site = pywikibot.getSite() comment = pywikibot.setAction( i18n.twtranslate(site, 'featured-former', {'page': unicode(a)})) - text = re.sub(re_Link_FA,'',text) + text = re.sub(re_Link_FA, '', text) if not dry: try: atrans.put(text, comment) @@ -530,10 +550,11 @@ % atrans.title()) else: pywikibot.output(u"(already done)") - cc[a.title()]=atrans.title() + cc[a.title()] = atrans.title() except pywikibot.PageNotSaved, e: pywikibot.output(u"Page not saved") + def main(*args): global nocache, interactive, afterpage, cache nocache = 0 @@ -543,23 +564,23 @@ template_on_top = True featuredcount = False - fromlang=[] + fromlang = [] processType = 'featured' doAll = False - part = False + part = False quiet = False for arg in pywikibot.handleArgs(): if arg == '-interactive': - interactive=1 + interactive = 1 elif arg == '-nocache': - nocache=1 + nocache = 1 elif arg.startswith('-fromlang:'): - fromlang=arg[10:].split(",") + fromlang = arg[10:].split(",") part = True elif arg == '-fromall': doAll = True elif arg.startswith('-after:'): - afterpage=arg[7:] + afterpage = arg[7:] elif arg == '-side': template_on_top = False elif arg == '-count': @@ -578,8 +599,10 @@ # BUG: range with zh-min-nan (3 "-") if len(fromlang) == 1 and fromlang[0].index("-") >= 0: start, end = fromlang[0].split("--", 1) - if not start: start = "" - if not end: end = "zzzzzzz" + if not start: + start = "" + if not end: + end = "zzzzzzz" if processType == 'good': fromlang = [lang for lang in good_name.keys() if lang >= start and lang <= end] @@ -605,11 +628,11 @@ else: fromlang = featured_name.keys() - filename="cache/" + processType + filename = "cache/" + processType try: - cache=pickle.load(file(filename,"rb")) + cache = pickle.load(file(filename, "rb")) except: - cache={} + cache = {} if not fromlang: pywikibot.showHelp('featured') @@ -625,6 +648,7 @@ if t.exists(): hasTemplate = True break + try: for ll in fromlang: fromsite = pywikibot.getSite(ll) @@ -639,7 +663,7 @@ % (processType, pywikibot.getSite().lang)) pywikibot.output('Quitting program...') break - elif fromsite != pywikibot.getSite(): + elif fromsite != pywikibot.getSite(): featuredWithInterwiki(fromsite, pywikibot.getSite(), template_on_top, processType, quiet, pywikibot.simulate) @@ -649,6 +673,7 @@ if not nocache: pickle.dump(cache,file(filename,"wb")) + if __name__ == "__main__": try: main()
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
Older →
Jump to page:
1
2
3
4
5
6
7
8
Results per page:
10
25
50
100
200