The pagegenerator LogpagesPageGenerator exists in the old compat codebase, and needs to be copied and possibly re-worked to exist in the new codebase.
old code:
The pagegenerator LogpagesPageGenerator exists in the old compat codebase, and needs to be copied and possibly re-worked to exist in the new codebase.
old code:
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Add LogeventsPageGenerator, LogpagesPageGenerator | pywikibot/core | master | +146 -1 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Invalid | None | T72936 Important tasks to be solved (tracking) | |||
Open | Feature | None | T57880 Functionality existing in compat but missing from core (tracking) | ||
Resolved | jayvdb | T57007 missing some pagegenerators in core branch | |||
Open | None | T60942 Features to move from scripts to framework (tracking) | |||
Open | None | T78452 Use pagegenerators consistently in scripts | |||
Open | Feature | None | T68312 Update imageuncat.py to focus on categories | ||
Resolved | AbdealiJK | T67192 move imageuncat's uploadedYesterday to pagegenerators | |||
Resolved | None | T76555 Create LogpagesPageGenerator page generator |
I am porting the code over and assuming logpages() changes to logevents() [site.py]. When adapting the arguments from LogpagesPageGenerator, I assumed that number changes to total but two other arguments (namespace and repeat) seem to not fit in.
The port of the generator below this (NewpagesPageGenerator) ended up deprecating the repeat argument all together and changing namespace to namespaces and passing it to the respective recentchanges() [site.py] and then to _generator() as an argument of namespaces.
logevents() does not accept namespaces as an arguments. So, should I change logevents() to accept a namespaces argument?
As [[ https://en.wikipedia.org/w/api.php?action=help&modules=query%2Blogevents | action=query&list=logevents ]] support namespaces I'd suggest that APISite.logevents does support it too (unless there is a reason not to).
And repeat is afaik replaced by RepeatingGenerator so you could drop the parameter as well (via @deprecated_args).
(repeating and agreeing with a lot of what XZise has already said)
All great deductions. repeat was previously (compat) a capability of every generator, which is not very modular and they all only provided very basic repeat functionality; in core, we've decided that isnt desirable , so we have built RepeatingGenerator (which has many options and usage patterns) and there is another 'repeat' like capability being built.
Yes, we will need to implement a namespace argument in APISite.logevents, both for backwards compatibility and because the MediaWiki PHP API method accepts a namespace argument (singular; not plural), so we need expose that in the Python API.
https://en.wikipedia.org/w/api.php?action=paraminfo&modules=query+logevents
I recommend you initially build LogpagesPageGenerator with namespace as a parameter that is not implemented , build unit tests, etc, submit the code to be reviewed, and then add the namespace functionality after the initial code reviews.
Change 178773 had a related patch set uploaded (by Daviskr):
Add LogpagesPageGenerator
Change 178773 merged by jenkins-bot:
Add LogeventsPageGenerator, LogpagesPageGenerator