Revision: 8623 Author: malafaya Date: 2010-10-08 15:28:12 +0000 (Fri, 08 Oct 2010)
Log Message: ----------- * Fixing sort order in ms.wikt (expected to be same as ms.wiki) ** Moved alphabetic_revised and fyinterwiki sort orders to base family.py to allow reuse across projects (Wikipedia, Wiktionary...) * Fixed wrong sort order for 'no' interwikis at fy.wikt (was already fixed on fy.wiki)
Modified Paths: -------------- trunk/pywikipedia/families/wikipedia_family.py trunk/pywikipedia/families/wiktionary_family.py trunk/pywikipedia/family.py
Modified: trunk/pywikipedia/families/wikipedia_family.py =================================================================== --- trunk/pywikipedia/families/wikipedia_family.py 2010-10-08 06:59:35 UTC (rev 8622) +++ trunk/pywikipedia/families/wikipedia_family.py 2010-10-08 15:28:12 UTC (rev 8623) @@ -938,39 +938,6 @@ # but some languages don't use this. self.nocapitalize = ['jbo',]
- # A revised sorting order worked out on - # http://meta.wikimedia.org/wiki/Interwiki_sorting_order - self.alphabetic_revised = [ - 'ace', 'af', 'ak', 'als', 'am', 'ang', 'ab', 'ar', 'an', 'arc', - 'roa-rup', 'frp', 'as', 'ast', 'gn', 'av', 'ay', 'az', 'id', 'ms', - 'bm', 'bn', 'zh-min-nan', 'nan', 'map-bms', 'jv', 'su', 'ba', 'be', - 'be-x-old', 'bh', 'bcl', 'bi', 'bar', 'bo', 'bs', 'br', 'bug', 'bg', - 'bxr', 'ca', 'ceb', 'cv', 'cs', 'ch', 'cbk-zam', 'ny', 'sn', 'tum', - 'cho', 'co', 'cy', 'da', 'dk', 'pdc', 'de', 'dv', 'nv', 'dsb', 'na', - 'dz', 'mh', 'et', 'el', 'eml', 'en', 'myv', 'es', 'eo', 'ext', 'eu', - 'ee', 'fa', 'hif', 'fo', 'fr', 'fy', 'ff', 'fur', 'ga', 'gv', 'sm', - 'gd', 'gl', 'gan', 'ki', 'glk', 'gu', 'got', 'hak', 'xal', 'ko', - 'ha', 'haw', 'hy', 'hi', 'ho', 'hsb', 'hr', 'io', 'ig', 'ilo', - 'bpy', 'ia', 'ie', 'iu', 'ik', 'os', 'xh', 'zu', 'is', 'it', 'he', - 'kl', 'kn', 'kr', 'pam', 'ka', 'ks', 'csb', 'kk', 'kw', 'rw', 'ky', - 'rn', 'sw', 'kv', 'kg', 'ht', 'ku', 'kj', 'lad', 'lbe', 'lo', 'la', - 'lv', 'to', 'lb', 'lt', 'lij', 'li', 'ln', 'jbo', 'lg', 'lmo', 'hu', - 'mk', 'mg', 'ml', 'krc', 'mt', 'mi', 'mr', 'arz', 'mzn', 'cdo', - 'mwl', 'mdf', 'mo', 'mn', 'mus', 'my', 'nah', 'fj', 'nl', 'nds-nl', - 'cr', 'ne', 'new', 'ja', 'nap', 'ce', 'frr', 'pih', 'no', 'nb', - 'nn', 'nrm', 'nov', 'ii', 'oc', 'mhr', 'or', 'om', 'ng', 'hz', 'uz', - 'pa', 'pi', 'pag', 'pnb', 'pap', 'ps', 'km', 'pcd', 'pms', 'nds', - 'pl', 'pnt', 'pt', 'aa', 'kaa', 'crh', 'ty', 'ksh', 'ro', 'rmy', - 'rm', 'qu', 'ru', 'sah', 'se', 'sa', 'sg', 'sc', 'sco', 'stq', 'st', - 'tn', 'sq', 'scn', 'si', 'simple', 'sd', 'ss', 'sk', 'sl', 'cu', - 'szl', 'so', 'ckb', 'srn', 'sr', 'sh', 'fi', 'sv', 'tl', 'ta', - 'kab', 'roa-tara', 'tt', 'te', 'tet', 'th', 'vi', 'ti', 'tg', 'tpi', - 'tokipona', 'tp', 'chr', 'chy', 've', 'tr', 'tk', 'tw', 'udm', 'uk', - 'ur', 'ug', 'za', 'vec', 'vo', 'fiu-vro', 'wa', 'zh-classical', - 'vls', 'war', 'wo', 'wuu', 'ts', 'yi', 'yo', 'zh-yue', 'diq', 'zea', - 'bat-smg', 'zh', 'zh-tw', 'zh-cn', - ] - self.alphabetic_latin = [ 'ace', 'af', 'ak', 'als', 'am', 'ang', 'ab', 'ar', 'an', 'arc', 'roa-rup', 'frp', 'arz', 'as', 'ast', 'gn', 'av', 'ay', 'az', 'id', @@ -1002,16 +969,6 @@ 'zh-classical', 'zh-yue', 'bat-smg', ]
- # Order for fy: alphabetical by code, but y counts as i - - def fycomp(x,y): - x = x.replace("y","i")+x.count("y")*"!" - y = y.replace("y","i")+y.count("y")*"!" - return cmp(x,y) - self.fyinterwiki = self.alphabetic[:] - self.fyinterwiki.remove('nb') - self.fyinterwiki.sort(fycomp) - # 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
Modified: trunk/pywikipedia/families/wiktionary_family.py =================================================================== --- trunk/pywikipedia/families/wiktionary_family.py 2010-10-08 06:59:35 UTC (rev 8622) +++ trunk/pywikipedia/families/wiktionary_family.py 2010-10-08 15:28:12 UTC (rev 8623) @@ -472,15 +472,6 @@ 'zh-cn': 'zh' }
- # Order for fy: alphabetical by code, but y counts as i - # TODO: This code is duplicated from wikipedia_family.py - def fycomp(x,y): - x = x.replace("y","i")+x.count("y")*"!" - y = y.replace("y","i")+y.count("y")*"!" - return cmp(x,y) - self.fyinterwiki = self.alphabetic[:] - self.fyinterwiki.sort(fycomp) - # 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 @@ -496,6 +487,7 @@ 'fy': self.fyinterwiki, 'he': ['en'], 'hu': ['en'], + 'ms': self.alphabetic_revised, 'pl': self.alphabetic, 'simple': self.alphabetic }
Modified: trunk/pywikipedia/family.py =================================================================== --- trunk/pywikipedia/family.py 2010-10-08 06:59:35 UTC (rev 8622) +++ trunk/pywikipedia/family.py 2010-10-08 15:28:12 UTC (rev 8623) @@ -50,6 +50,49 @@ 'bat-smg', 'zh', 'zh-tw', 'zh-cn', ]
+ # A revised sorting order worked out on + # http://meta.wikimedia.org/wiki/Interwiki_sorting_order + self.alphabetic_revised = [ + 'ace', 'af', 'ak', 'als', 'am', 'ang', 'ab', 'ar', 'an', 'arc', + 'roa-rup', 'frp', 'as', 'ast', 'gn', 'av', 'ay', 'az', 'id', 'ms', + 'bm', 'bn', 'zh-min-nan', 'nan', 'map-bms', 'jv', 'su', 'ba', 'be', + 'be-x-old', 'bh', 'bcl', 'bi', 'bar', 'bo', 'bs', 'br', 'bug', 'bg', + 'bxr', 'ca', 'ceb', 'cv', 'cs', 'ch', 'cbk-zam', 'ny', 'sn', 'tum', + 'cho', 'co', 'cy', 'da', 'dk', 'pdc', 'de', 'dv', 'nv', 'dsb', 'na', + 'dz', 'mh', 'et', 'el', 'eml', 'en', 'myv', 'es', 'eo', 'ext', 'eu', + 'ee', 'fa', 'hif', 'fo', 'fr', 'fy', 'ff', 'fur', 'ga', 'gv', 'sm', + 'gd', 'gl', 'gan', 'ki', 'glk', 'gu', 'got', 'hak', 'xal', 'ko', + 'ha', 'haw', 'hy', 'hi', 'ho', 'hsb', 'hr', 'io', 'ig', 'ilo', + 'bpy', 'ia', 'ie', 'iu', 'ik', 'os', 'xh', 'zu', 'is', 'it', 'he', + 'kl', 'kn', 'kr', 'pam', 'ka', 'ks', 'csb', 'kk', 'kw', 'rw', 'ky', + 'rn', 'sw', 'kv', 'kg', 'ht', 'ku', 'kj', 'lad', 'lbe', 'lo', 'la', + 'lv', 'to', 'lb', 'lt', 'lij', 'li', 'ln', 'jbo', 'lg', 'lmo', 'hu', + 'mk', 'mg', 'ml', 'krc', 'mt', 'mi', 'mr', 'arz', 'mzn', 'cdo', + 'mwl', 'mdf', 'mo', 'mn', 'mus', 'my', 'nah', 'fj', 'nl', 'nds-nl', + 'cr', 'ne', 'new', 'ja', 'nap', 'ce', 'frr', 'pih', 'no', 'nb', + 'nn', 'nrm', 'nov', 'ii', 'oc', 'mhr', 'or', 'om', 'ng', 'hz', 'uz', + 'pa', 'pi', 'pag', 'pnb', 'pap', 'ps', 'km', 'pcd', 'pms', 'nds', + 'pl', 'pnt', 'pt', 'aa', 'kaa', 'crh', 'ty', 'ksh', 'ro', 'rmy', + 'rm', 'qu', 'ru', 'sah', 'se', 'sa', 'sg', 'sc', 'sco', 'stq', 'st', + 'tn', 'sq', 'scn', 'si', 'simple', 'sd', 'ss', 'sk', 'sl', 'cu', + 'szl', 'so', 'ckb', 'srn', 'sr', 'sh', 'fi', 'sv', 'tl', 'ta', + 'kab', 'roa-tara', 'tt', 'te', 'tet', 'th', 'vi', 'ti', 'tg', 'tpi', + 'tokipona', 'tp', 'chr', 'chy', 've', 'tr', 'tk', 'tw', 'udm', 'uk', + 'ur', 'ug', 'za', 'vec', 'vo', 'fiu-vro', 'wa', 'zh-classical', + 'vls', 'war', 'wo', 'wuu', 'ts', 'yi', 'yo', 'zh-yue', 'diq', 'zea', + 'bat-smg', 'zh', 'zh-tw', 'zh-cn', + ] + + # Order for fy: alphabetical by code, but y counts as i + def fycomp(x,y): + x = x.replace("y","i")+x.count("y")*"!" + y = y.replace("y","i")+y.count("y")*"!" + return cmp(x,y) + self.fyinterwiki = self.alphabetic[:] + self.fyinterwiki.remove('nb') + self.fyinterwiki.sort(fycomp) + + self.langs = {}
# The timedelta to GMT of the server.
pywikipedia-svn@lists.wikimedia.org