Xqt has submitted this change and it was merged.
Change subject: [PEP8]ify catlib.py ......................................................................
[PEP8]ify catlib.py
Change-Id: I9bf397a5dd89d333a68741c1c6f23c26e502f29e --- M catlib.py 1 file changed, 5 insertions(+), 3 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
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',
pywikibot-commits@lists.wikimedia.org