jenkins-bot has submitted this change and it was merged.
Change subject: Expand all Text for Checking Hidden Categories ......................................................................
Expand all Text for Checking Hidden Categories
An example of this issue is [1] which has a template that actually adds the _HIDDEN_ keyword. The other change proposed here is not to use regular expressions for that match, it is pointless.
We still search for the _HIDDEN_ keyword because newly created empty categories do not show up in the category table, and thus are not returned by the API (bug #48824)
[1] http://commons.wikimedia.org/wiki/Category:Cultural_heritage_monuments_in_Pa...
Change-Id: I4d1acce3c3c311724a577435829630c8e2548581 --- M pywikibot/page.py 1 file changed, 6 insertions(+), 3 deletions(-)
Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py index d34a5c6..215b643 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -1844,9 +1844,12 @@
def isHiddenCategory(self): """Return True if the category is hidden.""" - text = self.get() - hidden = re.search('__HIDDENCAT__', text) - return bool(hidden) + # FIXME + # This should use action=query&list=allcategories + # setting acfrom and acto to the category title and adding + # acprop=hidden but currently fails in some cases + # (see bug 48824) + return '__HIDDENCAT__' in self.expand_text()
def copyTo(self, cat, message): """
pywikibot-commits@lists.wikimedia.org