HomePhabricator

page.py: introduced FileInfo

Description

page.py: introduced FileInfo

Aded automatic upcasting of Page to FilePage or CategoryPage in api.py.
This makes CategoryPageGenerator and ImagePageGenerator obsolete and
then deprecated.

Added caching of 'imageinfo' property in api.update_page() for:

  • FilePage._file_revisions: dictionary with imageinfo of all versions of file
  • FilePage.latest_file_info(): imageinfo of latest version of file
  • FilePage.oldest_file_info(): imageinfo of oldest version of file

Added FileInfo, a structure to hold imageinfo for the latest revision
of FilePage.

In page.py, centralise in one place the check for:

if not hasattr(self, '_imageinfo')

and replace _imageinfo with latest_file_info.

Introduced compat-compatible equivalent getLatestUploader() and
deprecated its use, superseeded by accesing latest_file_info.user attribute.

Deprecated getFileSHA1Sum(), superseeded by accesing latest_file_info.sha1
attribute.

Introduced get_file_history() as a dictionary of FileInfo() objects.

Bug: 73023
Change-Id: I334539d56278c6e2e47fd058212df81f1dae20f8

Details

Provenance
MpaaAuthored on
Parents
rPWBCd61f63433bc7: Enable -help option for pwb.py
Branches
Unknown
Tags
Unknown
ChangeId
I334539d56278c6e2e47fd058212df81f1dae20f8