zhuyifei1999 added a comment.

Hmm. I see that api code has been moved to FilePage._load_file_revisions() now.

Prior to the move, close to that code we have the logic for templates:

if "templates" in pagedict:
    templates = [pywikibot.Page(page.site, tl['title'])
                 for tl in pagedict['templates']]
    if hasattr(page, "_templates"):
        page._templates.extend(templates)
    else:
        page._templates = templates

Is it better to use this kind of logic instead? My main concern with checking len(self._file_revisions) is that, if there are in fact no file revisions on wiki, the empty result will not be cached.


TASK DETAIL
https://phabricator.wikimedia.org/T155740

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: zhuyifei1999
Cc: Aklapper, pywikibot-bugs-list, Mpaa, zhuyifei1999, Magul, Tbscho, MayS, Mdupont, JJMC89, Avicennasis, jayvdb, Dalba, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to