Xqt has uploaded a new change for review.
https://gerrit.wikimedia.org/r/95756
Change subject: [PEP8]ify catlib.py
......................................................................
[PEP8]ify catlib.py
Change-Id: I9bf397a5dd89d333a68741c1c6f23c26e502f29e
---
M catlib.py
1 file changed, 5 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat
refs/changes/56/95756/1
diff --git a/catlib.py b/catlib.py
index c2ca83f..02834b9 100644
--- a/catlib.py
+++ b/catlib.py
@@ -638,8 +638,9 @@
rearranging them.
"""
- #get list of Category objects the article is in and remove possible
duplicates
cats = []
+
+ # get list of Category objects the article is in and remove duplicates
for cat in article.categories(get_redirect=True):
if cat not in cats:
cats.append(cat)
@@ -664,7 +665,8 @@
newtext = pywikibot.replaceCategoryInPlace(oldtext, oldCat, newCat)
else:
if newCat:
- cats[cats.index(oldCat)] = Category(site, newCat.title(),
sortKey=sortKey)
+ cats[cats.index(oldCat)] = Category(site, newCat.title(),
+ sortKey=sortKey)
else:
cats.pop(cats.index(oldCat))
oldtext = article.get(get_redirect=True)
@@ -698,13 +700,13 @@
def categoryAllElementsAPI(CatName, cmlimit=5000, categories_parsed=[],
site=None):
- #
action=query&list=categorymembers&cmlimit=500&cmtitle=Category:License_tags
""" Category to load all the elements in a category using the APIs.
Limit: 5000 elements.
"""
pywikibot.output("Loading %s..." % CatName)
+ #
action=query&list=categorymembers&cmlimit=500&cmtitle=Category:License_tags
params = {
'action': 'query',
'list': 'categorymembers',
--
To view, visit https://gerrit.wikimedia.org/r/95756
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9bf397a5dd89d333a68741c1c6f23c26e502f29e
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits