http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9991
Revision: 9991 Author: xqt Date: 2012-03-10 17:57:57 +0000 (Sat, 10 Mar 2012) Log Message: ----------- re-use slphabetic sorting order from family.py
Modified Paths: -------------- trunk/pywikipedia/families/wikibooks_family.py trunk/pywikipedia/families/wikiquote_family.py trunk/pywikipedia/families/wikisource_family.py
Modified: trunk/pywikipedia/families/wikibooks_family.py =================================================================== --- trunk/pywikipedia/families/wikibooks_family.py 2012-03-10 17:56:00 UTC (rev 9990) +++ trunk/pywikipedia/families/wikibooks_family.py 2012-03-10 17:57:57 UTC (rev 9991) @@ -415,21 +415,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... @@ -477,15 +474,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: trunk/pywikipedia/families/wikiquote_family.py =================================================================== --- trunk/pywikipedia/families/wikiquote_family.py 2012-03-10 17:56:00 UTC (rev 9990) +++ trunk/pywikipedia/families/wikiquote_family.py 2012-03-10 17:57:57 UTC (rev 9991) @@ -287,34 +287,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: trunk/pywikipedia/families/wikisource_family.py =================================================================== --- trunk/pywikipedia/families/wikisource_family.py 2012-03-10 17:56:00 UTC (rev 9990) +++ trunk/pywikipedia/families/wikisource_family.py 2012-03-10 17:57:57 UTC (rev 9991) @@ -513,12 +513,21 @@ 'he': u'שיחת מפתח', }
- self.alphabetic = ['ang','ar','az','bg','bs','ca','cs','cy', - 'da','de','el','en','es','et','fa','fi', - 'fo','fr','gl','he','hr','ht','hu','id', - 'is','it','ja', 'ko','la','lt','ml','nl', - 'no','pl','pt','ro','ru','sk','sl','sr', - 'sv','te','th','tr','uk','vi','yi','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, + 'fr': self.alphabetic, + 'he': ['en'], + 'hu': ['en'], + 'pl': self.alphabetic, + 'simple': self.alphabetic + }
self.obsolete = { 'ang': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Old... @@ -532,16 +541,6 @@ 'zh-cn': 'zh' }
- self.interwiki_putfirst = { - 'en': self.alphabetic, - 'fi': self.alphabetic, - 'fr': self.alphabetic, - 'he': ['en'], - 'hu': ['en'], - 'pl': self.alphabetic, - 'simple': self.alphabetic - } - # 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'
pywikipedia-svn@lists.wikimedia.org