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
----- 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
5163 discussions
Start a n
N
ew thread
SVN: [11672] trunk/pywikipedia/families
by xqt@svn.wikimedia.org
19 Jun '13
19 Jun '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11672
Revision: 11672 Author: xqt Date: 2013-06-19 15:27:22 +0000 (Wed, 19 Jun 2013) Log Message: ----------- update language_by_size Modified Paths: -------------- trunk/pywikipedia/families/wikibooks_family.py trunk/pywikipedia/families/wikinews_family.py trunk/pywikipedia/families/wikipedia_family.py trunk/pywikipedia/families/wiktionary_family.py Modified: trunk/pywikipedia/families/wikibooks_family.py =================================================================== --- trunk/pywikipedia/families/wikibooks_family.py 2013-06-19 15:06:07 UTC (rev 11671) +++ trunk/pywikipedia/families/wikibooks_family.py 2013-06-19 15:27:22 UTC (rev 11672) @@ -15,8 +15,8 @@ 'id', 'sq', 'ca', 'fi', 'ru', 'cs', 'zh', 'sv', 'hr', 'tr', 'da', 'no', 'th', 'sr', 'gl', 'ko', 'fa', 'vi', 'ta', 'ar', 'mk', 'tl', 'ro', 'is', 'tt', 'lt', 'ka', 'az', 'eo', 'uk', 'sk', 'bg', 'el', - 'hy', 'sl', 'si', 'li', 'ms', 'la', 'ang', 'ia', 'cv', 'ur', 'et', - 'mr', 'bn', 'ml', 'hi', 'oc', 'kk', 'km', 'eu', 'fy', 'ie', 'ne', + 'hy', 'sl', 'si', 'ms', 'li', 'la', 'ang', 'ia', 'cv', 'ur', 'et', + 'ml', 'mr', 'bn', 'hi', 'oc', 'kk', 'km', 'eu', 'fy', 'ie', 'ne', 'sa', 'te', 'af', 'tg', 'ky', 'bs', 'pa', 'mg', 'be', 'cy', 'zh-min-nan', 'ku', 'uz', ] Modified: trunk/pywikipedia/families/wikinews_family.py =================================================================== --- trunk/pywikipedia/families/wikinews_family.py 2013-06-19 15:06:07 UTC (rev 11671) +++ trunk/pywikipedia/families/wikinews_family.py 2013-06-19 15:27:22 UTC (rev 11672) @@ -12,8 +12,8 @@ self.languages_by_size = [ 'sr', 'en', 'fr', 'pl', 'de', 'it', 'es', 'pt', 'ru', 'zh', 'ja', - 'sv', 'ca', 'el', 'ta', 'cs', 'ar', 'fa', 'fi', 'ro', 'tr', 'he', - 'uk', 'bg', 'sq', 'no', 'ko', 'bs', 'eo', + 'sv', 'ca', 'el', 'ta', 'cs', 'ar', 'fa', 'fi', 'uk', 'ro', 'tr', + 'he', 'bg', 'sq', 'no', 'ko', 'bs', 'eo', ] self.langs = dict([(lang, '%s.wikinews.org' % lang) Modified: trunk/pywikipedia/families/wikipedia_family.py =================================================================== --- trunk/pywikipedia/families/wikipedia_family.py 2013-06-19 15:06:07 UTC (rev 11671) +++ trunk/pywikipedia/families/wikipedia_family.py 2013-06-19 15:27:22 UTC (rev 11672) @@ -11,29 +11,29 @@ self.name = 'wikipedia' self.languages_by_size = [ - 'en', 'de', 'nl', 'fr', 'it', 'es', 'ru', 'sv', 'pl', 'ja', 'pt', + 'en', 'nl', 'de', 'fr', 'it', 'sv', 'es', 'ru', 'pl', 'ja', 'pt', 'vi', 'zh', 'uk', 'ca', 'no', 'war', 'ceb', 'fi', 'fa', 'cs', 'hu', 'ko', 'ar', 'ro', 'ms', 'tr', 'id', 'kk', 'sr', 'sk', 'eo', 'da', 'lt', 'eu', 'bg', 'he', 'hr', 'sl', 'uz', 'vo', 'et', 'hi', 'nn', - 'gl', 'simple', 'az', 'la', 'el', 'sh', 'th', 'ka', 'mk', 'oc', + 'gl', 'simple', 'az', 'la', 'el', 'sh', 'th', 'ka', 'oc', 'mk', 'new', 'pms', 'tl', 'be', 'ta', 'ht', 'te', 'be-x-old', 'lv', 'cy', 'hy', 'bs', 'br', 'sq', 'tt', 'jv', 'mg', 'mr', 'lb', 'is', 'my', 'ml', 'ba', 'yo', 'an', 'lmo', 'af', 'fy', 'pnb', 'bn', 'sw', 'bpy', 'io', 'ky', 'ur', 'ne', 'zh-yue', 'scn', 'gu', 'nds', 'ga', 'ku', - 'ast', 'qu', 'su', 'cv', 'sco', 'als', 'ia', 'nap', 'bug', + 'ast', 'qu', 'cv', 'su', 'sco', 'als', 'ia', 'nap', 'bug', 'bat-smg', 'kn', 'map-bms', 'wa', 'am', 'ckb', 'gd', 'hif', - 'zh-min-nan', 'tg', 'arz', 'mzn', 'yi', 'vec', 'mn', 'sah', 'nah', + 'zh-min-nan', 'tg', 'arz', 'mzn', 'yi', 'vec', 'sah', 'mn', 'nah', 'roa-tara', 'sa', 'os', 'pam', 'hsb', 'si', 'bar', 'se', 'li', 'mi', - 'co', 'pa', 'fo', 'ilo', 'gan', 'bo', 'glk', 'rue', 'bcl', + 'pa', 'co', 'fo', 'ilo', 'gan', 'bo', 'glk', 'rue', 'bcl', 'fiu-vro', 'mrj', 'nds-nl', 'tk', 'ps', 'vls', 'xmf', 'gv', 'diq', - 'min', 'or', 'kv', 'pag', 'km', 'zea', 'dv', 'nrm', 'mhr', 'rm', - 'koi', 'csb', 'udm', 'frr', 'vep', 'lad', 'wuu', 'lij', 'fur', - 'zh-classical', 'sc', 'ug', 'stq', 'ay', 'mt', 'pi', 'so', 'bh', - 'ksh', 'nov', 'hak', 'ang', 'kw', 'pcd', 'nv', 'gn', 'ext', 'as', - 'ce', 'frp', 'szl', 'eml', 'ace', 'gag', 'ie', 'ln', 'pfl', 'krc', + 'min', 'or', 'kv', 'pag', 'zea', 'km', 'dv', 'nrm', 'mhr', 'rm', + 'csb', 'koi', 'udm', 'vep', 'frr', 'lad', 'wuu', 'lij', 'fur', + 'zh-classical', 'sc', 'ug', 'stq', 'mt', 'ay', 'pi', 'so', 'bh', + 'ksh', 'nov', 'ce', 'hak', 'ang', 'kw', 'pcd', 'nv', 'gn', 'ext', + 'as', 'frp', 'szl', 'ace', 'eml', 'gag', 'ie', 'ln', 'pfl', 'krc', 'xal', 'haw', 'pdc', 'rw', 'crh', 'to', 'dsb', 'kl', 'arc', 'myv', 'lez', 'kab', 'bjn', 'sn', 'pap', 'tpi', 'lbe', 'wo', 'mwl', 'jbo', - 'cbk-zam', 'mdf', 'av', 'kbd', 'srn', 'ty', 'lo', 'ab', 'kg', 'tet', + 'mdf', 'cbk-zam', 'kbd', 'av', 'srn', 'ty', 'lo', 'ab', 'kg', 'tet', 'ltg', 'na', 'ig', 'bxr', 'nso', 'za', 'kaa', 'zu', 'chy', 'rmy', 'cu', 'tn', 'chr', 'roa-rup', 'bi', 'cdo', 'got', 'sm', 'bm', 'iu', 'pih', 'pnt', 'sd', 'ss', 'ki', 'ee', 'ha', 'om', 'fj', 'ti', 'ts', Modified: trunk/pywikipedia/families/wiktionary_family.py =================================================================== --- trunk/pywikipedia/families/wiktionary_family.py 2013-06-19 15:06:07 UTC (rev 11671) +++ trunk/pywikipedia/families/wiktionary_family.py 2013-06-19 15:27:22 UTC (rev 11672) @@ -14,13 +14,13 @@ 'en', 'mg', 'fr', 'zh', 'lt', 'ru', 'el', 'pl', 'ko', 'sv', 'tr', 'ta', 'nl', 'ku', 'de', 'kn', 'vi', 'fi', 'io', 'hu', 'pt', 'ml', 'no', 'my', 'id', 'it', 'es', 'li', 'et', 'ja', 'te', 'fa', 'ro', - 'cs', 'ar', 'jv', 'eu', 'gl', 'lo', 'ca', 'uk', 'fj', 'br', 'bg', + 'cs', 'ar', 'eu', 'jv', 'gl', 'ca', 'lo', 'uk', 'fj', 'br', 'bg', 'eo', 'hr', 'oc', 'is', 'vo', 'th', 'zh-min-nan', 'simple', 'cy', 'ps', 'scn', 'sr', 'af', 'ast', 'sw', 'fy', 'tl', 'he', 'nn', 'da', 'uz', 'ur', 'wa', 'la', 'hy', 'sq', 'sm', 'nah', 'sl', 'hi', 'ka', 'pnb', 'az', 'tt', 'bs', 'lv', 'lb', 'tk', 'hsb', 'kk', 'sk', 'km', - 'mk', 'be', 'nds', 'ga', 'wo', 'ms', 'ang', 'ky', 'co', 'gn', 'mr', - 'csb', 'st', 'ia', 'sd', 'sa', 'si', 'sh', 'tg', 'ug', 'mn', 'kl', + 'nds', 'mk', 'be', 'ga', 'wo', 'ms', 'ang', 'ky', 'co', 'gn', 'mr', + 'csb', 'st', 'ia', 'sa', 'sd', 'si', 'sh', 'tg', 'ug', 'mn', 'kl', 'jbo', 'or', 'an', 'ln', 'zu', 'fo', 'gu', 'kw', 'gv', 'rw', 'qu', 'ss', 'vec', 'ie', 'mt', 'om', 'chr', 'roa-rup', 'iu', 'bn', 'pa', 'so', 'am', 'su', 'za', 'gd', 'mi', 'tpi', 'ne', 'yi', 'ti', 'sg',
1
0
0
0
SVN: [11671] trunk/pywikipedia/families/wikidata_family.py
by xqt@svn.wikimedia.org
19 Jun '13
19 Jun '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11671
Revision: 11671 Author: xqt Date: 2013-06-19 15:06:07 +0000 (Wed, 19 Jun 2013) Log Message: ----------- update namespace aliases Modified Paths: -------------- trunk/pywikipedia/families/wikidata_family.py Modified: trunk/pywikipedia/families/wikidata_family.py =================================================================== --- trunk/pywikipedia/families/wikidata_family.py 2013-06-19 15:04:13 UTC (rev 11670) +++ trunk/pywikipedia/families/wikidata_family.py 2013-06-19 15:06:07 UTC (rev 11671) @@ -46,12 +46,6 @@ self.namespaces[103] = { 'repo': u'Property talk', } - self.namespaces[104] = { - 'repo': u'Query', - } - self.namespaces[105] = { - 'repo': u'Query talk', - } self.namespaces[120] = { 'wikidata': u'Property', }
1
0
0
0
SVN: [11670] trunk/pywikipedia/families/meta_family.py
by xqt@svn.wikimedia.org
19 Jun '13
19 Jun '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11670
Revision: 11670 Author: xqt Date: 2013-06-19 15:04:13 +0000 (Wed, 19 Jun 2013) Log Message: ----------- update namespace aliases Modified Paths: -------------- trunk/pywikipedia/families/meta_family.py Modified: trunk/pywikipedia/families/meta_family.py =================================================================== --- trunk/pywikipedia/families/meta_family.py 2013-06-19 14:59:04 UTC (rev 11669) +++ trunk/pywikipedia/families/meta_family.py 2013-06-19 15:04:13 UTC (rev 11670) @@ -45,6 +45,12 @@ self.namespaces[207] = { '_default': u'Iberocoop talk', } + self.namespaces[208] = { + '_default': u'Programs', + } + self.namespaces[209] = { + '_default': u'Programs talk', + } self.namespaces[470] = { '_default': u'Schema', }
1
0
0
0
SVN: [11669] branches/rewrite/pywikibot/family.py
by xqt@svn.wikimedia.org
19 Jun '13
19 Jun '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11669
Revision: 11669 Author: xqt Date: 2013-06-19 14:59:04 +0000 (Wed, 19 Jun 2013) Log Message: ----------- mw 1.22wmf6 Modified Paths: -------------- branches/rewrite/pywikibot/family.py Modified: branches/rewrite/pywikibot/family.py =================================================================== --- branches/rewrite/pywikibot/family.py 2013-06-19 14:58:26 UTC (rev 11668) +++ branches/rewrite/pywikibot/family.py 2013-06-19 14:59:04 UTC (rev 11669) @@ -937,7 +937,7 @@ """Return Wikimedia projects version number as a string.""" # Don't use this, use versionnumber() instead. This only exists # to not break family files. - return '1.22wmf5' + return '1.22wmf6' def shared_image_repository(self, code): return ('commons', 'commons')
1
0
0
0
SVN: [11668] trunk/pywikipedia/family.py
by xqt@svn.wikimedia.org
19 Jun '13
19 Jun '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11668
Revision: 11668 Author: xqt Date: 2013-06-19 14:58:26 +0000 (Wed, 19 Jun 2013) Log Message: ----------- mw 1.22wmf6 Modified Paths: -------------- trunk/pywikipedia/family.py Modified: trunk/pywikipedia/family.py =================================================================== --- trunk/pywikipedia/family.py 2013-06-18 19:58:27 UTC (rev 11667) +++ trunk/pywikipedia/family.py 2013-06-19 14:58:26 UTC (rev 11668) @@ -4712,7 +4712,7 @@ """Return Wikimedia projects version number as a string.""" # Don't use this, use versionnumber() instead. This only exists # to not break family files. - return '1.22wmf5' + return '1.22wmf6' def shared_image_repository(self, code): return ('commons', 'commons')
1
0
0
0
SVN: [11667] branches/rewrite
by legoktm@svn.wikimedia.org
18 Jun '13
18 Jun '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11667
Revision: 11667 Author: legoktm Date: 2013-06-18 19:58:27 +0000 (Tue, 18 Jun 2013) Log Message: ----------- Revert r11666, replace all uses of simplejson with default json module Modified Paths: -------------- branches/rewrite/scripts/claimit.py branches/rewrite/scripts/harvest_template.py branches/rewrite/setup.py Modified: branches/rewrite/scripts/claimit.py =================================================================== --- branches/rewrite/scripts/claimit.py 2013-06-18 08:32:38 UTC (rev 11666) +++ branches/rewrite/scripts/claimit.py 2013-06-18 19:58:27 UTC (rev 11667) @@ -14,7 +14,7 @@ Then list the property-->target pairs to add. """ -import simplejson +import json import pywikibot from pywikibot import pagegenerators @@ -40,7 +40,7 @@ Get the source ''' page = pywikibot.Page(self.repo, 'Wikidata:List of wikis/python') - source_values = simplejson.loads(page.get()) + source_values = json.loads(page.get()) source_values = source_values['wikipedia'] for lang in source_values: source_values[lang] = pywikibot.ItemPage(self.repo, source_values[lang]) Modified: branches/rewrite/scripts/harvest_template.py =================================================================== --- branches/rewrite/scripts/harvest_template.py 2013-06-18 08:32:38 UTC (rev 11666) +++ branches/rewrite/scripts/harvest_template.py 2013-06-18 19:58:27 UTC (rev 11667) @@ -18,7 +18,7 @@ """ import re -import simplejson +import json import pywikibot from pywikibot import pagegenerators @@ -47,7 +47,7 @@ Get the source ''' page = pywikibot.Page(self.repo, 'Wikidata:List of wikis/python') - source_values = simplejson.loads(page.get()) + source_values = json.loads(page.get()) source_values = source_values['wikipedia'] for lang in source_values: source_values[lang] = pywikibot.ItemPage(self.repo, source_values[lang]) Modified: branches/rewrite/setup.py =================================================================== --- branches/rewrite/setup.py 2013-06-18 08:32:38 UTC (rev 11666) +++ branches/rewrite/setup.py 2013-06-18 19:58:27 UTC (rev 11667) @@ -19,7 +19,7 @@ if sys.version_info[1] < 6: raise RuntimeError("ERROR: Pywikipediabot only runs under Python 2.6 or higher") else: - depend = ['httplib2>=0.6.0', 'simplejson'] + depend = ['httplib2>=0.6.0'] setup(name='Pywikipediabot', version='2.0alpha',
1
0
0
0
SVN: [11666] branches/rewrite/setup.py
by legoktm@svn.wikimedia.org
18 Jun '13
18 Jun '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11666
Revision: 11666 Author: legoktm Date: 2013-06-18 08:32:38 +0000 (Tue, 18 Jun 2013) Log Message: ----------- Add simplejson as a required module Modified Paths: -------------- branches/rewrite/setup.py Modified: branches/rewrite/setup.py =================================================================== --- branches/rewrite/setup.py 2013-06-18 08:10:08 UTC (rev 11665) +++ branches/rewrite/setup.py 2013-06-18 08:32:38 UTC (rev 11666) @@ -19,7 +19,7 @@ if sys.version_info[1] < 6: raise RuntimeError("ERROR: Pywikipediabot only runs under Python 2.6 or higher") else: - depend = ['httplib2>=0.6.0'] + depend = ['httplib2>=0.6.0', 'simplejson'] setup(name='Pywikipediabot', version='2.0alpha',
1
0
0
0
SVN: [11665] branches/rewrite/scripts/harvest_template.py
by legoktm@svn.wikimedia.org
18 Jun '13
18 Jun '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11665
Revision: 11665 Author: legoktm Date: 2013-06-18 08:10:08 +0000 (Tue, 18 Jun 2013) Log Message: ----------- Use central list for source values, which was implemented for claimit in r11642 Modified Paths: -------------- branches/rewrite/scripts/harvest_template.py Modified: branches/rewrite/scripts/harvest_template.py =================================================================== --- branches/rewrite/scripts/harvest_template.py 2013-06-18 08:00:37 UTC (rev 11664) +++ branches/rewrite/scripts/harvest_template.py 2013-06-18 08:10:08 UTC (rev 11665) @@ -18,6 +18,7 @@ """ import re +import simplejson import pywikibot from pywikibot import pagegenerators @@ -45,25 +46,11 @@ ''' Get the source ''' - source_values = {'en': pywikibot.ItemPage(self.repo, 'Q328'), - 'sv': pywikibot.ItemPage(self.repo, 'Q169514'), - 'de': pywikibot.ItemPage(self.repo, 'Q48183'), - 'it': pywikibot.ItemPage(self.repo, 'Q11920'), - 'no': pywikibot.ItemPage(self.repo, 'Q191769'), - 'fa': pywikibot.ItemPage(self.repo, 'Q48952'), - 'ar': pywikibot.ItemPage(self.repo, 'Q199700'), - 'es': pywikibot.ItemPage(self.repo, 'Q8449'), - 'pl': pywikibot.ItemPage(self.repo, 'Q1551807'), - 'ca': pywikibot.ItemPage(self.repo, 'Q199693'), - 'fr': pywikibot.ItemPage(self.repo, 'Q8447'), - 'nl': pywikibot.ItemPage(self.repo, 'Q10000'), - 'pt': pywikibot.ItemPage(self.repo, 'Q11921'), - 'ru': pywikibot.ItemPage(self.repo, 'Q206855'), - 'vi': pywikibot.ItemPage(self.repo, 'Q200180'), - 'be': pywikibot.ItemPage(self.repo, 'Q877583'), - 'uk': pywikibot.ItemPage(self.repo, 'Q199698'), - 'tr': pywikibot.ItemPage(self.repo, 'Q58255'), - } # TODO: Should be moved to a central wikidata library + page = pywikibot.Page(self.repo, 'Wikidata:List of wikis/python') + source_values = simplejson.loads(page.get()) + source_values = source_values['wikipedia'] + for lang in source_values: + source_values[lang] = pywikibot.ItemPage(self.repo, source_values[lang]) if lang in source_values: self.source = pywikibot.Claim(self.repo, 'p143')
1
0
0
0
SVN: [11664] branches/rewrite/scripts/harvest_template.py
by legoktm@svn.wikimedia.org
18 Jun '13
18 Jun '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11664
Revision: 11664 Author: legoktm Date: 2013-06-18 08:00:37 +0000 (Tue, 18 Jun 2013) Log Message: ----------- Enable support for harvesting string properties Modified Paths: -------------- branches/rewrite/scripts/harvest_template.py Modified: branches/rewrite/scripts/harvest_template.py =================================================================== --- branches/rewrite/scripts/harvest_template.py 2013-06-18 07:43:45 UTC (rev 11663) +++ branches/rewrite/scripts/harvest_template.py 2013-06-18 08:00:37 UTC (rev 11664) @@ -100,24 +100,32 @@ pywikibot.output(u'A claim for %s already exists. Skipping' % (claim.getID(),)) #TODO FIXME: This is a very crude way of dupe checking else: - # Try to extract a valid page - match = re.search(pywikibot.link_regex, value) - if match: - try: - link = pywikibot.Link(match.group(1)) - linkedPage = pywikibot.Page(link) - if linkedPage.isRedirectPage(): - linkedPage = linkedPage.getRedirectTarget() - linkedItem = pywikibot.ItemPage.fromPage(linkedPage) - claim.setTarget(linkedItem) - pywikibot.output('Adding %s --> %s' % (claim.getID(), claim.getTarget().getID())) - item.addClaim(claim) - if self.source: - claim.addSource(self.source, bot=True) - except pywikibot.exceptions.NoPage: - pywikibot.output('[[%s]] doesn\'t exist so I can\'t link to it' % (linkedItem.title(),)) - + if claim.getType() == 'wikibase-item': + # Try to extract a valid page + match = re.search(pywikibot.link_regex, value) + if match: + try: + link = pywikibot.Link(match.group(1)) + linkedPage = pywikibot.Page(link) + if linkedPage.isRedirectPage(): + linkedPage = linkedPage.getRedirectTarget() + linkedItem = pywikibot.ItemPage.fromPage(linkedPage) + claim.setTarget(linkedItem) + except pywikibot.exceptions.NoPage: + pywikibot.output('[[%s]] doesn\'t exist so I can\'t link to it' % (linkedItem.title(),)) + continue + elif claim.getType() == 'string': + claim.setTarget(value.strip()) + else: + print "%s is not a supported datatype." % claim.getType() + continue + pywikibot.output('Adding %s --> %s' % (claim.getID(), claim.getTarget())) + item.addClaim(claim) + if self.source: + claim.addSource(self.source, bot=True) + + def main(): gen = pagegenerators.GeneratorFactory() commandline_arguments = list()
1
0
0
0
SVN: [11663] branches/rewrite/pywikibot/families/wikidata_family.py
by legoktm@svn.wikimedia.org
18 Jun '13
18 Jun '13
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11663
Revision: 11663 Author: legoktm Date: 2013-06-18 07:43:45 +0000 (Tue, 18 Jun 2013) Log Message: ----------- Add
test.wikidata.org
Modified Paths: -------------- branches/rewrite/pywikibot/families/wikidata_family.py Modified: branches/rewrite/pywikibot/families/wikidata_family.py =================================================================== --- branches/rewrite/pywikibot/families/wikidata_family.py 2013-06-18 07:30:56 UTC (rev 11662) +++ branches/rewrite/pywikibot/families/wikidata_family.py 2013-06-18 07:43:45 UTC (rev 11663) @@ -6,6 +6,7 @@ # The wikidata family + class Family(family.WikimediaFamily): def __init__(self): super(Family, self).__init__() @@ -14,6 +15,7 @@ 'wikidata': '
www.wikidata.org
', 'repo': 'wikidata-test-repo.wikimedia.de', 'client': 'wikidata-test-client.wikimedia.de', + 'test': '
test.wikidata.org
', } def shared_data_repository(self, code, transcluded=False): @@ -22,10 +24,14 @@ """ if transcluded: - return(None, None) + return (None, None) else: - return ('wikidata', - 'wikidata') if code == 'wikidata' else ('repo', 'wikidata') + if code == 'wikidata': + return ('wikidata', 'wikidata') + elif code == 'test': + return ('test', 'wikidata') + else: + return ('repo', 'wikidata') def globes(self, code): """Supported globes for Coordinate datatype"""
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
517
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
Results per page:
10
25
50
100
200