jenkins-bot has submitted this change and it was merged.
Change subject: [PEP8] changes
......................................................................
[PEP8] changes
Change-Id: I45471e50e518fe4c954dbe189680792f3e02ab13
---
M tag_nowcommons.py
1 file changed, 19 insertions(+), 13 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tag_nowcommons.py b/tag_nowcommons.py
index f32574e..4b777b0 100644
--- a/tag_nowcommons.py
+++ b/tag_nowcommons.py
@@ -5,14 +5,17 @@
"""
#
# (C) Multichill, 2011
-# (C) xqt, 2012
+# (C) xqt, 2013
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
#
-import sys, re, urllib
+import sys
+import re
+import urllib
+
import wikipedia as pywikibot
import pagegenerators
import image
@@ -60,23 +63,25 @@
def tagNowCommons(page):
-
+
imagepage = pywikibot.ImagePage(page.site(), page.title())
site = page.site()
language = site.language()
family = site.family.name
-
+
if not imagepage.fileIsOnCommons():
if family in skips and language in skips[family]:
localskips = skips[family][language]
else:
localskips = skips['_default']
-
+
for template in imagepage.templates():
#FIXME: Move the templates list to a lib.
if template in localskips:
- pywikibot.output(u'The file %s is already tagged with NowCommons' % imagepage.title())
+ pywikibot.output(
+ u'The file %s is already tagged with NowCommons'
+ % imagepage.title())
return
imagehash = imagepage.getHash()
@@ -87,7 +92,8 @@
pywikibot.output(u'Found duplicate image at %s' % duplicate)
comment = i18n.twtranslate(imagepage.site(),
'commons-file-now-available',
- {'localfile': imagepage.title(withNamespace=False),
+ {'localfile': imagepage.title(
+ withNamespace=False),
'commonsfile': duplicate})
template = pywikibot.translate(imagepage.site(), nowCommonsTemplate)
newtext = imagepage.get() + template % (duplicate,)
@@ -97,8 +103,9 @@
except wikipedia.LockedPage:
return
+
def main(args):
- generator = None;
+ generator = None
always = False
# Load a lot of default generators
@@ -107,16 +114,15 @@
for arg in pywikibot.handleArgs():
genFactory.handleArg(arg)
-
generator = genFactory.getCombinedGenerator()
if not generator:
- raise NoEnoughData('You have to specify the generator you want to use for the script!')
+ raise NoEnoughData(
+ 'You have to specify the generator you want to use for the script!')
pregenerator = pagegenerators.PreloadingGenerator(generator)
-
for page in pregenerator:
- if page.exists() and (page.namespace() == 6) and \
- (not page.isRedirectPage()):
+ if page.exists() and page.namespace() == 6 and \
+ not page.isRedirectPage():
tagNowCommons(page)
--
To view, visit https://gerrit.wikimedia.org/r/98102
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I45471e50e518fe4c954dbe189680792f3e02ab13
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: Inherit BasicBot from object and enable super() method
......................................................................
Inherit BasicBot from object and enable super() method
Change-Id: I670f8022b599258c955337249948495d4c2434ce
---
M basic.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Ladsgroup: Looks good to me, approved
jenkins-bot: Verified
diff --git a/basic.py b/basic.py
index 49dbc5b..96e2a7b 100644
--- a/basic.py
+++ b/basic.py
@@ -37,7 +37,7 @@
}
-class BasicBot:
+class BasicBot(object):
# Edit summary message that should be used is placed on /i18n subdirectory.
# The file containing these messages should have the same name as the caller
# script (i.e. basic.py in this case)
--
To view, visit https://gerrit.wikimedia.org/r/95789
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I670f8022b599258c955337249948495d4c2434ce
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: Enable claims with the same property, but different value for claimit.py
......................................................................
Enable claims with the same property, but different value for claimit.py
claimit now adds claims with the same property if they have different values
Bug: 54415
Change-Id: I811bf0a88c7e43631e95e9798140ffea401379ca
---
M scripts/claimit.py
1 file changed, 93 insertions(+), 22 deletions(-)
Approvals:
Legoktm: Looks good to me, but someone else must approve
Ladsgroup: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/claimit.py b/scripts/claimit.py
index 808b33d..9d42a7f 100755
--- a/scripts/claimit.py
+++ b/scripts/claimit.py
@@ -3,12 +3,16 @@
"""
This script adds claims to Wikidata items based on categories.
+------------------------------------------------------------------------------
+
Usage:
python claimit.py [pagegenerators] P1 Q2 P123 Q456
You can use any typical pagegenerator to provide with a list of pages.
Then list the property-->target pairs to add.
+
+------------------------------------------------------------------------------
For geographic coordinates:
@@ -21,6 +25,28 @@
Example:
python claimit.py [pagegenerators] P625 -23.3991,-52.0910,0.0001
+
+------------------------------------------------------------------------------
+
+By default, claimit.py does not add a claim if one with the same property
+already exists on the page. To override this behavior, use the 'exists' option:
+
+python claimit.py [pagegenerators] P246 "string example" -exists:p
+
+Suppose the claim you want to add has the same property as an existing claim
+and the "-exists:p" argument is used. Now, claimit.py will not add the claim
+if it has the same target, sources, and/or qualifiers as the existing claim.
+To override this behavior, add 't' (target), 's' (sources), or 'q' (qualifiers)
+to the 'exists' argument.
+
+For instance, to add the claim to each page even if one with the same
+property, target, and qualifiers already exists:
+
+python claimit.py [pagegenerators] P246 "string example" -exists:ptq
+
+Note that the ordering of the letters in the 'exists' argument does not matter,
+but 'p' must be included.
+
"""
#
# (C) Legoktm, 2013
@@ -40,15 +66,17 @@
"""
A bot to add Wikidata claims
"""
- def __init__(self, generator, claims):
+ def __init__(self, generator, claims, exists_arg=''):
"""
Arguments:
* generator - A generator that yields Page objects.
* claims - A list of wikidata claims
+ * exists_arg - String specifying how to handle duplicate claims
"""
self.generator = generator
self.claims = claims
+ self.exists_arg = exists_arg
self.repo = pywikibot.Site().data_repository()
self.cacheSources()
@@ -78,44 +106,87 @@
"""
Starts the robot.
"""
+ if self.exists_arg:
+ pywikibot.output('\'exists\' argument set to \'%s\'' % self.exists_arg)
for page in self.generator:
- item = pywikibot.ItemPage.fromPage(page)
pywikibot.output('Processing %s' % page)
+ item = pywikibot.ItemPage.fromPage(page)
if not item.exists():
- pywikibot.output('%s doesn\'t have a wikidata item :(' % page)
# TODO FIXME: We should provide an option to create the page
- else:
- for claim in self.claims:
- if claim.getID() in item.get().get('claims'):
- pywikibot.output(
- u'A claim for %s already exists. Skipping'
- % (claim.getID(),))
- #TODO FIXME: This is a very crude way of dupe checking
+ pywikibot.output('%s doesn\'t have a wikidata item :(' % page)
+ continue
+ for claim in self.claims:
+ skip = False
+ # If claim with same property already exists...
+ if claim.getID() in item.claims:
+ if self.exists_arg is None or 'p' not in self.exists_arg:
+ pywikibot.log('Skipping %s because claim with same property already exists' % (claim.getID(),))
+ pywikibot.log('Use the -exists:p option to override this behavior')
+ skip = True
else:
- pywikibot.output('Adding %s --> %s'
- % (claim.getID(), claim.getTarget()))
- item.addClaim(claim)
- # A generator might yield pages from multiple languages
- source = self.getSource(page.site.language())
- if source:
- claim.addSource(source, bot=True)
- # TODO FIXME: We need to check that we aren't adding a
- # duplicate
+ existing_claims = item.claims[claim.getID()] # Existing claims on page of same property
+ for existing in existing_claims:
+ skip = True # Default value
+ # If some attribute of the claim being added matches some attribute in an existing claim
+ # of the same property, skip the claim, unless the 'exists' argument overrides it.
+ if claim.getTarget() == existing.getTarget() and 't' not in self.exists_arg:
+ pywikibot.log('Skipping %s because claim with same target already exists' % (claim.getID(),))
+ pywikibot.log('Append \'t\' to the -exists argument to override this behavior')
+ break
+ if listsEqual(claim.getSources(), existing.getSources()) and 's' not in self.exists_arg:
+ pywikibot.log('Skipping %s because claim with same sources already exists' % (claim.getID(),))
+ pywikibot.log('Append \'s\' to the -exists argument to override this behavior')
+ break
+ if listsEqual(claim.qualifiers, existing.qualifiers) and 'q' not in self.exists_arg:
+ pywikibot.log('Skipping %s because claim with same qualifiers already exists' % (claim.getID(),))
+ pywikibot.log('Append \'q\' to the -exists argument to override this behavior')
+ break
+ skip = False
+ if not skip:
+ pywikibot.output('Adding %s --> %s'
+ % (claim.getID(), claim.getTarget()))
+ item.addClaim(claim)
+ # A generator might yield pages from multiple languages
+ source = self.getSource(page.site.language())
+ if source:
+ claim.addSource(source, bot=True)
+ # TODO FIXME: We need to check that we aren't adding a
+ # duplicate
+
+
+def listsEqual(list1, list2):
+ """
+ Returns true if the lists are probably equal, ignoring order.
+ Works for lists of unhashable items (like dictionaries).
+ """
+ if len(list1) != len(list2):
+ return False
+ if sorted(list1) != sorted(list2):
+ return False
+ for item in list1:
+ if not item in list2:
+ return False
+ return True
def main():
+ exists_arg = ''
gen = pagegenerators.GeneratorFactory()
commandline_claims = list()
for arg in pywikibot.handleArgs():
+ # Handle args specifying how to handle duplicate claims
+ if arg.startswith('-exists:'):
+ exists_arg = arg.split(':')[1].strip('"')
+ continue
+ # Handle page generator args
if gen.handleArg(arg):
continue
commandline_claims.append(arg)
if len(commandline_claims) % 2:
raise ValueError # or something.
+
claims = list()
-
repo = pywikibot.Site().data_repository()
-
for i in xrange(0, len(commandline_claims), 2):
claim = pywikibot.Claim(repo, commandline_claims[i])
if claim.getType() == 'wikibase-item':
@@ -141,7 +212,7 @@
# FIXME: Should throw some help
return
- bot = ClaimRobot(generator, claims)
+ bot = ClaimRobot(generator, claims, exists_arg)
bot.run()
if __name__ == "__main__":
--
To view, visit https://gerrit.wikimedia.org/r/97198
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I811bf0a88c7e43631e95e9798140ffea401379ca
Gerrit-PatchSet: 10
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Tholam <t.lam(a)lamsinfosystem.com>
Gerrit-Reviewer: Gerrit Patch Uploader <gerritpatchuploader(a)gmail.com>
Gerrit-Reviewer: Guoguo12 <Guoguo12(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Mineo <themineo(a)gmail.com>
Gerrit-Reviewer: Multichill <maarten(a)mdammers.nl>
Gerrit-Reviewer: Strainu <wiki(a)strainu.ro>
Gerrit-Reviewer: Tholam <t.lam(a)lamsinfosystem.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Xqt has submitted this change and it was merged.
Change subject: [PEP8] changes
......................................................................
[PEP8] changes
Change-Id: I995ecb3eecbd48299271d8767c918e01f90ba663
---
M table2wiki.py
1 file changed, 54 insertions(+), 49 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/table2wiki.py b/table2wiki.py
index fa4b233..d2bd61e 100644
--- a/table2wiki.py
+++ b/table2wiki.py
@@ -48,17 +48,21 @@
"""
#
# (C) 2003 Thomas R. Koll, <tomk32(a)tomk32.de>
-# (C) Pywikipedia bot team, 2003-2010
+# (C) Pywikibot team, 2003-2013
#
# Distributed under the terms of the MIT license.
#
-__version__='$Id$'
+__version__ = '$Id$'
#
-import re, sys, time
+import re
+import sys
+import time
+
import wikipedia as pywikibot
from pywikibot import i18n
-import config, pagegenerators
+import config
+import pagegenerators
# This is required for the text that is shown when you run this script
# with the parameter -help.
@@ -82,22 +86,23 @@
if tableTagR.search(entry.text):
yield pywikibot.Page(pywikibot.getSite(), entry.title)
+
class Table2WikiRobot:
- def __init__(self, generator, quietMode = False):
+ def __init__(self, generator, quietMode=False):
self.generator = generator
self.quietMode = quietMode
def convertTable(self, table):
- '''
- Converts an HTML table to wiki syntax. If the table already is a wiki
- table or contains a nested wiki table, tries to beautify it.
+ """ Converts an HTML table to wiki syntax. If the table already is a
+ wiki table or contains a nested wiki table, tries to beautify it.
Returns the converted table, the number of warnings that occured and
a list containing these warnings.
- Hint: if you give an entire page text as a parameter instead of a table only,
- this function will convert all HTML tables and will also try to beautify all
- wiki tables already contained in the text.
- '''
+ Hint: if you give an entire page text as a parameter instead of a table
+ only, this function will convert all HTML tables and will also try to
+ beautify all wiki tables already contained in the text.
+
+ """
warnings = 0
# this array will contain strings that will be shown in case of possible
# errors, before the user is asked if he wants to accept the changes.
@@ -112,7 +117,6 @@
##################
# every open-tag gets a new line.
-
##################
# Note that we added the ## characters in markActiveTables().
@@ -140,7 +144,7 @@
r"\r\n|+\g<attr> | \g<caption>", newTable)
# caption without attributes
newTable = re.sub("(?i)<caption>(?P<caption>[\w\W]*?)<\/caption>",
- r"\r\n|+ \g<caption>", newTable)
+ r"\r\n|+ \g<caption>", newTable)
##################
# <th> often people don't write them within <tr>, be warned!
@@ -151,13 +155,13 @@
# <th> without attributes
newTable = re.sub("(?i)[\r\n]+<th>(?P<header>[\w\W]*?)<\/th>",
- r"\r\n! \g<header>\r\n", newTable)
+ r"\r\n! \g<header>\r\n", newTable)
# fail save. sometimes people forget </th>
# <th> without attributes, without closing </th>
newTable, n = re.subn("(?i)[\r\n]+<th>(?P<header>[\w\W]*?)[\r\n]+",
- r"\r\n! \g<header>\r\n", newTable)
- if n>0:
+ r"\r\n! \g<header>\r\n", newTable)
+ if n > 0:
warning_messages.append(
u'WARNING: found <th> without </th>. (%d occurences)\n' % n)
warnings += n
@@ -166,11 +170,10 @@
newTable, n = re.subn(
"(?i)[\r\n]+<th(?P<attr> [^>]*?)>(?P<header>[\w\W]*?)[\r\n]+",
r"\n!\g<attr> | \g<header>\r\n", newTable)
- if n>0:
+ if n > 0:
warning_messages.append(
u'WARNING: found <th ...> without </th>. (%d occurences\n)' % n)
warnings += n
-
##################
# <tr> with attributes
@@ -197,7 +200,7 @@
# TODO: some more docu please
newTable, n = re.subn("(?i)[\r\n]+<td>(?P<cell>[^\r\n]*?)<td>",
r"\r\n| \g<cell>\r\n", newTable)
- if n>0:
+ if n > 0:
warning_messages.append(
u'<td> used where </td> was expected. (%d occurences)\n' % n)
warnings += n
@@ -207,33 +210,33 @@
# "\r\n| \\2\r\n", newTable)
# newTable, n = re.subn("[\r\n]+<(td|TD)([^>]*?)>([^<]*?)<(td|TD)><\/(tr|TR)>",
# "\r\n|\\2| \\3\r\n", newTable)
- # if n>0:
+ # if n > 0:
# warning_messages.append(u'WARNING: found <td><td></tr>, but no </td>. (%d occurences)\n' % n)
# warnings += n
# what is this for?
newTable, n = re.subn("[\r\n]+<(td|TD)([^>]+?)>([^\r\n]*?)<\/(td|TD)>",
- r"\r\n|\2 | \3\r\n", newTable)
- if n>0:
+ r"\r\n|\2 | \3\r\n", newTable)
+ if n > 0:
warning_messages.append(
- u'WARNING: (sorry, bot code unreadable (1). I don\'t know why this warning is given.) (%d occurences)\n' % n)
+ u"WARNING: (sorry, bot code unreadable (1). I don't know why "
+ u"this warning is given.) (%d occurences)\n" % n)
# fail save. sometimes people forget </td>
# <td> without arguments, with missing </td>
newTable, n = re.subn("(?i)<td>(?P<cell>[^<]*?)[\r\n]+",
- r"\r\n| \g<cell>\r\n", newTable)
- if n>0:
- warning_messages.append(
- u'NOTE: Found <td> without </td>. This shouldn\'t cause problems.\n')
+ r"\r\n| \g<cell>\r\n", newTable)
+ if n > 0:
+ warning_messages.append(u"NOTE: Found <td> without </td>. This "
+ u"shouldn't cause problems.\n")
# <td> with attributes, with missing </td>
newTable, n = re.subn(
"(?i)[\r\n]*<td(?P<attr> [^>]*?)>(?P<cell>[\w\W]*?)[\r\n]+",
r"\r\n|\g<attr> | \g<cell>\r\n", newTable)
if n > 0:
- warning_messages.append(
- u'NOTE: Found <td> without </td>. This shouldn\'t cause problems.\n')
-
+ warning_messages.append(u"NOTE: Found <td> without </td>. This "
+ u"shouldn't cause problems.\n")
##################
# Garbage collecting ;-)
@@ -252,12 +255,11 @@
# "\\1|-----\r\n\\2", newTable)
# warnings = warnings + n
-
##################
# most <th> come with '''title'''. Senseless in my eyes cuz
# <th> should be bold anyways.
newTable = re.sub("[\r\n]+\!([^'\n\r]*)'''([^'\r\n]*)'''",
- r"\r\n!\1\2", newTable)
+ r"\r\n!\1\2", newTable)
##################
# kills indention within tables. Be warned, it might seldom bring
@@ -275,11 +277,10 @@
# newTable = re.sub("[\r\n]+\|[\t ]+?[\r\n]+", "\r\n| ", newTable)
# kills trailing spaces and tabs
newTable = re.sub("\r\n(.*)[\t\ ]+[\r\n]+",
- r"\r\n\1\r\n", newTable)
+ r"\r\n\1\r\n", newTable)
# kill extra new-lines
newTable = re.sub("[\r\n]{4,}(\!|\|)",
- r"\r\n\1", newTable);
-
+ r"\r\n\1", newTable)
##################
# shortening if <table> had no arguments/parameters
@@ -300,7 +301,8 @@
# pairs where the value already has correct quotation marks, and
# finally the key of the attribute we want to fix here.
# group 2 is the value of the attribute we want to fix here.
- # We recognize it by searching for a string of non-whitespace characters
+ # We recognize it by searching for a string of non-whitespace
+ # characters
# - [^\s]+? - which is not embraced by quotation marks - [^"]
newTable, num = re.subn(
r'([\r\n]+(?:\|-|\{\|)[^\r\n\|]+) *= *([^"\s>]+)',
@@ -308,9 +310,9 @@
num = 1
while num != 0:
- # The same for header and cell tags ( ! or | ), but for these tags the
- # attribute part is finished by a | character. We don't want to change
- # cell contents which accidentially contain an equal sign.
+ # The same for header and cell tags ( ! or | ), but for these tags
+ # the attribute part is finished by a | character. We don't want to
+ # change cell contents which accidentially contain an equal sign.
# Group 1 and 2 are anologously to the previous regular expression,
# group 3 are the remaining attribute key - value pairs.
newTable, num = re.subn(
@@ -328,16 +330,17 @@
####
# add a new line if first is * or #
newTable = re.sub("[\r\n]+\| ([*#]{1})",
- r"\r\n|\r\n\1", newTable)
+ r"\r\n|\r\n\1", newTable)
##################
# strip <center> from <th>
newTable = re.sub("([\r\n]+\![^\r\n]+?)<center>([\w\W]+?)<\/center>",
- r"\1 \2", newTable)
+ r"\1 \2", newTable)
# strip align="center" from <th> because the .css does it
- # if there are no other attributes than align, we don't need that | either
+ # if there are no other attributes than align, we don't need
+ # that | either
newTable = re.sub("([\r\n]+\! +)align\=\"center\" +\|",
- r"\1", newTable)
+ r"\1", newTable)
# if there are other attributes, simply strip the align="center"
newTable = re.sub(
"([\r\n]+\![^\r\n\|]+?)align\=\"center\"([^\n\r\|]+?\|)",
@@ -409,7 +412,7 @@
print "More opening than closing table tags. Skipping."
return None, 0, 0
# if another table tag is opened before one is closed
- elif nextStarting and nextStarting.start() < nextEnding.start():
+ elif nextStarting and nextStarting.start() < nextEnding.start():
offset += nextStarting.end()
text = text[nextStarting.end():]
depth += 1
@@ -439,7 +442,8 @@
break
pywikibot.output(">> Table %i <<" % (convertedTables + 1))
# convert the current table
- newTable, warningsThisTable, warnMsgsThisTable = self.convertTable(table)
+ newTable, warningsThisTable, warnMsgsThisTable = self.convertTable(
+ table)
# show the changes for this table
if not self.quietMode:
pywikibot.showDiff(table.replace('##table##', 'table'),
@@ -452,7 +456,6 @@
convertedTables += 1
pywikibot.output(warningMessages)
-
return text, convertedTables, warningSum
def treat(self, page):
@@ -489,7 +492,8 @@
if config.table2wikiSkipWarnings:
doUpload = True
else:
- print "There were %i replacement(s) that might lead to bad output." % warningSum
+ print("There were %i replacement(s) that might lead to bad "
+ "output.") % warningSum
doUpload = (pywikibot.input(
u'Do you want to change the page anyway? [y|N]') == "y")
if doUpload:
@@ -507,8 +511,9 @@
for page in self.generator:
self.treat(page)
+
def main():
- quietMode = False # use -quiet to get less output
+ quietMode = False # use -quiet to get less output
# if the -file argument is used, page titles are stored in this array.
# otherwise it will only contain one page.
articles = []
--
To view, visit https://gerrit.wikimedia.org/r/98077
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I995ecb3eecbd48299271d8767c918e01f90ba663
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Xqt has submitted this change and it was merged.
Change subject: Set main namespace name to '' instead of None
......................................................................
Set main namespace name to '' instead of None
This should solve http://lists.wikimedia.org/pipermail/pywikipedia-l/2013-July/008060.html
Change-Id: Ifb045de24009e4675f14da45c5cbee3e8af664a0
---
M family.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
diff --git a/family.py b/family.py
index c0d237f..30e2bed 100644
--- a/family.py
+++ b/family.py
@@ -497,7 +497,7 @@
'zh-yue': [u'Special', u'特別', u'特殊'],
},
0: {
- '_default': None,
+ '_default': '',
},
1: {
'_default': u'Talk',
--
To view, visit https://gerrit.wikimedia.org/r/97724
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifb045de24009e4675f14da45c5cbee3e8af664a0
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: Removed 'UntaggedPageGenerator does not exist' warnings
......................................................................
Removed 'UntaggedPageGenerator does not exist' warnings
Change-Id: Iac41aa4833aa6f204966aaa9e3e6d13f133093e8
Original-Change-Id: Ib7e8a545334d11b73e93a740b39690520ef209f6
---
M scripts/add_text.py
1 file changed, 2 insertions(+), 12 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/add_text.py b/scripts/add_text.py
index 8eccc5e..c865be8 100644
--- a/scripts/add_text.py
+++ b/scripts/add_text.py
@@ -29,9 +29,6 @@
-newimages Add text in the new images
--untagged Add text in the images that don't have any license template
- (Not yet supported)
-
-always If used, the bot won't ask if it should add the text
specified
@@ -67,7 +64,7 @@
#
# (C) Filnik, 2007-2010
-# (C) Pywikipedia bot team, 2007-2013
+# (C) Pywikibot team, 2007-2013
#
# Distributed under the terms of the MIT license.
#
@@ -77,6 +74,7 @@
import re
import webbrowser
import codecs
+
import pywikibot
from pywikibot import config
from pywikibot import i18n
@@ -330,14 +328,6 @@
regexSkip = pywikibot.input(u'What text should I skip?')
else:
regexSkip = arg[8:]
-## *** NOT YET SUPPORTED ***
-## elif arg.startswith('-untagged'):
-## if len(arg) == 9:
-## untaggedProject = pywikibot.input(
-## u'What project do you want to use?')
-## else:
-## untaggedProject = arg[10:]
-## generator = untaggedGenerator(untaggedProject)
elif arg == '-up':
up = True
elif arg == '-noreorder':
--
To view, visit https://gerrit.wikimedia.org/r/97997
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iac41aa4833aa6f204966aaa9e3e6d13f133093e8
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Pyfisch <pyfisch(a)googlemail.com>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: Synchronize date.py with compat, disable automatic check.
......................................................................
Synchronize date.py with compat, disable automatic check.
update from compat e29d4a7b6d9e8106fa21388acbd5e9689d05cbd6
SVN release 9834
Change-Id: If7c889228ecd4cbfc7f391a44d38bf5988b818be
---
M pywikibot/date.py
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/date.py b/pywikibot/date.py
index 4aaf983..410540d 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -2400,6 +2400,6 @@
else:
print(u'Date module has been fully tested')
-# Do a quick test upon module loading!
-# Make sure the date file is correct
-test(quick=True)
+if __name__=="__main__":
+ # Test the date file
+ test(quick=False)
--
To view, visit https://gerrit.wikimedia.org/r/95201
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If7c889228ecd4cbfc7f391a44d38bf5988b818be
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot