jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/462404 )
Change subject: [cleanup] cleanup scripts/replace.py
......................................................................
[cleanup] cleanup scripts/replace.py
- remove preleading "u" from strings
- use single quotes for string literals and double quotes
**only** if they consist of single quotes within them
- use str.format(...) instead of modulo for type specifier
arguments
- use "+" to concatenate strings in some cases
Change-Id: I23723262299d44ca02f12f10e393f19a40bd9d2c
---
M scripts/replace.py
1 file changed, 53 insertions(+), 51 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/replace.py b/scripts/replace.py
index f36d6d2..dd6924d 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -430,9 +430,9 @@
self.skipping = bool(xmlStart)
self.excsInside = []
- if "inside-tags" in self.exceptions:
+ if 'inside-tags' in self.exceptions:
self.excsInside += self.exceptions['inside-tags']
- if "inside" in self.exceptions:
+ if 'inside' in self.exceptions:
self.excsInside += self.exceptions['inside']
from pywikibot import xmlreader
if site:
@@ -468,8 +468,8 @@
try:
if not self.skipping:
pywikibot.output(
- u'To resume, use "-xmlstart:%s" on the command line.'
- % entry.title)
+ 'To resume, use "-xmlstart:{0}" on the command line.'
+ .format(entry.title))
except NameError:
pass
@@ -479,11 +479,11 @@
@rtype: bool
"""
- if "title" in self.exceptions:
+ if 'title' in self.exceptions:
for exc in self.exceptions['title']:
if exc.search(title):
return True
- if "require-title" in self.exceptions:
+ if 'require-title' in self.exceptions:
for req in self.exceptions['require-title']:
if not req.search(title): # if not all requirements are met:
return True
@@ -496,7 +496,7 @@
@rtype: bool
"""
- if "text-contains" in self.exceptions:
+ if 'text-contains' in self.exceptions:
for exc in self.exceptions['text-contains']:
if exc.search(text):
return True
@@ -609,7 +609,7 @@
@rtype: bool
"""
- if "text-contains" in self.exceptions:
+ if 'text-contains' in self.exceptions:
for exc in self.exceptions['text-contains']:
if exc.search(original_text):
return True
@@ -710,11 +710,11 @@
else:
comma = self.site.mediawiki_message('comma-separator')
default_summary = comma.join(
- u'-{0} +{1}'.format(*default_summary)
+ '-{0} +{1}'.format(*default_summary)
for default_summary in default_summaries)
summary_messages.insert(0, i18n.twtranslate(
self.site, 'replace-replacing',
- {'description': u' ({0})'.format(default_summary)}
+ {'description': ' ({0})'.format(default_summary)}
))
semicolon = self.site.mediawiki_message('semicolon-separator')
return semicolon.join(summary_messages)
@@ -726,19 +726,19 @@
for page in self.generator:
if self.isTitleExcepted(page.title()):
pywikibot.output(
- u'Skipping %s because the title is on the exceptions list.'
- % page.title(as_link=True))
+ 'Skipping {0} because the title is on the exceptions list.'
+ .format(page.title(as_link=True)))
continue
try:
# Load the page's text from the wiki
original_text = page.get(get_redirect=True)
if not page.canBeEdited():
- pywikibot.output(u"You can't edit page %s"
- % page.title(as_link=True))
+ pywikibot.output("You can't edit page "
+ + page.title(as_link=True))
continue
except pywikibot.NoPage:
- pywikibot.output('Page %s not found' % page.title(
- as_link=True))
+ pywikibot.output('Page {0} not found'
+ .format(page.title(as_link=True)))
continue
applied = set()
new_text = original_text
@@ -746,9 +746,9 @@
context = 0
while True:
if self.isTextExcepted(new_text):
- pywikibot.output(u'Skipping %s because it contains text '
- u'that is on the exceptions list.'
- % page.title(as_link=True))
+ pywikibot.output('Skipping {0} because it contains text '
+ 'that is on the exceptions list.'
+ .format(page.title(as_link=True)))
break
while new_text != last_text:
last_text = new_text
@@ -757,8 +757,8 @@
if not self.recursive:
break
if new_text == original_text:
- pywikibot.output(u'No changes were necessary in %s'
- % page.title(as_link=True))
+ pywikibot.output('No changes were necessary in '
+ + page.title(as_link=True))
break
if hasattr(self, 'addedCat'):
# Fetch only categories in wikitext, otherwise the others
@@ -777,7 +777,7 @@
if self.getOption('always'):
break
choice = pywikibot.input_choice(
- u'Do you want to accept these changes?',
+ 'Do you want to accept these changes?',
[('Yes', 'y'), ('No', 'n'), ('Edit original', 'e'),
('edit Latest', 'l'), ('open in Browser', 'b'),
('More context', 'm'), ('All', 'a')],
@@ -806,8 +806,8 @@
try:
original_text = page.get(get_redirect=True, force=True)
except pywikibot.NoPage:
- pywikibot.output(u'Page %s has been deleted.'
- % page.title())
+ pywikibot.output('Page {0} has been deleted.'
+ .format(page.title()))
break
new_text = original_text
last_text = None
@@ -822,8 +822,9 @@
quiet=True)
while not self._pending_processed_titles.empty():
proc_title, res = self._pending_processed_titles.get()
- pywikibot.output('Page %s%s saved'
- % (proc_title, '' if res else ' not'))
+ pywikibot.output('Page {0}{1} saved'
+ .format(proc_title,
+ '' if res else ' not'))
# choice must be 'N'
break
if self.getOption('always') and new_text != original_text:
@@ -832,23 +833,24 @@
page.save(summary=self.generate_summary(applied),
callback=self._replace_sync_callback, quiet=True)
except pywikibot.EditConflict:
- pywikibot.output(u'Skipping %s because of edit conflict'
- % (page.title(),))
+ pywikibot.output('Skipping {0} because of edit conflict'
+ .format(page.title(),))
except pywikibot.SpamfilterError as e:
pywikibot.output(
- u'Cannot change %s because of blacklist entry %s'
- % (page.title(), e.url))
+ 'Cannot change {0} because of blacklist entry {1}'
+ .format(page.title(), e.url))
except pywikibot.LockedPage:
- pywikibot.output(u'Skipping %s (locked page)'
- % (page.title(),))
+ pywikibot.output('Skipping {0} (locked page)'
+ .format(page.title(),))
except pywikibot.PageNotSaved as error:
- pywikibot.output(u'Error putting page: %s'
- % (error.args,))
+ pywikibot.output('Error putting page: {0}'
+ .format(error.args,))
if self._pending_processed_titles.qsize() > 50:
while not self._pending_processed_titles.empty():
proc_title, res = self._pending_processed_titles.get()
- pywikibot.output('Page %s%s saved'
- % (proc_title, '' if res else ' not'))
+ pywikibot.output('Page {0}{1} saved'
+ .format(proc_title,
+ '' if res else ' not'))
def prepareRegexForMySQL(pattern):
@@ -876,7 +878,7 @@
add_cat = None
gen = None
# summary message
- edit_summary = u""
+ edit_summary = ''
# Array which will collect commandline parameters.
# First element is original text, second element is replacement text.
commandline_replacements = []
@@ -936,7 +938,7 @@
elif arg.startswith('-xmlstart'):
if len(arg) == 9:
xmlStart = pywikibot.input(
- u'Please enter the dumped article to start with:')
+ 'Please enter the dumped article to start with:')
else:
xmlStart = arg[10:]
elif arg.startswith('-xml'):
@@ -996,7 +998,7 @@
if arg == '-pairsfile':
replacement_file = pywikibot.input(
- u'Please enter the filename to read replacements from:')
+ 'Please enter the filename to read replacements from:')
else:
replacement_file = arg[len('-pairsfile:'):]
else:
@@ -1019,7 +1021,7 @@
# strip newlines, but not other characters
file_replacements = f.read().splitlines()
except (IOError, OSError) as e:
- pywikibot.error(u'Error loading {0}: {1}'.format(
+ pywikibot.error('Error loading {0}: {1}'.format(
replacement_file, e))
return False
@@ -1030,13 +1032,13 @@
return False
# Strip BOM from first line
- file_replacements[0].lstrip(u'\uFEFF')
+ file_replacements[0].lstrip('\uFEFF')
commandline_replacements.extend(file_replacements)
if not(commandline_replacements or fixes_set) or manual_input:
old = pywikibot.input('Please enter the text that should be replaced:')
while old:
- new = pywikibot.input(u'Please enter the new text:')
+ new = pywikibot.input('Please enter the new text:')
commandline_replacements += [old, new]
old = pywikibot.input(
'Please enter another text that should be replaced,'
@@ -1051,7 +1053,7 @@
single_summary = i18n.twtranslate(
site, 'replace-replacing',
{'description':
- ' (-%s +%s)' % (replacement.old, replacement.new)}
+ ' (-{0} +{1})'.format(replacement.old, replacement.new)}
)
replacements.append(replacement)
@@ -1062,8 +1064,8 @@
try:
fix = fixes.fixes[fix_name]
except KeyError:
- pywikibot.output(u'Available predefined fixes are: %s'
- % ', '.join(fixes.fixes.keys()))
+ pywikibot.output('Available predefined fixes are: {0}'
+ .format(', '.join(fixes.fixes.keys())))
if not fixes.user_fixes_loaded:
pywikibot.output('The user fixes file could not be found: '
'{0}'.format(fixes.filename))
@@ -1072,7 +1074,7 @@
pywikibot.warning('No replacements defined for fix '
'"{0}"'.format(fix_name))
continue
- if "msg" in fix:
+ if 'msg' in fix:
if isinstance(fix['msg'], basestring):
set_summary = i18n.twtranslate(site, str(fix['msg']))
else:
@@ -1133,9 +1135,9 @@
if ((not edit_summary or edit_summary is True) and
(missing_fixes_summaries or single_summary)):
if single_summary:
- pywikibot.output(u'The summary message for the command line '
- 'replacements will be something like: %s'
- % single_summary)
+ pywikibot.output('The summary message for the command line '
+ 'replacements will be something like: '
+ + single_summary)
if missing_fixes_summaries:
pywikibot.output('The summary will not be used when the fix has '
'one defined but the following fix(es) do(es) '
@@ -1206,8 +1208,8 @@
# Explicitly call pywikibot.stopme(). It will make sure the callback is
# triggered before replace.py is unloaded.
pywikibot.stopme()
- pywikibot.output(u'\n%s pages changed.' % bot.changed_pages)
+ pywikibot.output('\n{0} pages changed.'.format(bot.changed_pages))
-if __name__ == "__main__":
+if __name__ == '__main__':
main()
--
To view, visit https://gerrit.wikimedia.org/r/462404
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I23723262299d44ca02f12f10e393f19a40bd9d2c
Gerrit-Change-Number: 462404
Gerrit-PatchSet: 2
Gerrit-Owner: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/462463 )
Change subject: [cleanup] cleanup scripts/newitem.py
......................................................................
[cleanup] cleanup scripts/newitem.py
- remove preleading "u" fron strings
- use single quotes for string literals and double quotes
**only** if they consist of single quotes within them
- use str.format(...) instead of modulo for type specifier
arguments
Change-Id: I84b6e27a75eed4f111e423d3a18db408fcbfc06a
---
M scripts/newitem.py
1 file changed, 15 insertions(+), 13 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/newitem.py b/scripts/newitem.py
index aab642f..64e3360 100755
--- a/scripts/newitem.py
+++ b/scripts/newitem.py
@@ -56,9 +56,9 @@
days=self.pageAge)
self.lastEditBefore = self.repo.getcurrenttime() - timedelta(
days=self.lastEdit)
- pywikibot.output('Page age is set to %s days so only pages created'
- '\nbefore %s will be considered.'
- % (self.pageAge, self.pageAgeBefore.isoformat()))
+ pywikibot.output('Page age is set to {0} days so only pages created'
+ '\nbefore {1} will be considered.'
+ .format(self.pageAge, self.pageAgeBefore.isoformat()))
pywikibot.output(
'Last edit is set to {0} days so only pages last edited'
'\nbefore {1} will be considered.'.format(
@@ -85,34 +85,36 @@
def treat_page_and_item(self, page, item):
"""Treat page/item."""
if item and item.exists():
- pywikibot.output(u'%s already has an item: %s.' % (page, item))
+ pywikibot.output('{0} already has an item: {1}.'
+ .format(page, item))
if self.getOption('touch'):
- pywikibot.output(u'Doing a null edit on the page.')
+ pywikibot.output('Doing a null edit on the page.')
self._touch_page(page)
return
if page.isRedirectPage():
- pywikibot.output(u'%s is a redirect page. Skipping.' % page)
+ pywikibot.output('{0} is a redirect page. Skipping.'.format(page))
return
if page.editTime() > self.lastEditBefore:
pywikibot.output(
- u'Last edit on %s was on %s.\nToo recent. Skipping.'
- % (page, page.editTime().isoformat()))
+ 'Last edit on {0} was on {1}.\nToo recent. Skipping.'
+ .format(page, page.editTime().isoformat()))
return
if page.oldest_revision.timestamp > self.pageAgeBefore:
pywikibot.output(
- u'Page creation of %s on %s is too recent. Skipping.'
- % (page, page.editTime().isoformat()))
+ 'Page creation of {0} on {1} is too recent. Skipping.'
+ .format(page, page.editTime().isoformat()))
return
if page.isCategoryRedirect():
- pywikibot.output('%s is a category redirect. Skipping.' % page)
+ pywikibot.output('{0} is a category redirect. Skipping.'
+ .format(page))
return
if page.langlinks():
# FIXME: Implement this
pywikibot.output(
- "Found language links (interwiki links).\n"
+ 'Found language links (interwiki links).\n'
"Haven't implemented that yet so skipping.")
return
@@ -155,5 +157,5 @@
return True
-if __name__ == "__main__":
+if __name__ == '__main__':
main()
--
To view, visit https://gerrit.wikimedia.org/r/462463
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I84b6e27a75eed4f111e423d3a18db408fcbfc06a
Gerrit-Change-Number: 462463
Gerrit-PatchSet: 2
Gerrit-Owner: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/462466 )
Change subject: [cleanup] cleanup scripts/ndashredir.py
......................................................................
[cleanup] cleanup scripts/ndashredir.py
- use single quotes for string literals and double quotes
**only** if they consist of single quotes within them
- use str.format(...) instead of modulo for type specifier
arguments
Change-Id: I9f0d0409495b4c2e6280be886b1fabe94576e974
---
M scripts/ndashredir.py
1 file changed, 5 insertions(+), 5 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/ndashredir.py b/scripts/ndashredir.py
index 86dd098..7339090 100644
--- a/scripts/ndashredir.py
+++ b/scripts/ndashredir.py
@@ -91,8 +91,8 @@
# skip unchanged
if redir.title() == origin:
- pywikibot.output('No need to process %s, skipping…'
- % redir.title())
+ pywikibot.output('No need to process {0}, skipping...'
+ .format(redir.title()))
# suggest -reversed parameter
if '-' in origin and not self.getOption('reversed'):
pywikibot.output('Consider using -reversed parameter '
@@ -100,13 +100,13 @@
else:
# skip existing
if redir.exists():
- pywikibot.output('%s already exists, skipping…'
- % redir.title())
+ pywikibot.output('{0} already exists, skipping...'
+ .format(redir.title()))
else:
# confirm and save redirect
if self.user_confirm(
color_format(
- 'Redirect from {lightblue}{0}{default} doesn\'t exist '
+ "Redirect from {lightblue}{0}{default} doesn't exist "
'yet.\nDo you want to create it?',
redir.title())):
# If summary option is None, it takes the default
--
To view, visit https://gerrit.wikimedia.org/r/462466
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9f0d0409495b4c2e6280be886b1fabe94576e974
Gerrit-Change-Number: 462466
Gerrit-PatchSet: 1
Gerrit-Owner: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/447390 )
Change subject: Move methods for simple claim adding/removing to WikibasePage
......................................................................
Move methods for simple claim adding/removing to WikibasePage
This object already assumes in WikibasePage.get() that all WikibasePage
instances have claims. This is the case for items, properties and also
upcoming lexemes and mediainfo entities.
Bug: T113131
Change-Id: Iea1c82e47328588aa7f44fa3364c538d689c0cd3
---
M pywikibot/page.py
M pywikibot/site.py
2 files changed, 49 insertions(+), 48 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 1a67eeb..dba0e7d 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -4230,6 +4230,46 @@
"""
raise NotImplementedError
+ @allow_asynchronous
+ def addClaim(self, claim, bot=True, **kwargs):
+ """
+ Add a claim to the entity.
+
+ @param claim: The claim to add
+ @type claim: Claim
+ @param bot: Whether to flag as bot (if possible)
+ @type bot: bool
+ @keyword asynchronous: if True, launch a separate thread to add claim
+ asynchronously
+ @type asynchronous: bool
+ @keyword callback: a callable object that will be called after the
+ claim has been added. It must take two arguments:
+ (1) a WikibasePage object, and (2) an exception instance,
+ which will be None if the entity was saved successfully. This is
+ intended for use by bots that need to keep track of which saves
+ were successful.
+ @type callback: callable
+ """
+ self.repo.addClaim(self, claim, bot=bot, **kwargs)
+ claim.on_item = self
+
+ def removeClaims(self, claims, **kwargs):
+ """
+ Remove the claims from the entity.
+
+ @param claims: list of claims to be removed
+ @type claims: list or pywikibot.Claim
+ """
+ # this check allows single claims to be removed by pushing them into a
+ # list of length one.
+ if isinstance(claims, pywikibot.Claim):
+ claims = [claims]
+ data = self.repo.removeClaims(claims, **kwargs)
+ for claim in claims:
+ claim.on_item.latest_revision_id = data['pageinfo']['lastrevid']
+ claim.on_item = None
+ claim.snak = None
+
class ItemPage(WikibasePage):
@@ -4534,45 +4574,6 @@
data = {'sitelinks': data}
self.editEntity(data, **kwargs)
- @allow_asynchronous
- def addClaim(self, claim, bot=True, **kwargs):
- """
- Add a claim to the item.
-
- @param claim: The claim to add
- @type claim: Claim
- @param bot: Whether to flag as bot (if possible)
- @type bot: bool
- @keyword asynchronous: if True, launch a separate thread to add claim
- asynchronously
- @type asynchronous: bool
- @keyword callback: a callable object that will be called after the
- claim has been added. It must take two arguments: (1) an ItemPage
- object, and (2) an exception instance, which will be None if the
- item was saved successfully. This is intended for use by bots that
- need to keep track of which saves were successful.
- @type callback: callable
- """
- self.repo.addClaim(self, claim, bot=bot, **kwargs)
- claim.on_item = self
-
- def removeClaims(self, claims, **kwargs):
- """
- Remove the claims from the item.
-
- @param claims: list of claims to be removed
- @type claims: list or pywikibot.Claim
- """
- # this check allows single claims to be removed by pushing them into a
- # list of length one.
- if isinstance(claims, pywikibot.Claim):
- claims = [claims]
- data = self.repo.removeClaims(claims, **kwargs)
- for claim in claims:
- claim.on_item.latest_revision_id = data['pageinfo']['lastrevid']
- claim.on_item = None
- claim.snak = None
-
def mergeInto(self, item, **kwargs):
"""
Merge the item into another item.
diff --git a/pywikibot/site.py b/pywikibot/site.py
index ea6c6b3..db1569d 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -7719,12 +7719,12 @@
return data
@must_be(group='user')
- def addClaim(self, item, claim, bot=True, summary=None):
+ def addClaim(self, entity, claim, bot=True, summary=None):
"""
Add a claim.
- @param item: Entity to modify
- @type item: WikibasePage
+ @param entity: Entity to modify
+ @type entity: WikibasePage
@param claim: Claim to be added
@type claim: pywikibot.Claim
@param bot: Whether to mark the edit as a bot edit
@@ -7732,8 +7732,8 @@
@param summary: Edit summary
@type summary: str
"""
- params = {'action': 'wbcreateclaim', 'entity': item.getID(),
- 'baserevid': item.latest_revision_id,
+ params = {'action': 'wbcreateclaim', 'entity': entity.getID(),
+ 'baserevid': entity.latest_revision_id,
'snaktype': claim.getSnakType(), 'property': claim.getID(),
'summary': summary, 'bot': bot}
@@ -7745,11 +7745,11 @@
data = req.submit()
claim.snak = data['claim']['id']
# Update the item
- if claim.getID() in item.claims:
- item.claims[claim.getID()].append(claim)
+ if claim.getID() in entity.claims:
+ entity.claims[claim.getID()].append(claim)
else:
- item.claims[claim.getID()] = [claim]
- item.latest_revision_id = data['pageinfo']['lastrevid']
+ entity.claims[claim.getID()] = [claim]
+ entity.latest_revision_id = data['pageinfo']['lastrevid']
@must_be(group='user')
def changeClaimTarget(self, claim, snaktype='value',
--
To view, visit https://gerrit.wikimedia.org/r/447390
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iea1c82e47328588aa7f44fa3364c538d689c0cd3
Gerrit-Change-Number: 447390
Gerrit-PatchSet: 2
Gerrit-Owner: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: ArthurPSmith <arthurpsmith(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <Ladsgroup(a)gmail.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Multichill <maarten(a)mdammers.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/462336 )
Change subject: Revert "Temporarily add vcrpy!=2.0.0 as requirement for nose-detecthttp"
......................................................................
Revert "Temporarily add vcrpy!=2.0.0 as requirement for nose-detecthttp"
This reverts commit 53a3f2033e414e741ce7be77a4cf6562c47162f3.
Reason for revert: The upstream issue has been resolved.[1]
[1]:
https://github.com/kevin1024/vcrpy/issues/393
Bug: T205073
Change-Id: I3ed7635f9b8fed2252c4db8dce27e0d06dbe6cff
---
M tox.ini
1 file changed, 0 insertions(+), 4 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tox.ini b/tox.ini
index ac1e6e0..599af03 100644
--- a/tox.ini
+++ b/tox.ini
@@ -77,8 +77,6 @@
deps =
nose
nose-detecthttp
- # Temporary requirement. Should be fixed in vcrpy or required in nose-detecthttp.
- vcrpy!=2.0.0
unicodecsv
mock
@@ -93,8 +91,6 @@
beautifulsoup4
nose
nose-detecthttp>=0.1.3
- # Temporary requirement. Should be fixed in vcrpy or required in nose-detecthttp.
- vcrpy!=2.0.0
six
mock
--
To view, visit https://gerrit.wikimedia.org/r/462336
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3ed7635f9b8fed2252c4db8dce27e0d06dbe6cff
Gerrit-Change-Number: 462336
Gerrit-PatchSet: 1
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/462332 )
Change subject: Revert "[tests] add check in pagegenerators_tests.TestWantedFactoryGenerator"
......................................................................
Revert "[tests] add check in pagegenerators_tests.TestWantedFactoryGenerator"
This reverts commit 5db84a897683232d250b9beca7eb6cad575caa15.
The results of this querypage are rarely updated, there is no guarantee
that the page does not exist.
Bug: T205233
Change-Id: I6e71023f384ac4f1b1920ce38eb8b0c879c7651a
---
M tests/pagegenerators_tests.py
1 file changed, 0 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index 9d5d7a9..39b8fec 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -1286,7 +1286,6 @@
pages = list(gen)
self.assertLessEqual(len(pages), 5)
for page in pages:
- self.assertFalse(page.exists())
yield page
def test_wanted_pages(self):
--
To view, visit https://gerrit.wikimedia.org/r/462332
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6e71023f384ac4f1b1920ce38eb8b0c879c7651a
Gerrit-Change-Number: 462332
Gerrit-PatchSet: 2
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Framawiki <framawiki(a)tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/462318 )
Change subject: [cleanup] cleanup scripts/revertbot.py
......................................................................
[cleanup] cleanup scripts/revertbot.py
- remove preleading "u" from strings
- use str.format(...) instead of modulo for type specifier
arguments
- use single quotes for string literals
Change-Id: I894f7e469b7659f50b35eb6b9908a5defce89ab8
---
M scripts/revertbot.py
1 file changed, 7 insertions(+), 7 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/revertbot.py b/scripts/revertbot.py
index f6c4e07..cf4d0b6 100755
--- a/scripts/revertbot.py
+++ b/scripts/revertbot.py
@@ -79,11 +79,11 @@
if callback(item):
result = self.revert(item)
if result:
- self.log(u'%s: %s' % (item['title'], result))
+ self.log('{0}: {1}'.format(item['title'], result))
else:
- self.log(u'Skipped %s' % item['title'])
+ self.log('Skipped {0}'.format(item['title']))
else:
- self.log(u'Skipped %s by callback' % item['title'])
+ self.log('Skipped {0} by callback'.format(item['title']))
def callback(self, item):
"""Callback function."""
@@ -127,8 +127,8 @@
else:
pywikibot.exception()
return False
- return 'The edit(s) made in %s by %s was rollbacked' % (page.title(),
- self.user)
+ return 'The edit(s) made in {0} by {1} was rollbacked'.format(
+ page.title(), self.user)
def log(self, msg):
"""Log the message msg."""
@@ -153,7 +153,7 @@
if arg.startswith('-username'):
if len(arg) == 9:
user = pywikibot.input(
- u'Please enter username of the person you want to revert:')
+ 'Please enter username of the person you want to revert:')
else:
user = arg[10:]
elif arg == '-rollback':
@@ -162,5 +162,5 @@
bot.revert_contribs()
-if __name__ == "__main__":
+if __name__ == '__main__':
main()
--
To view, visit https://gerrit.wikimedia.org/r/462318
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I894f7e469b7659f50b35eb6b9908a5defce89ab8
Gerrit-Change-Number: 462318
Gerrit-PatchSet: 4
Gerrit-Owner: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)