http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9992
Revision: 9992 Author: xqt Date: 2012-03-10 17:58:48 +0000 (Sat, 10 Mar 2012) Log Message: ----------- re-use alphabetic sorting order from family.py, update from trunk r9991
Modified Paths: -------------- branches/rewrite/pywikibot/families/wikibooks_family.py branches/rewrite/pywikibot/families/wikiquote_family.py branches/rewrite/pywikibot/families/wikisource_family.py
Modified: branches/rewrite/pywikibot/families/wikibooks_family.py =================================================================== --- branches/rewrite/pywikibot/families/wikibooks_family.py 2012-03-10 17:57:57 UTC (rev 9991) +++ branches/rewrite/pywikibot/families/wikibooks_family.py 2012-03-10 17:58:48 UTC (rev 9992) @@ -28,21 +28,18 @@ # and what order is it? If a language is not in interwiki_putfirst, # alphabetical order on language code is used. For languages that are in # interwiki_putfirst, interwiki_putfirst is checked first, and - # languages are put in the order given there. All other languages are put - # after those, in code-alphabetical order. + # languages are put in the order given there. All other languages are + # put after those, in code-alphabetical order. + self.interwiki_putfirst = { + 'en': self.alphabetic, + 'fi': self.alphabetic, + 'fr': self.alphabetic, + 'he': ['en'], + 'hu': ['en'], + 'pl': self.alphabetic, + 'simple': self.alphabetic + }
- alphabetic = ['af', 'ar', 'roa-rup', 'om', 'bg', 'be', 'bn', 'bs', 'ca', - 'chr', 'co', 'cs', 'cy', 'da', 'de', 'als', 'et', 'el', - 'en', 'es', 'eo', 'eu', 'fa', 'fr', 'fy', 'gv', 'gd', - 'gl', 'ko', 'hi', 'hr', 'io', 'id', 'ia', 'is', 'it', - 'he', 'jv', 'ka', 'csb', 'sw', 'la', 'lv', 'lt', 'hu', - 'mk', 'mg', 'ml', 'mi', 'mr', 'ms', 'zh-cfr', 'mn', 'nah', - 'na', 'nl', 'ja', 'no', 'nb', 'oc', 'nds', 'pl', 'pt', - 'ro', 'ru', 'sa', 'st', 'sq', 'si', 'simple', 'sk', 'sl', - 'sr', 'su', 'fi', 'sv', 'ta', 'tt', 'th', 'ur', 'vi', - 'tpi', 'tr', 'uk', 'vo', 'yi', 'za', 'zh', 'zh-cn', - 'zh-tw'] - self.obsolete = { 'aa': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Afa... 'ak': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Aka... @@ -90,15 +87,6 @@ 'zu': None, # https://bugzilla.wikimedia.org/show_bug.cgi?id=25425 }
- self.interwiki_putfirst = { - 'en': alphabetic, - 'fi': alphabetic, - 'fr': alphabetic, - 'he': ['en'], - 'hu': ['en'], - 'pl': alphabetic, - 'simple': alphabetic - } # Global bot allowed languages on http://meta.wikimedia.org/wiki/Bot_policy/Implementation#Current_implementat... self.cross_allowed = ['af', 'ang', 'ca', 'fa', 'it', 'nl', 'ru', 'th', 'zh'] # CentralAuth cross avaliable projects.
Modified: branches/rewrite/pywikibot/families/wikiquote_family.py =================================================================== --- branches/rewrite/pywikibot/families/wikiquote_family.py 2012-03-10 17:57:57 UTC (rev 9991) +++ branches/rewrite/pywikibot/families/wikiquote_family.py 2012-03-10 17:58:48 UTC (rev 9992) @@ -54,34 +54,22 @@ 'wikipedia', 'wiktionary', 'wikibooks', 'wikisource', 'wikinews', 'wikiversity', 'meta', 'mediawiki', 'test', 'incubator', 'commons', 'species' ] + # Which languages have a special order for putting interlanguage links, # and what order is it? If a language is not in interwiki_putfirst, # alphabetical order on language code is used. For languages that are in # interwiki_putfirst, interwiki_putfirst is checked first, and - # languages are put in the order given there. All other languages are put - # after those, in code-alphabetical order. - - alphabetic = ['af','am','ang','ar','roa-rup','ast','az','bn', - 'zh-min-nan','bg','be','bs','br','ca','chr','co','cs','cy', - 'da','de','als','et','el','en','es','eo','eu','fa','fr', - 'fy','ga','gv','gu','gd','gl','ko','hy','hi','hr','io', - 'id','ia','is','it','he','jv','kn','ka','ks','csb','kk', - 'ky','sw','ku','la','lb','lt','li','hu','mk','mg','ml', - 'mi','mr','zh-cfr','mn','nah','na','nl','ja','no','nb', - 'nn','oc','om','nds','uz','pl','pt','ro','ru','sa','st', - 'sq','si','simple','sk','sl','sr','su','fi','sv','ta','tt', - 'te','th','ur','vi','tpi','tr','uk','vo','yi','yo','wo', - 'za','zh','zh-cn','zh-tw'] - + # languages are put in the order given there. All other languages are + # put after those, in code-alphabetical order. self.interwiki_putfirst = { - 'en': alphabetic, - 'fi': alphabetic, - 'fr': alphabetic, + 'en': self.alphabetic, + 'fi': self.alphabetic, + 'fr': self.alphabetic, 'he': ['en'], 'hu': ['en'], - 'pl': alphabetic, - 'simple': alphabetic, - 'pt': alphabetic, + 'pl': self.alphabetic, + 'simple': self.alphabetic, + 'pt': self.alphabetic, }
self.obsolete = {
Modified: branches/rewrite/pywikibot/families/wikisource_family.py =================================================================== --- branches/rewrite/pywikibot/families/wikisource_family.py 2012-03-10 17:57:57 UTC (rev 9991) +++ branches/rewrite/pywikibot/families/wikisource_family.py 2012-03-10 17:58:48 UTC (rev 9992) @@ -42,6 +42,12 @@ 'zh-cn': 'zh' }
+ # Which languages have a special order for putting interlanguage links, + # and what order is it? If a language is not in interwiki_putfirst, + # alphabetical order on language code is used. For languages that are in + # interwiki_putfirst, interwiki_putfirst is checked first, and + # languages are put in the order given there. All other languages are + # put after those, in code-alphabetical order. self.interwiki_putfirst = { 'en': self.alphabetic, 'fi': self.alphabetic, @@ -51,10 +57,24 @@ 'pl': self.alphabetic, 'simple': self.alphabetic } + + self.obsolete = { + 'ang': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Old... + 'dk': 'da', + 'ht': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Hai... + 'jp': 'ja', + 'minnan':'zh-min-nan', + 'nb': 'no', + 'tokipona': None, + 'zh-tw': 'zh', + 'zh-cn': 'zh' + } + # Global bot allowed languages on http://meta.wikimedia.org/wiki/Bot_policy/Implementation#Current_implementat... self.cross_allowed = [ 'el','fa','it','ko','no','vi','zh' ] + # CentralAuth cross avaliable projects. self.cross_projects = [ 'wikipedia', 'wiktionary', 'wikibooks', 'wikiquote', 'wikinews', 'wikiversity',
pywikipedia-svn@lists.wikimedia.org