[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Fix authentication of flickrripper.py

2017-09-14 Thread Multichill (Code Review)
Multichill has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/378066 )

Change subject: Fix authentication of flickrripper.py
..

Fix authentication of flickrripper.py

No need to get a token anymore. The underlying library handles
all the oauth stuff.

Bug: T173348
Change-Id: Ic177c3c9c960ced22f059436bdc876770fd4e65a
---
M scripts/flickrripper.py
1 file changed, 0 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/66/378066/1

diff --git a/scripts/flickrripper.py b/scripts/flickrripper.py
index 7fd1fb1..8afd672 100755
--- a/scripts/flickrripper.py
+++ b/scripts/flickrripper.py
@@ -431,12 +431,6 @@
 
 if 'api_secret' in config.flickr and config.flickr['api_secret']:
 flickr = flickrapi.FlickrAPI(config.flickr['api_key'], 
config.flickr['api_secret'])
-(token, frob) = flickr.get_token_part_one(perms='read')
-if not token:
-# The user still hasn't authorised this app yet, 
get_token_part_one()
-# will have spawn a browser window
-pywikibot.input("Press ENTER after you authorized this program")
-flickr.get_token_part_two((token, frob))
 else:
 pywikibot.output('Accessing public content only')
 flickr = flickrapi.FlickrAPI(config.flickr['api_key'])

-- 
To view, visit https://gerrit.wikimedia.org/r/378066
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic177c3c9c960ced22f059436bdc876770fd4e65a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Adding the domain for the Bayerische Staatsgemäldesammlungen

2017-05-27 Thread Multichill (Code Review)
Multichill has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/355881 )

Change subject: Adding the domain for the Bayerische Staatsgemäldesammlungen
..

Adding the domain for the Bayerische Staatsgemäldesammlungen

A lot of freely licensed pretty pictures at 
https://www.sammlung.pinakothek.de/en/

Bug: T166437
Change-Id: I0873bfed0c48d7f21c7584d08944e29de244f33e
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/81/355881/1

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 4711cb8..68e32bf 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12840,6 +12840,7 @@
'finds.org.uk', // Portable Antiquities 
Scheme - T155844
'images.metmuseum.org', // MET - T156855
'*.esa.int',// ESA - T164643
+   'media.static.onlinesammlung.thenetexperts.info',  // 
Bayerische Staatsgemäldesammlungen - T166437
],
 ],
 

-- 
To view, visit https://gerrit.wikimedia.org/r/355881
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0873bfed0c48d7f21c7584d08944e29de244f33e
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Unbreak wbGeoShape and WbTabularData

2017-05-26 Thread Multichill (Code Review)
Multichill has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/355812 )

Change subject: Unbreak wbGeoShape and WbTabularData
..

Unbreak wbGeoShape and WbTabularData

Bug: T166362
Change-Id: Ib23c9b9ba5f7d64057ea7fbdc8d2924a80372b6f
---
M pywikibot/__init__.py
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/12/355812/1

diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 7e30990..42ac0dd 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -994,7 +994,7 @@
 return self.page.title()
 
 @classmethod
-def fromWikibase(cls, page_name, site, data_site):
+def fromWikibase(cls, page_name, site=None, data_site=None):
 """
 Create a _WbDataPage from the JSON data given by the Wikibase API.
 
@@ -1004,7 +1004,8 @@
 @type site: pywikibot.site.DataSite
 @rtype: pywikibot._WbDataPage
 """
-data_site = cls._get_data_site(site)
+site = site or Site().data_repository()
+data_site = data_site or cls._get_data_site(site)
 page = Page(data_site, page_name)
 return cls(page, site)
 

-- 
To view, visit https://gerrit.wikimedia.org/r/355812
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib23c9b9ba5f7d64057ea7fbdc8d2924a80372b6f
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Introduce the new WbUnknown data type for Wikibase This can ...

2017-05-21 Thread Multichill (Code Review)
Multichill has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354968 )

Change subject: Introduce the new WbUnknown data type for Wikibase This can be 
used later to store claims with an unknown data type.
..

Introduce the new WbUnknown data type for Wikibase
This can be used later to store claims with an unknown data type.

Bug: T165961
Change-Id: Ib65eb0f34cffa3c058c4e01ff79c145002310b2a
---
M pywikibot/__init__.py
M tests/wikibase_tests.py
2 files changed, 67 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/68/354968/1

diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 8a1ea57..f5637b0 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -1024,6 +1024,47 @@
 return cls(page, site)
 
 
+class WbUnknown(_WbRepresentation):
+"""
+A Wikibase representation for unknown data type.
+This will prevent the bot from breaking completely when a new type
+is introduced. 
+
+This data type is just a json container
+"""
+
+_items = ('json')
+
+def __init__(self, json):
+"""
+Create a new WbUnknown object.
+
+@param json: Wikibase JSON
+@type: dict
+"""
+self.json = json
+
+def toWikibase(self):
+"""
+Return the JSON object for the Wikibase API.
+
+@return: Wikibase JSON
+@rtype: dict
+"""
+return self.json
+
+@classmethod
+def fromWikibase(cls, json):
+"""
+Create a WbUnknown from the JSON data given by the Wikibase API.
+
+@param json: Wikibase JSON
+@type json: dict
+@rtype: pywikibot.WbUnknown
+"""
+return cls(json)
+
+
 _sites = {}
 _url_cache = {}  # The code/fam pair for each URL
 
diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index d66a9d9..32138bb 100644
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -746,6 +746,32 @@
   non_map_page, self.get_repo())
 
 
+class TestWbUnknown(WikidataTestCase):
+
+"""Test Wikibase WbUnknown data type."""
+
+dry = True
+
+def test_WbUnknown_string(self):
+"""Test WbUnknown string."""
+q_dict = {'text': 'Test that basics work', 'language': 'en'}
+q = pywikibot.WbUnknown(q_dict)
+self.assertEqual(q.toWikibase(), q_dict)
+
+def test_WbUnknown_equality(self):
+"""Test WbUnknown equality."""
+q_dict = {'text': 'Thou shall test this!', 'language': 'unknown'}
+q = pywikibot.WbUnknown(q_dict)
+self.assertEqual(q, q)
+
+def test_WbUnknown_fromWikibase(self):
+"""Test WbUnknown.fromWikibase() instantiating."""
+q = pywikibot.WbUnknown.fromWikibase({'text': 'Test this!',
+  'language': u'en'})
+self.assertEqual(q.toWikibase(),
+ {'text': 'Test this!', 'language': 'en'})
+
+
 class TestItemPageExtensibility(TestCase):
 
 """Test ItemPage extensibility."""

-- 
To view, visit https://gerrit.wikimedia.org/r/354968
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib65eb0f34cffa3c058c4e01ff79c145002310b2a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Page might have been moved without redirect or deleted. Test...

2017-05-20 Thread Multichill (Code Review)
Multichill has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354719 )

Change subject: Page might have been moved without redirect or deleted. Test if 
the page actually exists.
..

Page might have been moved without redirect or deleted.
Test if the page actually exists.

Bug: T86491
Change-Id: Id5b6b0799bcac2aa69b26e9e8a7dd86e282f95c9
---
M scripts/newitem.py
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/19/354719/1

diff --git a/scripts/newitem.py b/scripts/newitem.py
index 5ee4901..ffdb423 100755
--- a/scripts/newitem.py
+++ b/scripts/newitem.py
@@ -94,6 +94,9 @@
 
 self.current_page = page
 
+if not page.exists():
+pywikibot.output(u'%s does not exist. Skipping.' % page)
+return
 if page.isRedirectPage():
 pywikibot.output(u'%s is a redirect page. Skipping.' % page)
 return

-- 
To view, visit https://gerrit.wikimedia.org/r/354719
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id5b6b0799bcac2aa69b26e9e8a7dd86e282f95c9
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Make the tests pass again: * https://en.wikisource.org/w/ind...

2017-05-20 Thread Multichill (Code Review)
Multichill has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354697 )

Change subject: Make the tests pass again: * 
https://en.wikisource.org/w/index.php?type=revision&diff=6811951&oldid=4889209 
made the number of validated pages increase * 
https://en.wikipedia.org/w/index.php?type=revision&diff=780329438&oldid=780327410
 made the edit test 
..

Make the tests pass again:
* https://en.wikisource.org/w/index.php?type=revision&diff=6811951&oldid=4889209
made the number of validated pages increase
* 
https://en.wikipedia.org/w/index.php?type=revision&diff=780329438&oldid=780327410
 made the edit test fail
* wikistats is broken, just disabled the tests

Bug: T165830
Change-Id: Iee6f815f7995eb6dc60d3a91f69fc24a6f101037
---
M tests/pagegenerators_tests.py
M tests/wikistats_tests.py
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/97/354697/1

diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index b24180d..6eaca83 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -238,7 +238,7 @@
 site = self.site
 gen = pagegenerators.PagesFromTitlesGenerator(self.titles, site)
 gen = pagegenerators.CategoryFilterPageGenerator(gen, 
self.catfilter_list, site)
-self.assertEqual(len(tuple(gen)), 9)
+self.assertEqual(len(tuple(gen)), 10)
 
 
 class TestQualityFilterPageGenerator(TestCase):
@@ -314,12 +314,12 @@
 gen, last_edit_end=two_days_ago)
 self.assertEqual(len(list(gen)), 0)
 
-gen = PagesFromTitlesGenerator(['Template:Sidebox'], self.site)
+gen = PagesFromTitlesGenerator(['Template:Side box'], self.site)
 gen = pagegenerators.EdittimeFilterPageGenerator(
 gen, last_edit_end=nine_days_ago)
 self.assertEqual(len(list(gen)), 1)
 
-gen = PagesFromTitlesGenerator(['Template:Sidebox'], self.site)
+gen = PagesFromTitlesGenerator(['Template:Side box'], self.site)
 gen = pagegenerators.EdittimeFilterPageGenerator(
 gen, last_edit_start=nine_days_ago)
 self.assertEqual(len(list(gen)), 0)
diff --git a/tests/wikistats_tests.py b/tests/wikistats_tests.py
index f866eaf..43264d2 100644
--- a/tests/wikistats_tests.py
+++ b/tests/wikistats_tests.py
@@ -14,7 +14,7 @@
 
 from tests.aspects import unittest, TestCase
 
-
+@unittest.skip("Wikistats at https://wikistats.wmflabs.org/ appears to be 
broken. See T165830 in Phabricator")
 class WikiStatsTestCase(TestCase):
 
 """Test WikiStats dump."""

-- 
To view, visit https://gerrit.wikimedia.org/r/354697
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iee6f815f7995eb6dc60d3a91f69fc24a6f101037
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Remove WDQ from pywikibot

2017-05-19 Thread Multichill (Code Review)
Multichill has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354590 )

Change subject: Remove WDQ from pywikibot
..

Remove WDQ from pywikibot

Bug: T162585

Change-Id: I8dadf884b7255a1fb4af18c8892df3f8c443ab58
---
D pywikibot/data/wikidataquery.py
M pywikibot/pagegenerators.py
D tests/wikidataquery_tests.py
3 files changed, 0 insertions(+), 963 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/90/354590/1

diff --git a/pywikibot/data/wikidataquery.py b/pywikibot/data/wikidataquery.py
deleted file mode 100644
index f28a376..000
--- a/pywikibot/data/wikidataquery.py
+++ /dev/null
@@ -1,633 +0,0 @@
-# -*- coding: utf-8 -*-
-"""Objects representing WikidataQuery query syntax and API."""
-#
-# (C) Pywikibot team, 2013
-#
-# Distributed under the terms of the MIT license.
-from __future__ import absolute_import, unicode_literals
-
-import hashlib
-import json
-import os
-import pickle
-import sys
-import tempfile
-import time
-
-if sys.version_info[0] > 2:
-from urllib.parse import quote
-basestring = (str, )
-else:
-from urllib2 import quote
-
-import pywikibot
-
-from pywikibot.comms import http
-
-from pywikibot import config
-from pywikibot.page import ItemPage, PropertyPage, Claim
-
-
-def listify(x):
-"""
-If given a non-list, encapsulate in a single-element list.
-
-@rtype: list
-"""
-return x if isinstance(x, list) else [x]
-
-
-class QuerySet(object):
-
-"""
-A QuerySet represents a set of queries or other query sets.
-
-Queries may be joined by operators (AND and OR).
-
-A QuerySet stores this information as a list of Query(Sets) and
-a joiner operator to join them all together
-"""
-
-def __init__(self, q):
-"""
-Initialise a query set from a Query or another QuerySet.
-
-@type q: Query or QuerySet
-"""
-self.qs = [q]
-
-def addJoiner(self, args, joiner):
-"""
-Add to this QuerySet using the given joiner.
-
-If the given joiner is not the same as we used before in
-this QuerySet, nest the current one in parens before joining.
-This makes the implicit grouping of the API explicit.
-
-@return: a new query set representing the joining of this one and
-the arguments
-"""
-if len(self.qs) > 1 and joiner != self.joiner:
-left = QuerySet(self)
-else:
-left = self
-
-left.joiner = joiner
-
-for a in listify(args):
-left.qs.append(a)
-
-return left
-
-def AND(self, args):
-"""
-Add the given args (Queries or QuerySets) to the Query set as a 
logical conjuction (AND).
-
-@type args: Query or QuerySet
-"""
-return self.addJoiner(args, "AND")
-
-def OR(self, args):
-"""
-Add the given args (Queries or QuerySets) to the Query set as a 
logical disjunction (OR).
-
-@type args: Query or QuerySet
-"""
-return self.addJoiner(args, "OR")
-
-def __str__(self):
-"""
-Output as an API-ready string.
-
-@rtype: str
-"""
-def bracketIfQuerySet(q):
-if isinstance(q, QuerySet) and q.joiner != self.joiner:
-return "(%s)" % q
-else:
-return str(q)
-
-s = bracketIfQuerySet(self.qs[0])
-
-for q in self.qs[1:]:
-s += " %s %s" % (self.joiner, bracketIfQuerySet(q))
-
-return s
-
-def __repr__(self):
-"""Return a string representation."""
-return u"QuerySet(%s)" % self
-
-
-class Query(object):
-
-"""
-A query is a single query for the WikidataQuery API.
-
-For example:
-claim[100:60] or link[enwiki]
-
-Construction of a Query can throw a TypeError if you feed it bad
-parameters. Exactly what these need to be depends on the Query
-"""
-
-def AND(self, ands):
-"""
-Produce a query set ANDing this query and all the given query/sets.
-
-@type ands: Query or list of Query
-"""
-return QuerySet(self).addJoiner(ands, "AND")
-
-def OR(self, ors):
-"""
-Produce a query set ORing this query and all the given query/sets.
-
-@type ors: Query or list of Query
-"""
-return QuerySet(self).addJoiner(ors, "OR")
-
-def formatItem(self, item):
-"""
-Default item formatting is string.
-
-This will work for queries, querysets, ints and strings
-"""
-return str(item)
-
-def formatList(self, l):
-"""
-Format and comma-join a list.
-
-@type l: list
-"""
-return ",".join([self.formatItem(x) for x in l])
-
-@staticmethod
-def isOrContainsOnlyTypes(items, types):
-"""
-Either this item is one of the given types, or it is a 

[MediaWiki-commits] [Gerrit] Add bin/ scripts from ToolLabs - change (labs...heritage)

2015-08-26 Thread Multichill (Code Review)
Multichill has submitted this change and it was merged.

Change subject: Add bin/ scripts from ToolLabs
..


Add bin/ scripts from ToolLabs

These bin scripts are made to be run on the ToolLabs server.
They were hosted there for a while unversionned.

Change-Id: I2fe82d3625629f373edc7b19b368c191b874e857
---
A bin/create_all_monuments_tables.sh
A bin/dump_for_wmf.sh
A bin/update_monuments.sh
A bin/update_monuments_min.sh
4 files changed, 102 insertions(+), 0 deletions(-)

Approvals:
  Multichill: Verified; Looks good to me, approved



diff --git a/bin/create_all_monuments_tables.sh 
b/bin/create_all_monuments_tables.sh
new file mode 100755
index 000..f770c89
--- /dev/null
+++ b/bin/create_all_monuments_tables.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Script to create all the tables from scratch
+# The python script expects to be in it's own directory:
+cd /data/project/heritage/erfgoedbot
+# First create the sql statements
+python /data/project/heritage/erfgoedbot/monument_tables.py
+for i in `ls /data/project/heritage/erfgoedbot/sql/create_table_monuments*`
+do
+   echo $i
+ mysql -h tools-db s51138__heritage_p < $i
+done
+for i in `ls /data/project/heritage/erfgoedbot/sql/create_table_wlpa_*`
+do
+ mysql -h tools-db s51138__heritage_p < $i
+done
+# Admin tree for browsing ISO codes
+mysql -h tools-db s51138__heritage_p < 
/data/project/heritage/erfgoedbot/sql/create_table_admin_tree.sql
+# Something with commonscat
+mysql -h tools-db s51138__heritage_p < 
/data/project/heritage/erfgoedbot/sql/create_table_commonscat.sql
+# Tracking the images table
+mysql -h tools-db s51138__heritage_p < 
/data/project/heritage/erfgoedbot/sql/create_table_image.sql
diff --git a/bin/dump_for_wmf.sh b/bin/dump_for_wmf.sh
new file mode 100755
index 000..a54e15e
--- /dev/null
+++ b/bin/dump_for_wmf.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/bash
+
+# Dump for wlm.wikipedia.org
+#mysqldump --skip-add-locks --complete-insert --default-character-set=utf8 
p_erfgoed_p monuments_all admin_tree|gzip>./public_html/monuments.sql.gz
+cd ~/temp
+php ../tools/export_as_text.php admin_tree > ./admin_tree_tmp.txt
+php ../tools/export_as_text.php monuments_all > ./monuments_all_tmp.txt
+tar -czf ../public_html/export.tar.gz admin_tree_tmp.txt monuments_all_tmp.txt
+rm *.txt
+cd ..
+rm /home/project/e/r/f/erfgoed/temp/countries.ser
diff --git a/bin/update_monuments.sh b/bin/update_monuments.sh
new file mode 100755
index 000..8ea183f
--- /dev/null
+++ b/bin/update_monuments.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+#
+# Script to make a full update of the monuments databse and run a bunch of 
tasks
+
+# Make sure we are in our homedir
+cd /data/project/heritage/
+
+# First have the erfgoed bot update everything in it's config
+echo "Full database update..."
+/data/project/heritage/pywikibot/pwb.py 
/data/project/heritage/erfgoedbot/update_database.py -fullupdate
+
+# Update the all monuments table
+echo "Update all monuments table..."
+mysql -h tools-db s51138__heritage_p < 
/data/project/heritage/erfgoedbot/sql/fill_table_monuments_all.sql
+
+## Update the image table. Is now another job
+# echo "Update image table..."
+# /data/project/heritage/pywikibot/pwb.py 
/data/project/heritage/erfgoedbot/populate_image_table.py
+
+# Update admin structure tree
+echo "Update admin structure tree..."
+php ./erfgoedbot/populate_adm_tree.php
+
+# Make statistics
+echo "Make statistics..."
+/data/project/heritage/pywikibot/pwb.py 
/data/project/heritage/erfgoedbot/database_statistics.py
+
+# Make more detailed statistics
+echo "Make more detailed statistics..."
+php ./public_html/maintenance/_buildStats.php
+
+# Update the list of unused monuments
+echo "Update unused images list..."
+/data/project/heritage/pywikibot/pwb.py 
/data/project/heritage/erfgoedbot/unused_monument_images.py
+
+# Make a list of missing commonscat links
+echo "Make a list of missing commonscat links..."
+/data/project/heritage/pywikibot/pwb.py 
/data/project/heritage/erfgoedbot/missing_commonscat_links.py
+
+# Dump database to a file so people can play around with it
+cd ./public_html
+
+# Keep the last dump around just in case
+ln -f monuments_db.sql.gz monuments_db-old.sql.gz
+
+# Dump the database
+echo "Dump database..."
+mysqldump --host=tools-db --single-transaction s51138__heritage_p > 
monuments_db-new.sql
+nice gzip monuments_db-new.sql
+
+# Atomically replace the provided file
+echo "Replace atomically the file..."
+mv -f monuments_db-new.sql.gz monuments_db.sql.gz
+cd ..
+
+# Refill prox_search table. Which will be used by layar server.
+echo "Refill prox_search table..."
+php ./prox_search/fill_table_prox_search.php
+
+# Categorize some images
+echo "Categorize images..."
+/data/project/heritage/pywikibot/pwb.py 
/data/project/heritage/erfgoedbot/categorize_images.py
diff --git a/bin/update_monuments_min.sh b/bin/update_monuments_min.sh
new file mode 100755
index 000..bfcb9e7
--- /dev/null

[MediaWiki-commits] [Gerrit] Remove NS 104 from (jo, ar) configuration - change (labs...heritage)

2015-08-26 Thread Multichill (Code Review)
Multichill has submitted this change and it was merged.

Change subject: Remove NS 104 from (jo,ar) configuration
..


Remove NS 104 from (jo,ar) configuration

This namespace was deleted from ar.wikipedia

Bug: T110386
Change-Id: I6dc4afa8c6baaa8434c3d1e4138ba28bf816ccfb
---
M erfgoedbot/monuments_config.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Multichill: Verified; Looks good to me, approved



diff --git a/erfgoedbot/monuments_config.py b/erfgoedbot/monuments_config.py
index 134ae84..d10847b 100755
--- a/erfgoedbot/monuments_config.py
+++ b/erfgoedbot/monuments_config.py
@@ -5183,7 +5183,7 @@
 'missingCommonscatPage' : u'',
 'imagesWithoutIdPage' : u'ويكيبيديا:الويكي تهوى المعالم 
2013/الأردن/Images without id',
 'registrantUrlBase' : u'',
-'namespaces' : [0, 104],
+'namespaces' : [0],
 'table' : u'monuments_jo_(ar)',
 'truncate' : False,
 'primkey' : u'id',

-- 
To view, visit https://gerrit.wikimedia.org/r/234125
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6dc4afa8c6baaa8434c3d1e4138ba28bf816ccfb
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Jean-Frédéric 
Gerrit-Reviewer: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/la... - change (labs...multichill)

2015-07-08 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/223671

Change subject: Merge branch 'master' of 
ssh://gerrit.wikimedia.org:29418/labs/tools/multichill into prewikimania
..

Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/labs/tools/multichill 
into prewikimania

Conflicts:
bot/wikidata/extract_street.py
bot/wikidata/image_import.py
bot/wikidata/mauritshuis_import.py
bot/wikidata/rijksmonumenten_import.py
bot/wikidata/teylers_import.py

Change-Id: I85235a279ddeca212a2b33184cccd69f46ffd5d8
---
M bot/wikidata/extract_street.py
M bot/wikidata/image_import.py
M bot/wikidata/mauritshuis_import.py
M bot/wikidata/rijksmonumenten_import.py
M bot/wikidata/teylers_import.py
5 files changed, 124 insertions(+), 1,160 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/multichill 
refs/changes/71/223671/1

diff --git a/bot/wikidata/extract_street.py b/bot/wikidata/extract_street.py
index e74b8cb..c21fad7 100644
--- a/bot/wikidata/extract_street.py
+++ b/bot/wikidata/extract_street.py
@@ -35,10 +35,12 @@
 self.generator = generator
 self.repo = pywikibot.Site().data_repository()
 
-<<< HEAD   (8a3d81 Pre wikimania backup)
+<<< HEAD
 
 
 
+===
+>>> e6a873ea1d397e22965b2a69d08a2cd7b410d562
 
 def run(self):
 """
@@ -115,6 +117,7 @@
 else:
 pywikibot.output(u'Did not find a street item 
for %s' % (streetname,))
 
+<<< HEAD
 
 '''
 monumentItem = None
@@ -377,6 +380,8 @@
 pywikibot.output('Stupid dupe error')
 '''
 
+===
+>>> e6a873ea1d397e22965b2a69d08a2cd7b410d562
 
 def WikidataQueryItemPageGenerator(query, site=None):
 """Generate pages that result from the given WikidataQuery.
@@ -396,9 +401,12 @@
 pywikibot.output(u'retrieved %d items' % data[u'status'][u'items'])
 for item in data[u'items']:
 yield pywikibot.ItemPage(repo, u'Q' + unicode(item))
+<<< HEAD
 
 
 
+===
+>>> e6a873ea1d397e22965b2a69d08a2cd7b410d562
 
 
 def main():
@@ -406,6 +414,7 @@
 query = u'CLAIM[359] AND CLAIM[131:9899] AND CLAIM[969] AND NOCLAIM[669]'
 pigenerator = 
pagegenerators.PreloadingItemGenerator(pagegenerators.WikidataItemGenerator(WikidataQueryItemPageGenerator(query)))
 
+<<< HEAD
 
 streetBot = StreetBot(pigenerator)
 streetBot.run()
@@ -444,111 +453,9 @@
 '''
 
 ===
-
-def run(self):
-"""
-Starts the robot.
-"""
-for item in self.generator:
-pywikibot.output(u'Working on %s' % (item.title(),))
- 
-if item.exists():
-item.get()
-if not u'P669' in item.claims and u'P969' in item.claims and 
u'P131' in item.claims:
-# We have no street, but we do have address and 
administrative thingie
-admItem = None
-if len(item.claims.get('P131'))==1:
-admItem = item.claims.get('P131')[0].getTarget()
-elif len(item.claims.get('P131'))==2:
-admItemA = item.claims.get('P131')[0].getTarget()
-admItemA.get()
-admItemB = item.claims.get('P131')[1].getTarget()
-admItemB.get()
-if admItemA.claims.get('P131'):
-if admItemA.claims.get('P131')[0].getTarget()== 
admItemB:
-admItem = admItemA
-if admItemB.claims.get('P131'):
-if admItemB.claims.get('P131')[0].getTarget()== 
admItemA:
-admItem = admItemB
-
-if admItem:
-streetItem = None
-address = item.claims.get('P969')[0].getTarget()
-#print address
-regex = u'^([^\d]+)\s\d+.*$'
-match = re.search(regex, address)
-if match:
-streetname = match.group(1).strip()
-#print streetname
-request = api.Request(site=self.repo,
-  action='wbsearchentities',
-  search=streetname,
-  language='en')
-data = request.submit()
-if data.get('success')==1:
-for hit in data.get('search'):
-hitItem = pywikibot.ItemPage(self.repo, 
hit.g

[MediaWiki-commits] [Gerrit] Pre wikimania backup - change (labs...multichill)

2015-07-08 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/223670

Change subject: Pre wikimania backup
..

Pre wikimania backup

Change-Id: I5b9ec260b66d2a2dd537d30a59aab1622609d6de
---
A bot/wikidata/adel_families.py
A bot/wikidata/agnsw_import.py
A bot/wikidata/americanart_import.py
A bot/wikidata/amsterdam_museum_import.py
A bot/wikidata/artic_import.py
A bot/wikidata/boijmans_import.py
A bot/wikidata/brooklyn_import.py
A bot/wikidata/claim_colon.py
A bot/wikidata/claim_templates.py
A bot/wikidata/collection_stats.py
A bot/wikidata/commons_google_art.py
A bot/wikidata/commonscat_to_wikidata.py
A bot/wikidata/creator_import.py
A bot/wikidata/creator_link.py
A bot/wikidata/extract_dates.py
A bot/wikidata/extract_street.py
A bot/wikidata/famsf_import.py
A bot/wikidata/frans_hals_import.py
A bot/wikidata/frick_import.py
A bot/wikidata/getty_import.py
A bot/wikidata/guggenheim_import.py
A bot/wikidata/image_import.py
A bot/wikidata/link_images_wikidata.py
A bot/wikidata/mauritshuis_import.py
A bot/wikidata/met_import.py
A bot/wikidata/mfa_import.py
A bot/wikidata/moma_import.py
A bot/wikidata/nga_import.py
A bot/wikidata/ngv_import.py
A bot/wikidata/noclaims_AZ.py
A bot/wikidata/painting_collection_link.py
A bot/wikidata/private_collection.py
A bot/wikidata/rijksmonumenten_import.py
A bot/wikidata/rijksmuseum_import .py
A bot/wikidata/rijksmuseum_import_europeana.py
A bot/wikidata/rijksmuseum_rkd.py
A bot/wikidata/rijksmuseum_rkd_ulan.py
A bot/wikidata/rijksmuseum_schilders.py
A bot/wikidata/rkd_import.py
A bot/wikidata/smk_import.py
A bot/wikidata/teylers_import.py
A bot/wikidata/vangogh_import.py
42 files changed, 19,642 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/multichill 
refs/changes/70/223670/1


-- 
To view, visit https://gerrit.wikimedia.org/r/223670
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b9ec260b66d2a2dd537d30a59aab1622609d6de
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/multichill
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Implement a special page to show items with the most sitelinks - change (mediawiki...Wikibase)

2014-12-27 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/181902

Change subject: Implement a special page to show items with the most sitelinks
..

Implement a special page to show items with the most sitelinks

bug:T48217
Change-Id: I2b11256f1d88e69d04bb8631fdfb4c36295c2978
---
M repo/Wikibase.i18n.alias.php
M repo/Wikibase.php
M repo/i18n/en.json
M repo/i18n/nl.json
A repo/includes/specials/SpecialItemsMostSitelinks.php
A repo/tests/phpunit/includes/specials/SpecialItemsMostSitelinksTest.php
6 files changed, 157 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/02/181902/1

diff --git a/repo/Wikibase.i18n.alias.php b/repo/Wikibase.i18n.alias.php
index ba42ce4..97a6d72 100644
--- a/repo/Wikibase.i18n.alias.php
+++ b/repo/Wikibase.i18n.alias.php
@@ -30,6 +30,7 @@
'EntitiesWithoutLabel' => array( 'EntitiesWithoutLabel' ),
'EntitiesWithoutDescription' => array( 'EntitiesWithoutDescription' ),
'ItemsWithoutSitelinks' => array( 'ItemsWithoutSitelinks' ),
+   'ItemsMostSitelinks' => array( 'ItemsMostSitelinks' ),
'MyLanguageFallbackChain' => array( 'MyLanguageFallbackChain' ),
 );
 
@@ -302,6 +303,7 @@
'EntitiesWithoutLabel' => array( 'EntiteitenZonderLabel' ),
'EntitiesWithoutDescription' => array( 'EntiteitenZonderBeschrijving' ),
'ItemsWithoutSitelinks' => array( 'ItemsZonderSitekoppelingen' ),
+   'ItemsMostSitelinks' => array( 'ItemsMeesteSitekoppelingen' ),
 );
 
 /** Polish (polski) */
@@ -408,4 +410,4 @@
 $specialPageAliases['zh-tw'] = array(
'NewItem' => array( '建立項目' ),
'NewProperty' => array( '新增屬性' ),
-);
\ No newline at end of file
+);
diff --git a/repo/Wikibase.php b/repo/Wikibase.php
index 9be6173..cb68d41 100644
--- a/repo/Wikibase.php
+++ b/repo/Wikibase.php
@@ -147,6 +147,7 @@
$wgSpecialPages['GoToLinkedPage']   
= 'Wikibase\Repo\Specials\SpecialGoToLinkedPage';
$wgSpecialPages['ItemDisambiguation']   = 
'Wikibase\Repo\Specials\SpecialItemDisambiguation';
$wgSpecialPages['ItemsWithoutSitelinks']= 
'Wikibase\Repo\Specials\SpecialItemsWithoutSitelinks';
+   $wgSpecialPages['ItemsMostSitelinks']   = 
'Wikibase\Repo\Specials\SpecialItemsMostSitelinks';
$wgSpecialPages['SetLabel'] 
= 'Wikibase\Repo\Specials\SpecialSetLabel';
$wgSpecialPages['SetDescription']   
= 'Wikibase\Repo\Specials\SpecialSetDescription';
$wgSpecialPages['SetAliases']   
= 'Wikibase\Repo\Specials\SpecialSetAliases';
diff --git a/repo/i18n/en.json b/repo/i18n/en.json
index 626c5f0..2b39588 100644
--- a/repo/i18n/en.json
+++ b/repo/i18n/en.json
@@ -241,6 +241,8 @@
"wikibase-entitieswithoutlabel-invalid-language": "\"$1\" is not a 
valid language code.",
"wikibase-entitieswithoutlabel-invalid-type": "\"$1\" is not a valid 
entity type.",
"special-itemswithoutsitelinks": "Items without sitelinks",
+   "itemsmostsitelinks": "Items with the most sitelinks",
+   "wikibase-nsitelinks": "Item has $1 sitelinks",
"special-entitydata": "Entity data",
"wikibase-entitydata-not-found": "No entity with ID $1 was found.",
"wikibase-entitydata-not-acceptable": "No matching format found. 
Supported MIME types: $1",
diff --git a/repo/i18n/nl.json b/repo/i18n/nl.json
index 63dca6d..b09dbdc 100644
--- a/repo/i18n/nl.json
+++ b/repo/i18n/nl.json
@@ -224,6 +224,8 @@
"wikibase-entitieswithoutlabel-invalid-language": "\"$1\" is geen 
geldige taalcode.",
"wikibase-entitieswithoutlabel-invalid-type": "\"$1\" is geen geldig 
entiteitstype.",
"special-itemswithoutsitelinks": "Items zonder sitekoppelingen",
+   "itemsmostsitelinks": "Items met de meeste sitekoppelingen",
+   "wikibase-nsitelinks": "Item heeft $1 sitelinks",
"special-entitydata": "Entiteitsgegevens",
"wikibase-entitydata-not-found": "Er is geen entiteit gevonden met het 
ID $1.",
"wikibase-entitydata-not-acceptable": "Er is geen overeenkomende 
indeling gevonden. Ondersteunde MIME-typen: $1",
diff --git a/repo/includes/specials/SpecialItemsMostSitelinks.php 
b/repo/includes/specials/SpecialItemsMostSitelinks.php
new file mode 100644
index 000..66014ee
--- /dev/null
+++ b/repo/includes/specials/SpecialItemsMostSitelinks.php
@@ -0,0 +1,101 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @since 0.5
+ *
+ * @file
+ * @ingroup WikibaseRepo
+ *
+ * @licence GNU GPL v2+
+ * @author Maarten Dammers
+ */
+class SpecialItemsMostSitelinks extends QueryPage {
+   public function __construct() {
+   parent::__construct( 'ItemsMostSitelinks' );
+   }
+
+

[MediaWiki-commits] [Gerrit] (bug 71089): Add -mysqlquery commandline option to pagegener... - change (pywikibot/core)

2014-09-20 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/161674

Change subject: (bug 71089): Add -mysqlquery commandline option to 
pagegenerators.py
..

(bug 71089): Add -mysqlquery commandline option to pagegenerators.py

Change-Id: I2498b1191148463d9ee5e093aa0ae8b1f12c45f0
---
M pywikibot/pagegenerators.py
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/74/161674/1

diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index 0ba02b4..4dc464b 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -538,6 +538,12 @@
 query = pywikibot.input(
 u'WikidataQuery string:')
 gen = WikidataQueryPageGenerator(query)
+elif arg.startswith('-mysqlquery'):
+query = arg[len('-mysqlquery:'):]
+if not query:
+query = pywikibot.input(
+u'Mysql query string:')
+gen = MySQLPageGenerator(query)
 
 if gen:
 self.gens.append(gen)

-- 
To view, visit https://gerrit.wikimedia.org/r/161674
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2498b1191148463d9ee5e093aa0ae8b1f12c45f0
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] (bug 70806): Fix id length for sk so it wont get truncated - change (labs...heritage)

2014-09-20 Thread Multichill (Code Review)
Multichill has submitted this change and it was merged.

Change subject: (bug 70806): Fix id length for sk so it wont get truncated
..


(bug 70806): Fix id length for sk so it wont get truncated

Change-Id: I0bc568c73f841ef107f1b8f46df7a6edd892981f
---
M erfgoedbot/monuments_config.py
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Multichill: Verified; Looks good to me, approved



diff --git a/erfgoedbot/monuments_config.py b/erfgoedbot/monuments_config.py
index 8de2cd7..ed6b091 100755
--- a/erfgoedbot/monuments_config.py
+++ b/erfgoedbot/monuments_config.py
@@ -7238,7 +7238,7 @@
 {
 'source' : u'ObjektID',
 'dest' : u'objektid',
-'type' : 'varchar(11)',
+'type' : 'varchar(15)',
 'default' : '0',
 },
 {
@@ -7345,7 +7345,7 @@
 {
 'source' : u'IDobjektu',
 'dest' : u'idobjektu',
-'type' : 'varchar(11)',
+'type' : 'varchar(15)',
 'default' : '0',
 },
 {

-- 
To view, visit https://gerrit.wikimedia.org/r/161672
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0bc568c73f841ef107f1b8f46df7a6edd892981f
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Multichill 
Gerrit-Reviewer: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] (bug 70806): Fix id length for sk so it wont get truncated - change (labs...heritage)

2014-09-20 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/161672

Change subject: (bug 70806): Fix id length for sk so it wont get truncated
..

(bug 70806): Fix id length for sk so it wont get truncated

Change-Id: I0bc568c73f841ef107f1b8f46df7a6edd892981f
---
M erfgoedbot/monuments_config.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage 
refs/changes/72/161672/1

diff --git a/erfgoedbot/monuments_config.py b/erfgoedbot/monuments_config.py
index 8de2cd7..ed6b091 100755
--- a/erfgoedbot/monuments_config.py
+++ b/erfgoedbot/monuments_config.py
@@ -7238,7 +7238,7 @@
 {
 'source' : u'ObjektID',
 'dest' : u'objektid',
-'type' : 'varchar(11)',
+'type' : 'varchar(15)',
 'default' : '0',
 },
 {
@@ -7345,7 +7345,7 @@
 {
 'source' : u'IDobjektu',
 'dest' : u'idobjektu',
-'type' : 'varchar(11)',
+'type' : 'varchar(15)',
 'default' : '0',
 },
 {

-- 
To view, visit https://gerrit.wikimedia.org/r/161672
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0bc568c73f841ef107f1b8f46df7a6edd892981f
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Correct second reference to table name - change (labs...heritage)

2014-09-04 Thread Multichill (Code Review)
Multichill has submitted this change and it was merged.

Change subject: Correct second reference to table name
..


Correct second reference to table name

A followup to https://gerrit.wikimedia.org/r/158346

Change-Id: I4d0da1a909a66206ee04914de6e9e33f217e8e47
---
M erfgoedbot/monuments_config.py
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Multichill: Verified; Looks good to me, approved



diff --git a/erfgoedbot/monuments_config.py b/erfgoedbot/monuments_config.py
index b011ce8..f7cab04 100755
--- a/erfgoedbot/monuments_config.py
+++ b/erfgoedbot/monuments_config.py
@@ -7067,7 +7067,7 @@
 'imagesWithoutIdPage' : u'User:Multichill/Archaeological monuments in 
Sweden without ID',
 'registrantUrlBase' : u'http://kulturarvsdata.se/raa/fmi/html/%s',
 'namespaces' : [0],
-'table' : u'monuments_se-fornminne_(sv)',
+'table' : u'monuments_se-fornmin_(sv)',
 'truncate' : False, 
 'primkey' : u'id',
 'fields' : [
@@ -7231,7 +7231,7 @@
 'imagesWithoutIdPage' : u'User:Multichill/Working Life Museums in 
Sweden without ID',
 'registrantUrlBase' : u'', #they have yet to get their direct URLs to 
work
 'namespaces' : [0],
-'table' : u'monuments_se-arbetsliv_(sv)',
+'table' : u'monuments_se-arbetsl_(sv)',
 'truncate' : False, 
 'primkey' : u'id',
 'fields' :  [

-- 
To view, visit https://gerrit.wikimedia.org/r/158434
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4d0da1a909a66206ee04914de6e9e33f217e8e47
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil 
Gerrit-Reviewer: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Make table name correspond to country name - change (labs...heritage)

2014-09-04 Thread Multichill (Code Review)
Multichill has submitted this change and it was merged.

Change subject: Make table name correspond to country name
..


Make table name correspond to country name

Since country in monuments_all is limited to 10 characters the
previous strings were cropped. Changing the source names to
reflect this leads to less confusion.
Affected tables:
* monuments_se-arbetsliv_(sv) -> monuments_se-arbetsl_(sv)
* monuments_se-fornminne_(sv) -> monuments_se-fornmin_(sv)

Change-Id: I52d43574130db0f12427507a1cc924fca77fe5d7
---
M erfgoedbot/monuments_config.py
M erfgoedbot/sql/fill_table_monuments_all.sql
2 files changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Multichill: Verified; Looks good to me, approved



diff --git a/erfgoedbot/monuments_config.py b/erfgoedbot/monuments_config.py
index 1183f19..b011ce8 100755
--- a/erfgoedbot/monuments_config.py
+++ b/erfgoedbot/monuments_config.py
@@ -7218,7 +7218,7 @@
 },
 ],
 },
-('se-arbetsliv', 'sv') : { # Working Life Museums in Sweden in Swedish
+('se-arbetsl', 'sv') : { # Working Life Museums in Sweden in Swedish
 'project' : u'wikipedia',
 'lang' : u'sv',
 'headerTemplate' : u'Arbetslivsmuseum-huvud',
diff --git a/erfgoedbot/sql/fill_table_monuments_all.sql 
b/erfgoedbot/sql/fill_table_monuments_all.sql
index e66962c..067bd59 100644
--- a/erfgoedbot/sql/fill_table_monuments_all.sql
+++ b/erfgoedbot/sql/fill_table_monuments_all.sql
@@ -2018,7 +2018,7 @@
FROM `monuments_se-bbr_(sv)`;
 /* Fornminne Monuments in Sweden in Swedish */
 REPLACE INTO `monuments_all_tmp` (`country`, `lang`, `id`, `adm0`, `adm1`, 
`adm2`, `adm3`, `adm4`, `name`, `address`, `municipality`, `lat`, `lon`, 
`lat_int`, `lon_int`, `image`, `commonscat`, `source`, `changed`, 
`monument_article`, `registrant_url` )
-SELECT 'se-fornminne' AS `country`,
+SELECT 'se-fornmin' AS `country`,
'sv' AS `lang`,
`id` AS `id`,
'se' AS `adm0`,
@@ -2039,7 +2039,7 @@
`changed` AS `changed`,
 `artikel` AS `monument_article`,
 `registrant_url` AS `registrant_url`
-   FROM `monuments_se-fornminne_(sv)`;
+   FROM `monuments_se-fornmin_(sv)`;
 /* Listed historical ships in Sweden in Swedish */
 REPLACE INTO `monuments_all_tmp` (`country`, `lang`, `id`, `adm0`, `adm1`, 
`adm2`, `adm3`, `adm4`, `name`, `address`, `municipality`, `lat`, `lon`, 
`lat_int`, `lon_int`, `image`, `commonscat`, `source`, `changed`, 
`monument_article`, `registrant_url` )
 SELECT 'se-ship' AS `country`,
@@ -2066,7 +2066,7 @@
FROM `monuments_se-ship_(sv)`;
 /* Working Life Museums in Sweden in Swedish */
 REPLACE INTO `monuments_all_tmp` (`country`, `lang`, `id`, `adm0`, `adm1`, 
`adm2`, `adm3`, `adm4`, `name`, `address`, `municipality`, `lat`, `lon`, 
`lat_int`, `lon_int`, `image`, `commonscat`, `source`, `changed`, 
`monument_article`, `registrant_url` )
-SELECT 'se-arbetsliv' AS `country`,
+SELECT 'se-arbetsl' AS `country`,
'sv' AS `lang`,
`id` AS `id`,
'se' AS `adm0`,
@@ -2087,7 +2087,7 @@
`changed` AS `changed`,
 `monument_article` AS `monument_article`,
 '' AS `registrant_url` /* FIXME: Add this field to source table */
-   FROM `monuments_se-arbetsliv_(sv)`;
+   FROM `monuments_se-arbetsl_(sv)`;
 /* Slovakia in German */
 REPLACE INTO `monuments_all_tmp` (`country`, `lang`, `id`, `adm0`, `adm1`, 
`adm2`, `adm3`, `adm4`, `name`, `address`, `municipality`, `lat`, `lon`, 
`lat_int`, `lon_int`, `image`, `commonscat`, `source`, `changed`, 
`monument_article`, `registrant_url` )
 SELECT 'sk' AS `country`,

-- 
To view, visit https://gerrit.wikimedia.org/r/158346
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I52d43574130db0f12427507a1cc924fca77fe5d7
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil 
Gerrit-Reviewer: Lokal Profil 
Gerrit-Reviewer: Multichill 
Gerrit-Reviewer: Springle 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fixing Ukraine commonscat issue - change (labs...heritage)

2014-09-02 Thread Multichill (Code Review)
Multichill has submitted this change and it was merged.

Change subject: Fixing Ukraine commonscat issue
..


Fixing Ukraine commonscat issue

Change-Id: Ie4482e304f043a8662ae344eebafda8316b508b5
---
M erfgoedbot/monuments_config.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Multichill: Verified; Looks good to me, approved



diff --git a/erfgoedbot/monuments_config.py b/erfgoedbot/monuments_config.py
index c97d770..1183f19 100755
--- a/erfgoedbot/monuments_config.py
+++ b/erfgoedbot/monuments_config.py
@@ -7821,7 +7821,7 @@
 'dest' : u'image',
 },
 {
-'source' : u'commonscat',
+'source' : u'галерея',
 'dest' : u'commonscat',
 },
 {

-- 
To view, visit https://gerrit.wikimedia.org/r/157846
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie4482e304f043a8662ae344eebafda8316b508b5
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Ynhockey 
Gerrit-Reviewer: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Some Wikidata crap I wanted to share - change (labs...multichill)

2014-08-06 Thread Multichill (Code Review)
Multichill has submitted this change and it was merged.

Change subject: Some Wikidata crap I wanted to share
..


Some Wikidata crap I wanted to share

Change-Id: I00aff09b3eb5e74f1376522dfbcb0db30dd56180
---
A bot/wikidata/extract_street.py
A bot/wikidata/image_import.py
A bot/wikidata/mauritshuis_import.py
A bot/wikidata/rijksmonumenten_import.py
A bot/wikidata/rijksmuseum_import.py
A bot/wikidata/teylers_import.py
6 files changed, 1,571 insertions(+), 0 deletions(-)

Approvals:
  Multichill: Verified; Looks good to me, approved



diff --git a/bot/wikidata/extract_street.py b/bot/wikidata/extract_street.py
new file mode 100644
index 000..bdf91b1
--- /dev/null
+++ b/bot/wikidata/extract_street.py
@@ -0,0 +1,144 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+"""
+Tool to extract the street from the address.
+* Loop over a bunch of items
+* Check if it doesn't already contain a street (P669)
+* Get P969 (if available)
+* Get the is in the administrative-territorial entity('s) (P131)
+* If multiple, get the most specific
+* Do a regex to get everything before the first number
+* Based on the name, get a bunch of items (beware: English by default)
+* For each item check if it's in the same administrative-territorial entity
+* If that's the case, add the street claim
+
+
+"""
+import json
+import pywikibot
+from pywikibot import pagegenerators
+import urllib
+import re
+import pywikibot.data.wikidataquery as wdquery
+from pywikibot.data import api
+
+class StreetBot:
+"""
+A bot to add streets on Wikidata
+"""
+def __init__(self, generator):
+"""
+Arguments:
+* generator- A generator that yields itempage objects.
+
+"""
+self.generator = generator
+self.repo = pywikibot.Site().data_repository()
+
+
+def run(self):
+"""
+Starts the robot.
+"""
+for item in self.generator:
+pywikibot.output(u'Working on %s' % (item.title(),))
+ 
+if item.exists():
+item.get()
+if not u'P669' in item.claims and u'P969' in item.claims and 
u'P131' in item.claims:
+# We have no street, but we do have address and 
administrative thingie
+admItem = None
+if len(item.claims.get('P131'))==1:
+admItem = item.claims.get('P131')[0].getTarget()
+elif len(item.claims.get('P131'))==2:
+admItemA = item.claims.get('P131')[0].getTarget()
+admItemA.get()
+admItemB = item.claims.get('P131')[1].getTarget()
+admItemB.get()
+if admItemA.claims.get('P131'):
+if admItemA.claims.get('P131')[0].getTarget()== 
admItemB:
+admItem = admItemA
+if admItemB.claims.get('P131'):
+if admItemB.claims.get('P131')[0].getTarget()== 
admItemA:
+admItem = admItemB
+
+if admItem:
+streetItem = None
+address = item.claims.get('P969')[0].getTarget()
+#print address
+regex = u'^([^\d]+)\s\d+.*$'
+match = re.search(regex, address)
+if match:
+streetname = match.group(1).strip()
+#print streetname
+request = api.Request(site=self.repo,
+  action='wbsearchentities',
+  search=streetname,
+  language='en')
+data = request.submit()
+if data.get('success')==1:
+for hit in data.get('search'):
+hitItem = pywikibot.ItemPage(self.repo, 
hit.get('id'))
+hitItem.get()
+# We got a hit, now test if it's a street 
and if it's in the same administrative location
+isStreet = False
+sameAdmin = False
+if hitItem.claims.get('P31'):
+for istanceHit in 
hitItem.claims.get('P31'):
+if 
istanceHit.getTarget().title()==u'Q79007':
+isStreet=True
+continue
+
+if hitItem.claims.get('P131'):
+for adminHit in 
hitItem.claims.get('P131')

[MediaWiki-commits] [Gerrit] Some Wikidata crap I wanted to share - change (labs...multichill)

2014-08-06 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/152147

Change subject: Some Wikidata crap I wanted to share
..

Some Wikidata crap I wanted to share

Change-Id: I00aff09b3eb5e74f1376522dfbcb0db30dd56180
---
A bot/wikidata/extract_street.py
A bot/wikidata/image_import.py
A bot/wikidata/mauritshuis_import.py
A bot/wikidata/rijksmonumenten_import.py
A bot/wikidata/rijksmuseum_import.py
A bot/wikidata/teylers_import.py
6 files changed, 1,571 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/multichill 
refs/changes/47/152147/1

diff --git a/bot/wikidata/extract_street.py b/bot/wikidata/extract_street.py
new file mode 100644
index 000..bdf91b1
--- /dev/null
+++ b/bot/wikidata/extract_street.py
@@ -0,0 +1,144 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+"""
+Tool to extract the street from the address.
+* Loop over a bunch of items
+* Check if it doesn't already contain a street (P669)
+* Get P969 (if available)
+* Get the is in the administrative-territorial entity('s) (P131)
+* If multiple, get the most specific
+* Do a regex to get everything before the first number
+* Based on the name, get a bunch of items (beware: English by default)
+* For each item check if it's in the same administrative-territorial entity
+* If that's the case, add the street claim
+
+
+"""
+import json
+import pywikibot
+from pywikibot import pagegenerators
+import urllib
+import re
+import pywikibot.data.wikidataquery as wdquery
+from pywikibot.data import api
+
+class StreetBot:
+"""
+A bot to add streets on Wikidata
+"""
+def __init__(self, generator):
+"""
+Arguments:
+* generator- A generator that yields itempage objects.
+
+"""
+self.generator = generator
+self.repo = pywikibot.Site().data_repository()
+
+
+def run(self):
+"""
+Starts the robot.
+"""
+for item in self.generator:
+pywikibot.output(u'Working on %s' % (item.title(),))
+ 
+if item.exists():
+item.get()
+if not u'P669' in item.claims and u'P969' in item.claims and 
u'P131' in item.claims:
+# We have no street, but we do have address and 
administrative thingie
+admItem = None
+if len(item.claims.get('P131'))==1:
+admItem = item.claims.get('P131')[0].getTarget()
+elif len(item.claims.get('P131'))==2:
+admItemA = item.claims.get('P131')[0].getTarget()
+admItemA.get()
+admItemB = item.claims.get('P131')[1].getTarget()
+admItemB.get()
+if admItemA.claims.get('P131'):
+if admItemA.claims.get('P131')[0].getTarget()== 
admItemB:
+admItem = admItemA
+if admItemB.claims.get('P131'):
+if admItemB.claims.get('P131')[0].getTarget()== 
admItemA:
+admItem = admItemB
+
+if admItem:
+streetItem = None
+address = item.claims.get('P969')[0].getTarget()
+#print address
+regex = u'^([^\d]+)\s\d+.*$'
+match = re.search(regex, address)
+if match:
+streetname = match.group(1).strip()
+#print streetname
+request = api.Request(site=self.repo,
+  action='wbsearchentities',
+  search=streetname,
+  language='en')
+data = request.submit()
+if data.get('success')==1:
+for hit in data.get('search'):
+hitItem = pywikibot.ItemPage(self.repo, 
hit.get('id'))
+hitItem.get()
+# We got a hit, now test if it's a street 
and if it's in the same administrative location
+isStreet = False
+sameAdmin = False
+if hitItem.claims.get('P31'):
+for istanceHit in 
hitItem.claims.get('P31'):
+if 
istanceHit.getTarget().title()==u'Q79007':
+isStreet=True
+continue
+
+if hitItem.claims.get('P131'):
+ 

[MediaWiki-commits] [Gerrit] Add .gitignore - change (labs...heritage)

2014-07-10 Thread Multichill (Code Review)
Multichill has submitted this change and it was merged.

Change subject: Add .gitignore
..


Add .gitignore

To long have we suffered the temporary sql files!

Change-Id: Iaf6211312d6fd49cf4b12006b0fbb7e7d89612b8
---
A .gitignore
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Multichill: Verified; Looks good to me, approved



diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..5ecb926
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+erfgoedbot/sql/create_table_monuments*
+erfgoedbot/sql/create_table_wlpa*

-- 
To view, visit https://gerrit.wikimedia.org/r/145268
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaf6211312d6fd49cf4b12006b0fbb7e7d89612b8
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil 
Gerrit-Reviewer: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Https for markers and images - change (labs...heritage)

2014-07-10 Thread Multichill (Code Review)
Multichill has submitted this change and it was merged.

Change subject: Https for markers and images
..


Https for markers and images

Url for markers and images changed to // to avoid the
'Blocked loading mixed active content' issue in Firefox when the
KML is used on a https site.
* markers in FormatKml.php
* image in CommonFunctions.php

Change-Id: I17e562f983fd7da6d72c77a9f5327d09c48fc1cd
---
M api/includes/CommonFunctions.php
M api/includes/FormatKml.php
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Multichill: Verified; Looks good to me, approved



diff --git a/api/includes/CommonFunctions.php b/api/includes/CommonFunctions.php
index abfc0f0..defb9da 100644
--- a/api/includes/CommonFunctions.php
+++ b/api/includes/CommonFunctions.php
@@ -6,7 +6,7 @@
 $filename = str_replace(' ', '_', $filename);
 $md5hash = md5($filename);
 //urlencode($filename);
-$url = "http://upload.wikimedia.org/wikipedia/commons/thumb/"; . 
$md5hash[0] . "/" . $md5hash[0] . $md5hash[1] . "/" . $filename . "/" . $size . 
"px-" . $filename;
+$url = "//upload.wikimedia.org/wikipedia/commons/thumb/" . $md5hash[0] 
. "/" . $md5hash[0] . $md5hash[1] . "/" . $filename . "/" . $size . "px-" . 
$filename;
 return $url;
 }
 }
diff --git a/api/includes/FormatKml.php b/api/includes/FormatKml.php
index d7a149a..8af31c8 100644
--- a/api/includes/FormatKml.php
+++ b/api/includes/FormatKml.php
@@ -26,8 +26,8 @@
function outputBegin($selectedItems) {
echo 'http://www.opengis.net/kml/2.2";>';
 echo '
-http://maps.google.com/mapfiles/kml/paddle/ylw-blank.png
-http://maps.google.com/mapfiles/kml/paddle/blu-circle.png';
+//maps.google.com/mapfiles/kml/paddle/ylw-blank.png
+//maps.google.com/mapfiles/kml/paddle/blu-circle.png';
}
 
function outputContinue($row, $continueKey, $primaryKey) {

-- 
To view, visit https://gerrit.wikimedia.org/r/145256
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I17e562f983fd7da6d72c77a9f5327d09c48fc1cd
Gerrit-PatchSet: 2
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil 
Gerrit-Reviewer: Lokal Profil 
Gerrit-Reviewer: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add new list for Sweden - change (labs...heritage)

2014-07-10 Thread Multichill (Code Review)
Multichill has submitted this change and it was merged.

Change subject: Add new list for Sweden
..


Add new list for Sweden

Adds se-arbetsliv a list for Working Life Museums in Sweden.
Thus changing:
* erfgoedbot/monuments_config.py
* erfgoedbot/sql/fill_table_monuments_all.sql

Also tightened constraints for id values in monuments_config
for se-bbr and se-fornmin

Change-Id: Ie50fb6e1b90dd759f5111e55ae8a5f3a2bb6de74
---
M erfgoedbot/monuments_config.py
M erfgoedbot/sql/fill_table_monuments_all.sql
2 files changed, 96 insertions(+), 2 deletions(-)

Approvals:
  Lokal Profil: Looks good to me, but someone else must approve
  Multichill: Verified; Looks good to me, approved



diff --git a/erfgoedbot/monuments_config.py b/erfgoedbot/monuments_config.py
index 8de2cd7..c97d770 100755
--- a/erfgoedbot/monuments_config.py
+++ b/erfgoedbot/monuments_config.py
@@ -6995,7 +6995,7 @@
 {
 'source' : u'bbr',
 'dest' : u'bbr',
-'type' : 'varchar(25)',
+'type' : 'varchar(14)',
 'default' : '0',
 },
 {
@@ -7074,7 +7074,7 @@
 {
 'source' : u'id',
 'dest' : u'id',
-'type' : 'varchar(25)',
+'type' : 'varchar(14)',
 'default' : '0',
 },
 {
@@ -7218,6 +7218,76 @@
 },
 ],
 },
+('se-arbetsliv', 'sv') : { # Working Life Museums in Sweden in Swedish
+'project' : u'wikipedia',
+'lang' : u'sv',
+'headerTemplate' : u'Arbetslivsmuseum-huvud',
+'rowTemplate' : u'Arbetslivsmuseum',
+'footerTemplate' : u'',
+'commonsTemplate' : u'Arbetslivsmuseum',
+'commonsTrackerCategory' : u'Working Life Museums in Sweden with known 
IDs',
+'commonsCategoryBase' : u'Working Life Museums in Sweden',
+'unusedImagesPage' : u'User:Multichill/Unused Working Life Museums in 
Sweden',
+'imagesWithoutIdPage' : u'User:Multichill/Working Life Museums in 
Sweden without ID',
+'registrantUrlBase' : u'', #they have yet to get their direct URLs to 
work
+'namespaces' : [0],
+'table' : u'monuments_se-arbetsliv_(sv)',
+'truncate' : False, 
+'primkey' : u'id',
+'fields' :  [
+{
+'source' : u'id',
+'dest' : u'id',
+'type' : 'varchar(4)',
+'default' : '0',
+},
+{
+'source' : u'namn',
+'dest' : u'namn',
+},
+{
+'source' : u'region-iso',
+'dest' : u'region-iso',
+},
+{
+'source' : u'namn',
+'dest' : u'monument_article',
+'conv' : u'extractWikilink',
+},
+{
+'source' : u'typ',
+'dest' : u'typ',
+},
+{
+'source' : u'kommun',
+'dest' : u'kommun',
+},
+{
+'source' : u'ort',
+'dest' : u'ort',
+},
+{
+'source' : u'adress',
+'dest' : u'adress',
+},
+{
+'source' : u'lat',
+'dest' : u'lat',
+},
+{
+'source' : u'lon',
+'dest' : u'lon',
+},
+{
+'source' : u'bild',
+'dest' : u'bild',
+},
+{
+'source' : u'commonscat',
+'dest' : u'commonscat',
+},
+],
+},
 ('sk', 'de') : { # Monuments in Slovakia in German
 'project' : u'wikipedia',
 'lang' : u'de',
diff --git a/erfgoedbot/sql/fill_table_monuments_all.sql 
b/erfgoedbot/sql/fill_table_monuments_all.sql
index 5ce093a..e66962c 100644
--- a/erfgoedbot/sql/fill_table_monuments_all.sql
+++ b/erfgoedbot/sql/fill_table_monuments_all.sql
@@ -2064,6 +2064,30 @@
 `artikel` AS `monument_article`,
 `registrant_url` AS `registrant_url`
FROM `monuments_se-ship_(sv)`;
+/* Working Life Museums in Sweden in Swedish */
+REPLACE INTO `monuments_all_tmp` (`country`, `lang`, `id`, `adm0`, `adm1`, 
`adm2`, `adm3`, `adm4`, `name`, `address`, `municipality`, `lat`, `lon`, 
`lat_int`, `lon_int`, `image`, `commonscat`, `source`, `changed`, 
`monument_article`, `registrant_url` )
+SELECT 'se-arbetsliv' AS `country`,
+   'sv' AS `lang`,
+   `id` AS `id`,
+   'se' AS `adm0`,
+   LOWER(`region-iso`) AS `adm1`,
+   `kommun` AS `adm2`,
+   `ort` AS `adm3`,
+   NULL AS `adm4`,
+   `namn` AS `name`,
+   `adress` AS `address`,
+   `kommun` AS `municipality`,
+   `lat` AS `lat`,
+   `lon` AS `lon`,
+   ROUND(

[MediaWiki-commits] [Gerrit] Update Defaults to wmflabs - change (labs...heritage)

2014-07-10 Thread Multichill (Code Review)
Multichill has submitted this change and it was merged.

Change subject: Update Defaults to wmflabs
..


Update Defaults to wmflabs

Updates the toolserver references to point to the correct path in
toollabs instead. Although these are overridden by database.inc,
on toollabs, the old references only serve to confuse anyone
wanting to clone the repo.

Change-Id: Iec7504f6c91c7949a04da0b37717fe94de4c6914
---
M api/includes/Defaults.php
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Lokal Profil: Looks good to me, but someone else must approve
  Multichill: Verified; Looks good to me, approved



diff --git a/api/includes/Defaults.php b/api/includes/Defaults.php
index 57e30bc..9cf1731 100644
--- a/api/includes/Defaults.php
+++ b/api/includes/Defaults.php
@@ -1,11 +1,11 @@
 https://gerrit.wikimedia.org/r/145254
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iec7504f6c91c7949a04da0b37717fe94de4c6914
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil 
Gerrit-Reviewer: Lokal Profil 
Gerrit-Reviewer: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Make pretty images and pretty urls - change (labs...heritage)

2014-06-04 Thread Multichill (Code Review)
Multichill has submitted this change and it was merged.

Change subject: Make pretty images and pretty urls
..


Make pretty images and pretty urls

Change-Id: I5e703602b072de02c65ea64f75727074c827ab14
---
M api/includes/FormatHtml.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Multichill: Verified; Looks good to me, approved



diff --git a/api/includes/FormatHtml.php b/api/includes/FormatHtml.php
index a777567..6ae20a3 100644
--- a/api/includes/FormatHtml.php
+++ b/api/includes/FormatHtml.php
@@ -70,9 +70,9 @@
 $tdattrs = '';
$cellData = '';
if ( in_array( $name, $selectedItems ) ) {
-   if ($name == "image") { 
+   if ($name == "image" || $name == "img_name") {
$cellData = self::genImage($value);
-   } elseif ($name == "source") {
+   } elseif ($name == "source" || $name == 
"img_thumb") {
$cellData = self::prettifyUrls( $value 
); 
} elseif ( in_array( $name, $hasWikitext ) ) {
$makeLinks = true;

-- 
To view, visit https://gerrit.wikimedia.org/r/137398
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5e703602b072de02c65ea64f75727074c827ab14
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Multichill 
Gerrit-Reviewer: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Make pretty images and pretty urls - change (labs...heritage)

2014-06-04 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/137398

Change subject: Make pretty images and pretty urls
..

Make pretty images and pretty urls

Change-Id: I5e703602b072de02c65ea64f75727074c827ab14
---
M api/includes/FormatHtml.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage 
refs/changes/98/137398/1

diff --git a/api/includes/FormatHtml.php b/api/includes/FormatHtml.php
index a777567..6ae20a3 100644
--- a/api/includes/FormatHtml.php
+++ b/api/includes/FormatHtml.php
@@ -70,9 +70,9 @@
 $tdattrs = '';
$cellData = '';
if ( in_array( $name, $selectedItems ) ) {
-   if ($name == "image") { 
+   if ($name == "image" || $name == "img_name") {
$cellData = self::genImage($value);
-   } elseif ($name == "source") {
+   } elseif ($name == "source" || $name == 
"img_thumb") {
$cellData = self::prettifyUrls( $value 
); 
} elseif ( in_array( $name, $hasWikitext ) ) {
$makeLinks = true;

-- 
To view, visit https://gerrit.wikimedia.org/r/137398
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e703602b072de02c65ea64f75727074c827ab14
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Some tweaks to get stuff working * Fix database name (redund... - change (labs...heritage)

2014-06-01 Thread Multichill (Code Review)
Multichill has submitted this change and it was merged.

Change subject: Some tweaks to get stuff working * Fix database name (redundant 
space at the end) * Fix the CH database in English (still pointing to the wrong 
db) * Remove the legacy Wiegels database
..


Some tweaks to get stuff working
* Fix database name (redundant space at the end)
* Fix the CH database in English (still pointing to the wrong db)
* Remove the legacy Wiegels database

Change-Id: I388ea0cef39cd7826e78bccef38a58fa6fc488bb
---
M api/includes/Defaults.php
M erfgoedbot/monuments_config.py
M erfgoedbot/sql/fill_table_monuments_all.sql
3 files changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Multichill: Verified; Looks good to me, approved



diff --git a/api/includes/Defaults.php b/api/includes/Defaults.php
index 81d5f84..57e30bc 100644
--- a/api/includes/Defaults.php
+++ b/api/includes/Defaults.php
@@ -5,7 +5,7 @@
 $dbDatabase = 'p_erfgoed_p';
 $dbPassword = 'https://gerrit.wikimedia.org/r/136683
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I388ea0cef39cd7826e78bccef38a58fa6fc488bb
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Multichill 
Gerrit-Reviewer: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Some tweaks to get stuff working * Fix database name (redund... - change (labs...heritage)

2014-06-01 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/136683

Change subject: Some tweaks to get stuff working * Fix database name (redundant 
space at the end) * Fix the CH database in English (still pointing to the wrong 
db) * Remove the legacy Wiegels database
..

Some tweaks to get stuff working
* Fix database name (redundant space at the end)
* Fix the CH database in English (still pointing to the wrong db)
* Remove the legacy Wiegels database

Change-Id: I388ea0cef39cd7826e78bccef38a58fa6fc488bb
---
M api/includes/Defaults.php
M erfgoedbot/monuments_config.py
M erfgoedbot/sql/fill_table_monuments_all.sql
3 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage 
refs/changes/83/136683/1

diff --git a/api/includes/Defaults.php b/api/includes/Defaults.php
index 81d5f84..57e30bc 100644
--- a/api/includes/Defaults.php
+++ b/api/includes/Defaults.php
@@ -5,7 +5,7 @@
 $dbDatabase = 'p_erfgoed_p';
 $dbPassword = 'https://gerrit.wikimedia.org/r/136683
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I388ea0cef39cd7826e78bccef38a58fa6fc488bb
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Moving from Toolserver svn to Toollabs git * .gitreview * Re... - change (labs...heritage)

2014-06-01 Thread Multichill (Code Review)
Multichill has submitted this change and it was merged.

Change subject: Moving from Toolserver svn to Toollabs git * .gitreview * 
Removed some path stuff * Commons has a different server on labs This should 
get the tool flying
..


Moving from Toolserver svn to Toollabs git
* .gitreview
* Removed some path stuff
* Commons has a different server on labs
This should get the tool flying

Change-Id: Iee1e4987883793f6d36ec75b2e71b328f91c
---
A .gitreview
M erfgoedbot/add_coord_to_articles.py
M erfgoedbot/add_object_location_monuments.py
M erfgoedbot/categorize_images.py
M erfgoedbot/database_statistics.py
M erfgoedbot/flickrripper_ee.py
M erfgoedbot/flickrripper_ee_etwiki.py
M erfgoedbot/flickrripper_es.py
M erfgoedbot/flickrripper_list.py
M erfgoedbot/images_of_monuments_without_id.py
M erfgoedbot/missing_commonscat_links.py
M erfgoedbot/monument_tables.py
M erfgoedbot/monuments_config.py
M erfgoedbot/populate_image_table.py
M erfgoedbot/top_streets.py
M erfgoedbot/unused_monument_images.py
M erfgoedbot/update_database.py
M erfgoedbot/update_id_dump.py
18 files changed, 15 insertions(+), 28 deletions(-)

Approvals:
  Multichill: Verified; Looks good to me, approved



diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..f0b60f4
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=labs/tools/heritage.git
+defaultbranch=master
+defaultrebase=0
diff --git a/erfgoedbot/add_coord_to_articles.py 
b/erfgoedbot/add_coord_to_articles.py
index 9bcca20..9fb97b8 100644
--- a/erfgoedbot/add_coord_to_articles.py
+++ b/erfgoedbot/add_coord_to_articles.py
@@ -18,7 +18,6 @@
 
 import sys, os
 import monuments_config as mconfig
-sys.path.append("/home/project/e/r/f/erfgoed/pywikipedia")
 import wikipedia
 import re, MySQLdb, time
 
@@ -79,7 +78,7 @@
 Connect to the wiki database
 '''
 if (lang):
-hostName = lang + 'wiki-p.db.toolserver.org'
+hostName = lang + 'wiki.labsdb'
 dbName = lang + 'wiki_p'
 #coordDbName = 'u_dispenser_p'
 conn = MySQLdb.connect(host=hostName, db=dbName,
diff --git a/erfgoedbot/add_object_location_monuments.py 
b/erfgoedbot/add_object_location_monuments.py
index e44e3f3..c83f2f4 100644
--- a/erfgoedbot/add_object_location_monuments.py
+++ b/erfgoedbot/add_object_location_monuments.py
@@ -7,7 +7,6 @@
 '''
 import sys
 import monuments_config as mconfig
-sys.path.append("/home/project/e/r/f/erfgoed/pywikipedia")
 import wikipedia, config, pagegenerators, catlib
 import re, imagerecat
 import MySQLdb, config, time
@@ -25,7 +24,7 @@
 '''
 Connect to the commons mysql database, if it fails, go down in flames
 '''
-conn = MySQLdb.connect('commonswiki-p.db.toolserver.org', 
db='commonswiki_p', user = config.db_username, passwd = config.db_password, 
use_unicode=True, charset='latin1')
+conn = MySQLdb.connect('commonswiki.labsdb', db='commonswiki_p', user = 
config.db_username, passwd = config.db_password, use_unicode=True, 
charset='latin1')
 cursor = conn.cursor()
 return (conn, cursor)
 
diff --git a/erfgoedbot/categorize_images.py b/erfgoedbot/categorize_images.py
index a1550ab..e20b32f 100644
--- a/erfgoedbot/categorize_images.py
+++ b/erfgoedbot/categorize_images.py
@@ -17,7 +17,6 @@
 '''
 import sys
 import monuments_config as mconfig
-sys.path.append("/home/project/e/r/f/erfgoed/pywikipedia")
 import wikipedia, config, pagegenerators, catlib
 import re, imagerecat
 import MySQLdb, config
diff --git a/erfgoedbot/database_statistics.py 
b/erfgoedbot/database_statistics.py
index 44f02a0..c7fb785 100755
--- a/erfgoedbot/database_statistics.py
+++ b/erfgoedbot/database_statistics.py
@@ -7,7 +7,6 @@
 '''
 import sys, time
 import monuments_config as mconfig
-sys.path.append("/home/project/e/r/f/erfgoed/pywikipedia")
 import wikipedia, MySQLdb, config, re, pagegenerators
 
 def connectDatabase():
@@ -61,7 +60,7 @@
#print statistics[country][language]
 
 output = output + u'|-\n'
-output = output + u'| 
[http://toolserver.org/~erfgoed/api/api.php?action=statistics&stcountry=%(country)s&format=html&limit=0
 %(country)s] ' % statistics[country][language]
+output = output + u'| 
[//http://tools.wmflabs.org/heritage/api/api.php?action=statistics&stcountry=%(country)s&format=html&limit=0
 %(country)s] ' % statistics[country][language]
 output = output + u'|| %(lang)s || %(all)s ' % 
statistics[country][language]
 output = output + u'|| %(name)s 
(%(namePercentage)s%%)' % statistics[country][language]
 output = output + u'|| %(address)s 
(%(addressPercentage)s%%)' % statistics[country][language]
diff --git a/erfgoedbot/flickrripper_ee.py b/erfgoedbot/flickrripper_ee.py
index 47f1a82..00b5b35 100644
--- a/erfgoedbot/flickrripper_ee.py
+++ b/erfgoedbot/flickrripper_ee.py
@@ -33,7 +33,6 

[MediaWiki-commits] [Gerrit] Moving from Toolserver svn to Toollabs git * .gitreview * Re... - change (labs...heritage)

2014-06-01 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/136649

Change subject: Moving from Toolserver svn to Toollabs git * .gitreview * 
Removed some path stuff * Commons has a different server on labs This should 
get the tool flying
..

Moving from Toolserver svn to Toollabs git
* .gitreview
* Removed some path stuff
* Commons has a different server on labs
This should get the tool flying

Change-Id: Iee1e4987883793f6d36ec75b2e71b328f91c
---
A .gitreview
M erfgoedbot/add_coord_to_articles.py
M erfgoedbot/add_object_location_monuments.py
M erfgoedbot/categorize_images.py
M erfgoedbot/database_statistics.py
M erfgoedbot/flickrripper_ee.py
M erfgoedbot/flickrripper_ee_etwiki.py
M erfgoedbot/flickrripper_es.py
M erfgoedbot/flickrripper_list.py
M erfgoedbot/images_of_monuments_without_id.py
M erfgoedbot/missing_commonscat_links.py
M erfgoedbot/monument_tables.py
M erfgoedbot/monuments_config.py
M erfgoedbot/populate_image_table.py
M erfgoedbot/top_streets.py
M erfgoedbot/unused_monument_images.py
M erfgoedbot/update_database.py
M erfgoedbot/update_id_dump.py
18 files changed, 15 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage 
refs/changes/49/136649/1

diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..f0b60f4
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=labs/tools/heritage.git
+defaultbranch=master
+defaultrebase=0
diff --git a/erfgoedbot/add_coord_to_articles.py 
b/erfgoedbot/add_coord_to_articles.py
index 9bcca20..9fb97b8 100644
--- a/erfgoedbot/add_coord_to_articles.py
+++ b/erfgoedbot/add_coord_to_articles.py
@@ -18,7 +18,6 @@
 
 import sys, os
 import monuments_config as mconfig
-sys.path.append("/home/project/e/r/f/erfgoed/pywikipedia")
 import wikipedia
 import re, MySQLdb, time
 
@@ -79,7 +78,7 @@
 Connect to the wiki database
 '''
 if (lang):
-hostName = lang + 'wiki-p.db.toolserver.org'
+hostName = lang + 'wiki.labsdb'
 dbName = lang + 'wiki_p'
 #coordDbName = 'u_dispenser_p'
 conn = MySQLdb.connect(host=hostName, db=dbName,
diff --git a/erfgoedbot/add_object_location_monuments.py 
b/erfgoedbot/add_object_location_monuments.py
index e44e3f3..c83f2f4 100644
--- a/erfgoedbot/add_object_location_monuments.py
+++ b/erfgoedbot/add_object_location_monuments.py
@@ -7,7 +7,6 @@
 '''
 import sys
 import monuments_config as mconfig
-sys.path.append("/home/project/e/r/f/erfgoed/pywikipedia")
 import wikipedia, config, pagegenerators, catlib
 import re, imagerecat
 import MySQLdb, config, time
@@ -25,7 +24,7 @@
 '''
 Connect to the commons mysql database, if it fails, go down in flames
 '''
-conn = MySQLdb.connect('commonswiki-p.db.toolserver.org', 
db='commonswiki_p', user = config.db_username, passwd = config.db_password, 
use_unicode=True, charset='latin1')
+conn = MySQLdb.connect('commonswiki.labsdb', db='commonswiki_p', user = 
config.db_username, passwd = config.db_password, use_unicode=True, 
charset='latin1')
 cursor = conn.cursor()
 return (conn, cursor)
 
diff --git a/erfgoedbot/categorize_images.py b/erfgoedbot/categorize_images.py
index a1550ab..e20b32f 100644
--- a/erfgoedbot/categorize_images.py
+++ b/erfgoedbot/categorize_images.py
@@ -17,7 +17,6 @@
 '''
 import sys
 import monuments_config as mconfig
-sys.path.append("/home/project/e/r/f/erfgoed/pywikipedia")
 import wikipedia, config, pagegenerators, catlib
 import re, imagerecat
 import MySQLdb, config
diff --git a/erfgoedbot/database_statistics.py 
b/erfgoedbot/database_statistics.py
index 44f02a0..c7fb785 100755
--- a/erfgoedbot/database_statistics.py
+++ b/erfgoedbot/database_statistics.py
@@ -7,7 +7,6 @@
 '''
 import sys, time
 import monuments_config as mconfig
-sys.path.append("/home/project/e/r/f/erfgoed/pywikipedia")
 import wikipedia, MySQLdb, config, re, pagegenerators
 
 def connectDatabase():
@@ -61,7 +60,7 @@
#print statistics[country][language]
 
 output = output + u'|-\n'
-output = output + u'| 
[http://toolserver.org/~erfgoed/api/api.php?action=statistics&stcountry=%(country)s&format=html&limit=0
 %(country)s] ' % statistics[country][language]
+output = output + u'| 
[//http://tools.wmflabs.org/heritage/api/api.php?action=statistics&stcountry=%(country)s&format=html&limit=0
 %(country)s] ' % statistics[country][language]
 output = output + u'|| %(lang)s || %(all)s ' % 
statistics[country][language]
 output = output + u'|| %(name)s 
(%(namePercentage)s%%)' % statistics[country][language]
 output = output + u'|| %(address)s 
(%(addressPercentage)s%%)' % statistics[country][language]
diff --git a/erfgoedbot/flickrripper_ee.py b/erfgoedbot/flickrripper_ee.py
index 47f1a82..00b5b35 100644
--- a/erfgoedbot/flickrripp

[MediaWiki-commits] [Gerrit] Some cleanup to move from Toolserver to Toollabs: * Changed ... - change (labs...multichill)

2014-05-31 Thread Multichill (Code Review)
Multichill has submitted this change and it was merged.

Change subject: Some cleanup to move from Toolserver to Toollabs: * Changed 
hardcoded database servers * Removed a lot of hardcoded paths * Added .gitreview
..


Some cleanup to move from Toolserver to Toollabs:
* Changed hardcoded database servers
* Removed a lot of hardcoded paths
* Added .gitreview

Change-Id: Ied9643b81d7baa0ac9b6c660376dfec81e8f0585
---
A .gitreview
M bot/Europeana/Europeana_uploader.py
M bot/Geographicus/Geographicus_uploader.py
M bot/NARA/NARA_uploader.py
M bot/Nationaal_Archief/NA_uploader1.py
M bot/Nationaal_Archief/NA_uploader2.py
M bot/Nationaal_Archief/SFA_uploader1.py
M bot/Nationaal_Archief/SFA_uploader2.py
M bot/Nationaal_Archief/SFA_uploader3.py
M bot/Ordnance_Survey/250Kgenerator.py
M bot/Ordnance_Survey/OSlib.py
M bot/Web_Gallery_of_Art/WGA_uploader.py
M bot/all_category_from_gallery.py
M bot/best_of_commons/best_of_commons.py
M bot/bycountry.py
M bot/categorization_graph.py
M bot/categorization_stats.py
M bot/category_suggestions.py
M bot/category_suggestions2.py
M bot/create_page/files_moved_to_Commons_requiring_review.py
M bot/create_page/files_moved_to_Commons_requiring_review_bulk.py
M bot/create_page/media_needing_categories.py
M bot/create_page/media_needing_category_review.py
M bot/create_page/otrs_pending.py
M bot/create_page/otrs_received.py
M bot/create_page/te_verwijderen_cats.py
M bot/create_page/te_verwijderen_sjablonen.py
M bot/create_page/unknown.py
M bot/data_ingestion_rce.py
M bot/erfgoed/NRHP_refnums.py
M bot/erfgoed/Scotland_lists.py
M bot/erfgoed/add_rijksmonument_template.py
M bot/erfgoed/add_topic_category.py
M bot/erfgoed/afbeeldingen_rijksmonumenten.py
M bot/erfgoed/categorize_rijksmonumenten.py
M bot/erfgoed/clean_wiki.py
M bot/erfgoed/download_WLM.py
M bot/erfgoed/flickrripper_rijksmonumenten.py
M bot/erfgoed/flickrripper_wlm.py
M bot/erfgoed/object_location_rijksmonumenten.py
M bot/erfgoed/rijksmonumenten_without_id.py
M bot/erfgoed/unused_rijksmonumenten_photos.py
M bot/erfgoed/update_database.py
M bot/fema/fema_bot.py
M bot/fotothek/fotothek_description_generator.py
M bot/fotothek/fotothek_image_renamer.py
M bot/fotothek/fotothek_xml_parser.py
M bot/free_uploads_enwp.py
M bot/geograph/batch_generator.py
M bot/geograph/calculate_distance.py
M bot/geograph/categorize_images.py
M bot/geograph/cats_to_split.py
M bot/geograph/description_restoration.py
M bot/geograph/generate_batches.py
M bot/geograph/geograph_lib.py
M bot/geograph/topic_stats.py
M bot/intersect_categories.py
M bot/kit/kit_description_generator.py
M bot/loose_category_from_gallery.py
M bot/my_uncategorized.py
M bot/nocountry.py
M bot/nocountryhints.py
M bot/notify_uncategorized.py
M bot/openbeelden/openbeelden_uploader.py
M bot/populate_category.py
M bot/self_uploads_enwp.py
M bot/sort/sort_TOL_category.py
M bot/sort/sort_by_country_category.py
M bot/tag_nowcommons.py
M bot/tag_potd_templates.py
M bot/tag_uncategorized_templates.py
M bot/templates_check.py
M bot/test.py
M bot/usgov/air_force_bot.py
M bot/usgov/air_force_galleries.py
M bot/usgov/army_bot.py
M bot/usgov/fema_bot.py
M bot/usgov/habs_bot.py
M bot/usgov/navy_bot.py
M bot/wlanl/upload_to_commons.py
80 files changed, 17 insertions(+), 97 deletions(-)

Approvals:
  Multichill: Verified; Looks good to me, approved



diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..e9fadfa
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=labs/tools/multichill.git
+defaultbranch=master
+defaultrebase=0
diff --git a/bot/Europeana/Europeana_uploader.py 
b/bot/Europeana/Europeana_uploader.py
index 484948b..c446095 100644
--- a/bot/Europeana/Europeana_uploader.py
+++ b/bot/Europeana/Europeana_uploader.py
@@ -6,9 +6,6 @@
 '''
 import sys, os.path, glob, re, hashlib, base64, StringIO
 import xml.etree.ElementTree
-#sys.path.append("/home/multichill/pywikipedia")
-sys.path.append("c:/pywikipedia/")
-sys.path.append("../")
 import wikipedia, config, query, upload
 import csv, urllib
 import dezoomify
diff --git a/bot/Geographicus/Geographicus_uploader.py 
b/bot/Geographicus/Geographicus_uploader.py
index 46f0663..3c865e2 100644
--- a/bot/Geographicus/Geographicus_uploader.py
+++ b/bot/Geographicus/Geographicus_uploader.py
@@ -5,9 +5,6 @@
 
 '''
 import sys, os.path, glob, re, hashlib, base64
-#sys.path.append("/home/multichill/pywikipedia")
-sys.path.append("D:/Wikipedia/pywikipedia/")
-sys.path.append("../")
 import wikipedia, config, query, upload
 import csv
 import dezoomify
diff --git a/bot/NARA/NARA_uploader.py b/bot/NARA/NARA_uploader.py
index 544ba73..e332fe3 100644
--- a/bot/NARA/NARA_uploader.py
+++ b/bot/NARA/NARA_uploader.py
@@ -10,7 +10,6 @@
 
 '''
 import sys, os.path, hashlib, base64, glob, re, urllib, time
-sys.path.append("..\..\pywikipedia")
 import wikipedia, config, query, upload
 import shutil, socket
 
diff --git a/bot/Natio

[MediaWiki-commits] [Gerrit] Some cleanup to move from Toolserver to Toollabs: * Changed ... - change (labs...multichill)

2014-05-31 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/136536

Change subject: Some cleanup to move from Toolserver to Toollabs: * Changed 
hardcoded database servers * Removed a lot of hardcoded paths * Added .gitreview
..

Some cleanup to move from Toolserver to Toollabs:
* Changed hardcoded database servers
* Removed a lot of hardcoded paths
* Added .gitreview

Change-Id: Ied9643b81d7baa0ac9b6c660376dfec81e8f0585
---
A .gitreview
M bot/Europeana/Europeana_uploader.py
M bot/Geographicus/Geographicus_uploader.py
M bot/NARA/NARA_uploader.py
M bot/Nationaal_Archief/NA_uploader1.py
M bot/Nationaal_Archief/NA_uploader2.py
M bot/Nationaal_Archief/SFA_uploader1.py
M bot/Nationaal_Archief/SFA_uploader2.py
M bot/Nationaal_Archief/SFA_uploader3.py
M bot/Ordnance_Survey/250Kgenerator.py
M bot/Ordnance_Survey/OSlib.py
M bot/Web_Gallery_of_Art/WGA_uploader.py
M bot/all_category_from_gallery.py
M bot/best_of_commons/best_of_commons.py
M bot/bycountry.py
M bot/categorization_graph.py
M bot/categorization_stats.py
M bot/category_suggestions.py
M bot/category_suggestions2.py
M bot/create_page/files_moved_to_Commons_requiring_review.py
M bot/create_page/files_moved_to_Commons_requiring_review_bulk.py
M bot/create_page/media_needing_categories.py
M bot/create_page/media_needing_category_review.py
M bot/create_page/otrs_pending.py
M bot/create_page/otrs_received.py
M bot/create_page/te_verwijderen_cats.py
M bot/create_page/te_verwijderen_sjablonen.py
M bot/create_page/unknown.py
M bot/data_ingestion_rce.py
M bot/erfgoed/NRHP_refnums.py
M bot/erfgoed/Scotland_lists.py
M bot/erfgoed/add_rijksmonument_template.py
M bot/erfgoed/add_topic_category.py
M bot/erfgoed/afbeeldingen_rijksmonumenten.py
M bot/erfgoed/categorize_rijksmonumenten.py
M bot/erfgoed/clean_wiki.py
M bot/erfgoed/download_WLM.py
M bot/erfgoed/flickrripper_rijksmonumenten.py
M bot/erfgoed/flickrripper_wlm.py
M bot/erfgoed/object_location_rijksmonumenten.py
M bot/erfgoed/rijksmonumenten_without_id.py
M bot/erfgoed/unused_rijksmonumenten_photos.py
M bot/erfgoed/update_database.py
M bot/fema/fema_bot.py
M bot/fotothek/fotothek_description_generator.py
M bot/fotothek/fotothek_image_renamer.py
M bot/fotothek/fotothek_xml_parser.py
M bot/free_uploads_enwp.py
M bot/geograph/batch_generator.py
M bot/geograph/calculate_distance.py
M bot/geograph/categorize_images.py
M bot/geograph/cats_to_split.py
M bot/geograph/description_restoration.py
M bot/geograph/generate_batches.py
M bot/geograph/geograph_lib.py
M bot/geograph/topic_stats.py
M bot/intersect_categories.py
M bot/kit/kit_description_generator.py
M bot/loose_category_from_gallery.py
M bot/my_uncategorized.py
M bot/nocountry.py
M bot/nocountryhints.py
M bot/notify_uncategorized.py
M bot/openbeelden/openbeelden_uploader.py
M bot/populate_category.py
M bot/self_uploads_enwp.py
M bot/sort/sort_TOL_category.py
M bot/sort/sort_by_country_category.py
M bot/tag_nowcommons.py
M bot/tag_potd_templates.py
M bot/tag_uncategorized_templates.py
M bot/templates_check.py
M bot/test.py
M bot/usgov/air_force_bot.py
M bot/usgov/air_force_galleries.py
M bot/usgov/army_bot.py
M bot/usgov/fema_bot.py
M bot/usgov/habs_bot.py
M bot/usgov/navy_bot.py
M bot/wlanl/upload_to_commons.py
80 files changed, 17 insertions(+), 97 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/multichill 
refs/changes/36/136536/1

diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..e9fadfa
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=labs/tools/multichill.git
+defaultbranch=master
+defaultrebase=0
diff --git a/bot/Europeana/Europeana_uploader.py 
b/bot/Europeana/Europeana_uploader.py
index 484948b..c446095 100644
--- a/bot/Europeana/Europeana_uploader.py
+++ b/bot/Europeana/Europeana_uploader.py
@@ -6,9 +6,6 @@
 '''
 import sys, os.path, glob, re, hashlib, base64, StringIO
 import xml.etree.ElementTree
-#sys.path.append("/home/multichill/pywikipedia")
-sys.path.append("c:/pywikipedia/")
-sys.path.append("../")
 import wikipedia, config, query, upload
 import csv, urllib
 import dezoomify
diff --git a/bot/Geographicus/Geographicus_uploader.py 
b/bot/Geographicus/Geographicus_uploader.py
index 46f0663..3c865e2 100644
--- a/bot/Geographicus/Geographicus_uploader.py
+++ b/bot/Geographicus/Geographicus_uploader.py
@@ -5,9 +5,6 @@
 
 '''
 import sys, os.path, glob, re, hashlib, base64
-#sys.path.append("/home/multichill/pywikipedia")
-sys.path.append("D:/Wikipedia/pywikipedia/")
-sys.path.append("../")
 import wikipedia, config, query, upload
 import csv
 import dezoomify
diff --git a/bot/NARA/NARA_uploader.py b/bot/NARA/NARA_uploader.py
index 544ba73..e332fe3 100644
--- a/bot/NARA/NARA_uploader.py
+++ b/bot/NARA/NARA_uploader.py
@@ -10,7 +10,6 @@
 
 '''
 import sys, os.path, hashlib, base64, glob, re, urllib, time
-sys.path.append("..\..\pywikipedia")
 import wikipedia, config,

[MediaWiki-commits] [Gerrit] Don't crash when the bot hits an unknown globe - change (pywikibot/core)

2014-05-10 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/132762

Change subject: Don't crash when the bot hits an unknown globe
..

Don't crash when the bot hits an unknown globe

bug: 64495
Change-Id: Ie261991717bf5876054b30da6fcc6574b35ebe00
---
M scripts/coordinate_import.py
1 file changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/62/132762/1

diff --git a/scripts/coordinate_import.py b/scripts/coordinate_import.py
index d732c22..fa49bcb 100644
--- a/scripts/coordinate_import.py
+++ b/scripts/coordinate_import.py
@@ -62,12 +62,14 @@
 newclaim = pywikibot.Claim(self.repo, u'P625')
 newclaim.setTarget(coordinate)
 pywikibot.output(u'Adding %s, %s to %s' % 
(coordinate.lat, coordinate.lon, item.title()))
-item.addClaim(newclaim)
+   try:
+item.addClaim(newclaim)
 
-source = self.getSource(page.site)
-if source:
-newclaim.addSource(source, bot=True)
-
+source = self.getSource(page.site)
+if source:
+ newclaim.addSource(source, bot=True)
+except NotImplementedError as e:
+   pywikibot.output(u'Skipping unsupported globe: %s' 
% e.args)
 
 def main():
 gen = pagegenerators.GeneratorFactory()

-- 
To view, visit https://gerrit.wikimedia.org/r/132762
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie261991717bf5876054b30da6fcc6574b35ebe00
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Adding all the moons and (dwarf) planets which have more tha... - change (pywikibot/core)

2014-05-10 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/132758

Change subject: Adding all the moons and (dwarf) planets which have more than 
one link on the English Wikipedia.
..

Adding all the moons and (dwarf) planets which have more than one link on the 
English Wikipedia.

bug: 64495
Change-Id: I41d932bab39624fd861453075fb8683055960c76
---
M pywikibot/families/wikidata_family.py
1 file changed, 24 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/58/132758/1

diff --git a/pywikibot/families/wikidata_family.py 
b/pywikibot/families/wikidata_family.py
index 849a279..473ac78 100644
--- a/pywikibot/families/wikidata_family.py
+++ b/pywikibot/families/wikidata_family.py
@@ -33,10 +33,34 @@
 def globes(self, code):
 """Supported globes for Coordinate datatype"""
 return {
+   'ariel': 'http://www.wikidata.org/entity/Q3343',
+   'callisto': 'http://www.wikidata.org/entity/Q3134',
+   'ceres': 'http://www.wikidata.org/entity/Q596',
+   'deimos': 'http://www.wikidata.org/entity/Q7548',
+   'dione': 'http://www.wikidata.org/entity/Q15040',
 'earth': 'http://www.wikidata.org/entity/Q2',
+   'enceladus': 'http://www.wikidata.org/entity/Q3303',
+   'europa': 'http://www.wikidata.org/entity/Q3143', 
+   'ganymede': 'http://www.wikidata.org/entity/Q3169',
+   'hyperion': 'http://www.wikidata.org/entity/Q15037',
+   'iapetus': 'http://www.wikidata.org/entity/Q17958',
+   'io': 'http://www.wikidata.org/entity/Q3123',
+   'jupiter': 'http://www.wikidata.org/entity/Q319',
 'mars': 'http://www.wikidata.org/entity/Q111',
 'mercury': 'http://www.wikidata.org/entity/Q308',
 'mimas': 'http://www.wikidata.org/entity/Q15034',
+   'miranda': 'http://www.wikidata.org/entity/Q3352',
 'moon': 'http://www.wikidata.org/entity/Q405',
+   'oberon': 'http://www.wikidata.org/entity/Q3332',
+   'phobos': 'http://www.wikidata.org/entity/Q7547',
+   'phoebe': 'http://www.wikidata.org/entity/Q17975',
+   'pluto': 'http://www.wikidata.org/entity/Q339',
+   'rhea': 'http://www.wikidata.org/entity/Q108419',
+   'tethys': 'http://www.wikidata.org/entity/Q15047',
+   'titan': 'http://www.wikidata.org/entity/Q2565',
+   'titania': 'http://www.wikidata.org/entity/Q3322',
+   'triton': 'http://www.wikidata.org/entity/Q3359',
+   'umbriel': 'http://www.wikidata.org/entity/Q3338',
 'venus': 'http://www.wikidata.org/entity/Q313',
+   'vesta': 'http://www.wikidata.org/entity/Q3030',
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/132758
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41d932bab39624fd861453075fb8683055960c76
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix the yesterday generator bug: 65135 - change (pywikibot/core)

2014-05-10 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/132722

Change subject: Fix the yesterday generator bug: 65135
..

Fix the yesterday generator
bug: 65135

Change-Id: I04ae2f6a4cef6e4904999492f081a7466b441c0b
---
M scripts/imageuncat.py
1 file changed, 5 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/22/132722/1

diff --git a/scripts/imageuncat.py b/scripts/imageuncat.py
index decbdca..19e5126 100755
--- a/scripts/imageuncat.py
+++ b/scripts/imageuncat.py
@@ -18,7 +18,6 @@
 from datetime import timedelta
 import pywikibot
 from pywikibot import pagegenerators
-import query
 
 #Probably unneeded because these are hidden categories. Have to figure it out.
 ignoreCategories = [u'[[Category:CC-BY-SA-3.0]]',
@@ -1235,37 +1234,18 @@
 putcomment = u'Please add categories to this image'
 
 
-def uploadedYesterday(site=None):
+def uploadedYesterday(site):
 '''
 Return a pagegenerator containing all the pictures uploaded yesterday.
 Should probably copied to somewhere else
 '''
 result = []
 dateformat = "%Y-%m-%dT00:00:00Z"
-today = datetime.utcnow()
+today = pywikibot.Timestamp.utcnow()
 yesterday = today + timedelta(days=-1)
 
-params = {
-'action':  'query',
-'list':'logevents',
-'leprop':  'title',
-'letype':  'upload',
-'ledir':   'newer',
-'lelimit': '5000',
-'lestart': yesterday.strftime(dateformat),
-'leend':   today.strftime(dateformat)
-}
-
-data = query.GetData(params, site)
-try:
-for item in data['query']['logevents']:
-result.append(item['title'])
-except IndexError:
-raise NoPage(u'API Error, nothing found in the APIs')
-except KeyError:
-raise NoPage(u'API Error, nothing found in the APIs')
-
-return pagegenerators.PagesFromTitlesGenerator(result, site)
+for logentry in site.logevents(logtype='upload', start=yesterday, 
end=today, reverse=True):
+yield logentry.title()
 
 
 def recentChanges(site=None, delay=0, block=70):
@@ -1357,7 +1337,7 @@
 pywikibot.output(
 u'You have to specify the generator you want to use for the 
program!')
 else:
-pregenerator = site.preloadpages(generator)
+pregenerator = pagegenerators.PreloadingGenerator(generator)
 for page in pregenerator:
 pywikibot.output(page.title())
 if page.exists() and (page.namespace() == 6) \

-- 
To view, visit https://gerrit.wikimedia.org/r/132722
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I04ae2f6a4cef6e4904999492f081a7466b441c0b
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] (64174) Bot to illustrate Wikidata - change (pywikibot/core)

2014-04-21 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/127644

Change subject: (64174) Bot to illustrate Wikidata
..

(64174) Bot to illustrate Wikidata

Change-Id: I8db93b3e9af90c5057b2d9b35c0fd85da41d3343
---
A scripts/illustrate_wikidata.py
1 file changed, 110 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/44/127644/1

diff --git a/scripts/illustrate_wikidata.py b/scripts/illustrate_wikidata.py
new file mode 100644
index 000..719d4ba
--- /dev/null
+++ b/scripts/illustrate_wikidata.py
@@ -0,0 +1,110 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+"""
+Bot to add images to Wikidata items. The image is extracted from the 
page_props.
+For this to be available the PageImages extension 
(https://www.mediawiki.org/wiki/Extension:PageImages) needs to be installed
+
+Usage:
+
+python illustrate_wikidata.py 
+
+python harvest_template.py -lang:en -catr:Category:Railway_stations_in_New_York
+
+¶ms;
+"""
+#
+# (C) Multichill 2014
+# (C) Pywikibot team, 2013-2014
+#
+# Distributed under the terms of MIT License.
+#
+__version__ = '$Id$'
+#
+
+import re
+import pywikibot
+from pywikibot import pagegenerators as pg, WikidataBot
+
+docuReplacements = {'¶ms;': pywikibot.pagegenerators.parameterHelp}
+
+
+class IllustrateRobot(WikidataBot):
+"""
+A bot to add Wikidata image claims
+"""
+def __init__(self, generator, wdproperty=u'P18'):
+"""
+Arguments:
+* generator - A generator that yields Page objects.
+* wdproperty- The property to add. Should be of type 
commonsMedia
+
+"""
+self.generator = pg.PreloadingGenerator(generator)
+self.wdproperty = wdproperty
+self.repo = pywikibot.Site().data_repository()
+self.cacheSources()
+
+claim = pywikibot.Claim(self.repo, self.wdproperty)
+if not claim.getType() == 'commonsMedia':
+raise ValueError(u'%s is of type %s, should be commonsMedia' % 
(self.wdproperty, claim.getType()))
+
+def run(self):
+"""
+Starts the robot.
+"""
+for page in self.generator:
+pywikibot.output(u'Working on %s' % page.title())
+item = pywikibot.ItemPage.fromPage(page)
+
+if item.exists():
+pywikibot.output(u'Found %s' % item.title())
+imagename = page.properties().get('page_image')
+
+if imagename:
+claims = item.get().get('claims')
+if self.wdproperty in claims:
+pywikibot.output(u'Item %s already contains image 
(%s)' % (item.title(), self.wdproperty))
+else:
+newclaim = pywikibot.Claim(self.repo, self.wdproperty)
+commonssite = pywikibot.Site("commons", "commons")
+imagelink = pywikibot.Link(imagename, 
source=commonssite, defaultNamespace=6)
+image = pywikibot.ImagePage(imagelink)
+if image.isRedirectPage():
+image = 
pywikibot.ImagePage(image.getRedirectTarget())
+if not image.exists():
+pywikibot.output('[[%s]] doesn\'t exist so I 
can\'t link to it' % (image.title(),))
+continue
+newclaim.setTarget(image)
+pywikibot.output('Adding %s --> %s' % 
(newclaim.getID(), newclaim.getTarget()))
+item.addClaim(newclaim)
+
+# A generator might yield pages from multiple sites
+source = self.getSource(page.site)
+if source:
+newclaim.addSource(source, bot=True)
+
+
+def main():
+gen = pg.GeneratorFactory()
+commandline_arguments = list()
+wdproperty = u'P18'
+for arg in pywikibot.handleArgs():
+if arg.startswith('-property'):
+if len(arg) == 9:
+wdproperty = pywikibot.input(
+u'Please enter the property you want to add:')
+else:
+wdproperty = arg[10:]
+elif gen.handleArg(arg):
+continue
+
+generator = gen.getCombinedGenerator()
+if not generator:
+pywikibot.output('I need a generator with pages to work on')
+return
+
+bot = IllustrateRobot(generator, wdproperty)
+bot.run()
+
+if __name__ == "__main__":
+main()

-- 
To view, visit https://gerrit.wikimedia.org/r/127644
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8db93b3e9af90c5057b2d9b35c0fd85da41d3343
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commit

[MediaWiki-commits] [Gerrit] (bug 62008) Added support for images - change (pywikibot/core)

2014-04-20 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/127478

Change subject: (bug 62008) Added support for images
..

(bug 62008) Added support for images

Change-Id: Id99cdea6581a4a5ccf9f810c60ed3a0c53127769
---
M scripts/harvest_template.py
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/78/127478/1

diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index 2507544..53c2baf 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -145,6 +145,11 @@
 continue
 elif claim.getType() == 'string':
 claim.setTarget(value.strip())
+elif claim.getType() == 'commonsMedia':
+commonssite = pywikibot.Site("commons", 
"commons")
+imagelink = pywikibot.Link(value, 
source=commonssite, defaultNamespace=6)
+image = pywikibot.ImagePage(imagelink)
+claim.setTarget(image)
 else:
 pywikibot.output("%s is not a supported 
datatype." % claim.getType())
 continue

-- 
To view, visit https://gerrit.wikimedia.org/r/127478
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id99cdea6581a4a5ccf9f810c60ed3a0c53127769
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] (bug 62011) Script to import coordinates from Wikipedia to W... - change (pywikibot/core)

2014-03-02 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/116285

Change subject: (bug 62011) Script to import coordinates from Wikipedia to 
Wikidata
..

(bug 62011) Script to import coordinates from Wikipedia to Wikidata

The bot uses the data for the GeoData extension available through
page.coordinates().

Some related bugs need to be fixed before this script becomes fully
functional:
* bug 62105: globecoordinate serialization fails on some precision values
* bug 62119: Bot crashes on malllformed coordinates api output

Change-Id: I966dc95354b5f08ff3d077a0a8e0e606f1ba8e76
---
A scripts/coordinate_import.py
1 file changed, 109 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/85/116285/1

diff --git a/scripts/coordinate_import.py b/scripts/coordinate_import.py
new file mode 100644
index 000..f89f55f
--- /dev/null
+++ b/scripts/coordinate_import.py
@@ -0,0 +1,109 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+"""
+Usage:
+
+python coordinate_import.py -lang:en -family:wikipedia 
-cat:Category:Coordinates_not_on_Wikidata
+
+This will work on all pages in the category "coordinates not on Wikidata" and 
will import the coordinates on these pages to Wikidata.
+
+The data from the "GeoData" extension 
(https://www.mediawiki.org/wiki/Extension:GeoData) is used so that extension 
has to be setup properly.
+You can look at the [[Special:Nearby]] page on your local Wiki to see if it's 
populated.
+
+You can use any typical pagegenerator to provide with a list of pages:
+
+python coordinate_import.py -lang:it -family:wikipedia 
-transcludes:Infobox_stazione_ferroviaria -namespace:0
+
+¶ms;
+"""
+#
+# (C) Multichill 2014
+# (C) Pywikibot team, 2013
+#
+# Distributed under the terms of MIT License.
+#
+__version__ = '$Id$'
+#
+import json
+import pywikibot
+from pywikibot import pagegenerators
+
+
+class coordImportRobot:
+"""
+A bot to import coordinates to Wikidata
+"""
+def __init__(self, generator):
+"""
+Arguments:
+* generator- A generator that yields Page objects.
+
+"""
+self.generator = pagegenerators.PreloadingGenerator(generator)
+self.site = pywikibot.Site()
+self.repo = pywikibot.Site().data_repository()
+self.cacheSources()
+
+def getSource(self, lang):
+"""
+Get the source for the specified language,
+if possible
+"""
+if lang in self.source_values:
+source = pywikibot.Claim(self.repo, 'p143')
+source.setTarget(self.source_values.get(lang))
+return source
+
+def cacheSources(self):
+"""
+Fetches the sources from the onwiki list
+and stores it internally
+"""
+page = pywikibot.Page(self.repo, u'Wikidata:List of wikis/python')
+self.source_values = json.loads(page.get())
+self.source_values = self.source_values['wikipedia']
+for source_lang in self.source_values:
+self.source_values[source_lang] = pywikibot.ItemPage(self.repo,
+ 
self.source_values[source_lang])
+
+def run(self):
+"""
+Starts the robot.
+"""
+for page in self.generator:
+pywikibot.output(u'Working on %s' % page.title())
+item = pywikibot.ItemPage.fromPage(page)
+
+if item.exists():
+pywikibot.output(u'Found %s' % item.title())
+coordinate = page.coordinates(primary_only=True)
+
+if coordinate:
+claims = item.get().get('claims')
+if u'P625' in claims:
+pywikibot.output(u'Item %s already contains 
coordinates (P625)' % item.title())
+else:
+newclaim = pywikibot.Claim(self.repo, u'P625')
+newclaim.setTarget(coordinate)
+pywikibot.output(u'Adding %s, %s to %s' % 
(coordinate.lat, coordinate.lon, item.title()))
+item.addClaim(newclaim)
+
+source = self.getSource(page.site.language())
+if source:
+newclaim.addSource(source, bot=True)
+
+
+def main():
+gen = pagegenerators.GeneratorFactory()
+
+for arg in pywikibot.handleArgs():
+if gen.handleArg(arg):
+continue
+
+generator = gen.getCombinedGenerator()
+
+coordbot = coordImportRobot(generator)
+coordbot.run()
+
+if __name__ == "__main__":
+main()

-- 
To view, visit https://gerrit.wikimedia.org/r/116285
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I966dc95354b5f08ff3d077a0a8e0e606f1ba8e76
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
G

[MediaWiki-commits] [Gerrit] New bot to create new items. - change (pywikibot/core)

2014-03-02 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/116284

Change subject: New bot to create new items.
..

New bot to create new items.

Change-Id: I43a46ceaa09532a1215a9e5a4cd59d0d58b41683
---
A scripts/newitem.py
1 file changed, 112 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/84/116284/1

diff --git a/scripts/newitem.py b/scripts/newitem.py
new file mode 100644
index 000..9a258ae
--- /dev/null
+++ b/scripts/newitem.py
@@ -0,0 +1,112 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+"""
+This script creates new items on Wikidata based on certain criteria.
+* When was the (Wikipedia) page created?
+* When was the last edit on the page?
+* Does the page contain interwiki's?
+
+"""
+#
+# (C) Multichill, 2014
+# (C) Pywikibot team, 2014
+#
+# Distributed under the terms of the MIT license.
+#
+__version__ = '$Id$'
+#
+
+import json
+import pywikibot
+from pywikibot import pagegenerators
+from datetime import datetime
+from datetime import timedelta
+
+
+class NewItemRobot:
+"""
+A bot to create new items
+"""
+def __init__(self, generator, pageAge, lastEdit):
+"""
+Arguments:
+* generator- A generator that yields Page objects.
+* pageAge  - The minimum number of days that has passed since 
the page was created
+* lastEdit - The minimum number of days that has passed since 
the page was last edited
+
+"""
+self.generator = pagegenerators.PreloadingGenerator(generator)
+self.repo = pywikibot.Site().data_repository()
+self.pageAge = pageAge
+self.pageAgeBefore = self.repo.getcurrenttime() - 
timedelta(days=self.pageAge)
+self.lastEdit = lastEdit
+self.lastEditBefore = self.repo.getcurrenttime() - 
timedelta(days=self.lastEdit)
+
+def run(self):
+"""
+Starts the robot.
+"""
+pywikibot.output('Page age is set to %s days so only pages created 
before %s will be considered.' % (self.pageAge, self.pageAgeBefore.isoformat()))
+pywikibot.output('Last edit is set to %s days so only pages last 
edited before %s will be considered.' % (self.lastEdit, 
self.lastEditBefore.isoformat()))
+
+for page in self.generator:
+pywikibot.output('Processing %s' % page)
+item = pywikibot.ItemPage.fromPage(page)
+if item.exists():
+pywikibot.output('%s already has an item: %s. Doing a null 
edit on the page.' % (page, item))
+page.put(page.get())
+elif page.isRedirectPage():
+pywikibot.output('%s is a redirect page. Skipping.' % page)
+elif page.editTime() > self.lastEditBefore:
+pywikibot.output('Last edit on %s was on %s. Too recent. 
Skipping.' % (page, page.editTime().isoformat()))
+else:
+(revId, revTimestamp, revUser, revComment) = 
page.getVersionHistory(reverseOrder=True, total=1)[0]
+if revTimestamp > self.pageAgeBefore:
+pywikibot.output('Page creation of %s on %s is too recent. 
Skipping.' % (page, page.editTime().isoformat()))
+elif page.langlinks():
+# FIXME: Implement this
+pywikibot.output('Found language links (interwiki links). 
Haven\'t implemented that yet so skipping.')
+else:
+# FIXME: i18n
+summary= u'Bot: New item with sitelink from %s' % 
(page.title(asLink=True, insite=self.repo),)
+
+data = {'sitelinks':
+{item.getdbName(page.site) :
+ {'site': item.getdbName(page.site),
+  'title': page.title()}
+ },
+'labels':
+{page.site.lang:
+ {'language': page.site.lang,
+  'value': page.title()}
+}
+   }
+pywikibot.output(summary)
+item.editEntity(data, summary=summary)
+# And do a null edit to force update
+page.put(page.get())
+
+def main():
+pageAge = 21
+lastEdit = 7
+
+gen = pagegenerators.GeneratorFactory()
+
+for arg in pywikibot.handleArgs():
+if arg.startswith('-pageage:'):
+pageAge = int(arg[9:])
+elif arg.startswith('-lastedit:'):
+lastEdit = int(arg[10:])
+if gen.handleArg(arg):
+continue
+
+generator = gen.getCombinedGenerator()
+if not generator:
+# FIXME: Should throw some help
+return
+
+bot = NewItemRobot(generator, pageAge, lastEdit)
+bot.run()
+
+if __name__ == "__main__":
+main()

--

[MediaWiki-commits] [Gerrit] Fix coordinates bug - change (pywikibot/core)

2014-03-02 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/116281

Change subject: Fix coordinates bug
..

Fix coordinates bug

Change-Id: Iaa38d76ada7732f071936b2e3ec3a7e730fcd56f
---
M pywikibot/data/api.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/81/116281/1

diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 45c5d04..264dc13 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -1006,7 +1006,7 @@
 coord = pywikibot.Coordinate(lat=co['lat'],
  lon=co['lon'],
  typ=co.get('type', ''),
- name=co['name'],
+ name=co.get('name', ''),
  dim=int(co['dim']),
  globe=co['globe'],  # See 
[[gerrit:67886]]
  )

-- 
To view, visit https://gerrit.wikimedia.org/r/116281
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa38d76ada7732f071936b2e3ec3a7e730fcd56f
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Adding messages for the cc-by-4.0 and cc-by-sa-4.0 licenses. - change (mediawiki...WikimediaMessages)

2013-12-21 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/103098


Change subject: Adding messages for the cc-by-4.0 and cc-by-sa-4.0 licenses.
..

Adding messages for the cc-by-4.0 and cc-by-sa-4.0 licenses.

Change-Id: If93c5e27c4a38a5229ede5694b36715d02ef6ede
---
M WikimediaCCLicenseTexts.i18n.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages 
refs/changes/98/103098/1

diff --git a/WikimediaCCLicenseTexts.i18n.php b/WikimediaCCLicenseTexts.i18n.php
index da35bbd..2f58812 100644
--- a/WikimediaCCLicenseTexts.i18n.php
+++ b/WikimediaCCLicenseTexts.i18n.php
@@ -96,6 +96,7 @@
'wm-license-cc-by-3.0-th-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by/3.0/th/deed.en Attribution 3.0 Thailand] 
license.',
'wm-license-cc-by-3.0-tw-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by/3.0/tw/deed.en Attribution 3.0 Taiwan] 
license.',
'wm-license-cc-by-3.0-us-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by/3.0/us/deed.en Attribution 3.0 United 
States] license.',
+   'wm-license-cc-by-4.0-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by/4.0/deed.en Attribution 4.0 International] 
license.',
'wm-license-cc-by-sa-1.0-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by-sa/1.0/deed.en Attribution-Share Alike 1.0 
Generic] license.',
'wm-license-cc-by-sa-1.0-fi-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by-sa/1.0/fi/deed.en Attribution-Share Alike 
1.0 Finland] license.',
'wm-license-cc-by-sa-1.0-il-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by-sa/1.0/il/deed.en Attribution-Share Alike 
1.0 Israel] license.',
@@ -182,6 +183,7 @@
'wm-license-cc-by-sa-3.0-th-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by-sa/3.0/th/deed.en Attribution-Share Alike 
3.0 Thailand] license.',
'wm-license-cc-by-sa-3.0-tw-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by-sa/3.0/tw/deed.en Attribution-Share Alike 
3.0 Taiwan] license.',
'wm-license-cc-by-sa-3.0-us-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by-sa/3.0/us/deed.en Attribution-Share Alike 
3.0 United States] license.',
+   'wm-license-cc-by-sa-4.0-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by-sa/4.0/deed.en Attribution-Share Alike 4.0 
International] license.',
'wm-license-cc-sa-1.0-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/sa/1.0/deed.en Share Alike 1.0 Generic] 
license.',
'wm-license-cc-sa-1.0-fi-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/sa/1.0/fi/deed.en Share Alike 1.0 Finland] 
license.',
'wm-license-cc-sa-1.0-nl-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/sa/1.0/nl/deed.en Share Alike 1.0 Netherlands] 
license.',

-- 
To view, visit https://gerrit.wikimedia.org/r/103098
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If93c5e27c4a38a5229ede5694b36715d02ef6ede
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMessages
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix normalization of template name in harvest_template - change (pywikibot/core)

2013-10-10 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/89046


Change subject: Fix normalization of template name in harvest_template
..

Fix normalization of template name in harvest_template

bug: 55122
Change-Id: Ie5969c5ac07c0a0f2b8a104f16513e24f0aa796a
---
M scripts/harvest_template.py
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/46/89046/1

diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index 4ccd825..950fec1 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -108,8 +108,7 @@
 templates = pywikibot.extract_templates_and_params(pagetext)
 for (template, fielddict) in templates:
 # Clean up the template
-template = template.replace(u'_', u' ')
-template = template[0].upper() + template[1:]
+template = pywikibot.Page(page.site, template, 
ns=10).title(withNamespace=False)
 
 # We found the template we were looking for
 if template in self.templateTitles:

-- 
To view, visit https://gerrit.wikimedia.org/r/89046
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie5969c5ac07c0a0f2b8a104f16513e24f0aa796a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix bug that harvest_template ignores lowercase templates - change (pywikibot/core)

2013-10-10 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/89032


Change subject: Fix bug that harvest_template ignores lowercase templates
..

Fix bug that harvest_template ignores lowercase templates

bug: 55122
Change-Id: I77581dc0d8c90113b0d7b558338da8acb7544ce0
---
M scripts/harvest_template.py
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/32/89032/1

diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index 89b034a..4ccd825 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -107,8 +107,12 @@
 pagetext = page.get()
 templates = pywikibot.extract_templates_and_params(pagetext)
 for (template, fielddict) in templates:
+# Clean up the template
+template = template.replace(u'_', u' ')
+template = template[0].upper() + template[1:]
+
 # We found the template we were looking for
-if template.replace(u'_', u' ') in self.templateTitles:
+if template in self.templateTitles:
 for field, value in fielddict.items():
 field = field.strip()
 value = value.strip()

-- 
To view, visit https://gerrit.wikimedia.org/r/89032
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I77581dc0d8c90113b0d7b558338da8acb7544ce0
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add Wikidata as shared data repository for Commons. - change (pywikibot/core)

2013-10-10 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/88963


Change subject: Add Wikidata as shared data repository for Commons.
..

Add Wikidata as shared data repository for Commons.

Change-Id: Ie79e3157d016fc74e400ddc618c04f2d1d39f17d
---
M pywikibot/families/commons_family.py
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/63/88963/1

diff --git a/pywikibot/families/commons_family.py 
b/pywikibot/families/commons_family.py
index 7daedac..7450fba 100644
--- a/pywikibot/families/commons_family.py
+++ b/pywikibot/families/commons_family.py
@@ -38,3 +38,6 @@
 
 def ssl_pathprefix(self, code):
 return "/wikipedia/commons"
+
+def shared_data_repository(self, code, transcluded=False):
+return ('wikidata', 'wikidata')

-- 
To view, visit https://gerrit.wikimedia.org/r/88963
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie79e3157d016fc74e400ddc618c04f2d1d39f17d
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add the cc-by-sa-3.0 for China Change-Id: Icca0f3a279ffe7d06... - change (mediawiki...WikimediaMessages)

2013-09-17 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/84535


Change subject: Add the cc-by-sa-3.0 for China Change-Id: 
Icca0f3a279ffe7d060f56339973d570a8020022b
..

Add the cc-by-sa-3.0 for China
Change-Id: Icca0f3a279ffe7d060f56339973d570a8020022b
---
M WikimediaCCLicenseTexts.i18n.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages 
refs/changes/35/84535/1

diff --git a/WikimediaCCLicenseTexts.i18n.php b/WikimediaCCLicenseTexts.i18n.php
index da35bbd..eee5b38 100644
--- a/WikimediaCCLicenseTexts.i18n.php
+++ b/WikimediaCCLicenseTexts.i18n.php
@@ -158,6 +158,7 @@
'wm-license-cc-by-sa-3.0-au-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by-sa/3.0/au/deed.en Attribution-Share Alike 
3.0 Australia] license.',
'wm-license-cc-by-sa-3.0-br-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by-sa/3.0/br/deed.en Attribution-Share Alike 
3.0 Brazil] license.',
'wm-license-cc-by-sa-3.0-cl-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by-sa/3.0/cl/deed.en Attribution-ShareAlike 3.0 
Chile] license.',
+   'wm-license-cc-by-sa-3.0-cn-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by-sa/3.0/cn/deed.en Attribution-ShareAlike 3.0 
China] license.',
'wm-license-cc-by-sa-3.0-cr-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by-sa/3.0/cr/deed.en Attribution-ShareAlike 3.0 
Costa Rica] license.',
'wm-license-cc-by-sa-3.0-cz-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by-sa/3.0/cz/deed.en Attribution-Share Alike 
3.0 Czech Republic] license.',
'wm-license-cc-by-sa-3.0-de-text' => 'This file is licensed under the 
[[{{int:wm-license-cc-wiki-link}}|Creative Commons]] 
[//creativecommons.org/licenses/by-sa/3.0/de/deed.en Attribution-Share Alike 
3.0 Germany] license.',

-- 
To view, visit https://gerrit.wikimedia.org/r/84535
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icca0f3a279ffe7d060f56339973d570a8020022b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMessages
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add option to add a footer to a property page. See bugzilla ... - change (mediawiki...Wikibase)

2013-05-18 Thread Multichill (Code Review)
Multichill has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/64477


Change subject: Add option to add a footer to a property page. See bugzilla bug 
#48601
..

Add option to add a footer to a property page. See bugzilla bug #48601

Change-Id: I7f8c2de1a2b73f6d28c515ffe68ecebb5e9a46c5
---
M repo/Wikibase.i18n.php
M repo/includes/PropertyView.php
2 files changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/77/64477/1

diff --git a/repo/Wikibase.i18n.php b/repo/Wikibase.i18n.php
index c4ec56e..df2c8b6 100644
--- a/repo/Wikibase.i18n.php
+++ b/repo/Wikibase.i18n.php
@@ -70,6 +70,7 @@
'wikibase-aliases-input-help-message' => 'If this data set is known 
under more than one particular name, you may enter aliases and synonyms, so it 
can be found by its alternative names.',
'wikibase-aliases-empty' => 'No aliases defined.',
'wikibase-datatype-label' => 'Data type:',
+   'wikibase-property-footer' => '', # do not translate or duplicate this 
message to other languages
'wikibase-claimview-snak-tooltip' => 'Enter a value corresponding to 
the property named "$1". If the property has no designated value or the actual 
value is not known, you may choose an alternative to specifying a custom value 
by clicking the icon next to the value input box.',
'wikibase-claimview-snak-new-tooltip' => 'After specifying a property 
you can enter a corresponding value. If the property has no designated value or 
the actual value is not known, you may choose an alternative to specifying a 
custom value by clicking the icon next to the value input box.',
'wikibase-statementview-referencesheading-pendingcountersubject' => 
'{{PLURAL:$1|source|sources}}',
diff --git a/repo/includes/PropertyView.php b/repo/includes/PropertyView.php
index e63cc53..e8df0bf 100644
--- a/repo/includes/PropertyView.php
+++ b/repo/includes/PropertyView.php
@@ -50,6 +50,11 @@
/** @var PropertyContent $property */
$html .= $this->getHtmlForDataType( 
$property->getProperty()->getDataType(), $lang, $editable );
// TODO: figure out where to display type information more 
nicely
+   # Customizable footer
+   $footer = $this->msg( 'wikibase-property-footer' );
+   if ( !$footer->isBlank() ) {
+   $html .= "\n" . $footer->parse();
+   }
 
wfProfileOut( __METHOD__ );
return $html;

-- 
To view, visit https://gerrit.wikimedia.org/r/64477
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f8c2de1a2b73f6d28c515ffe68ecebb5e9a46c5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Multichill 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits