Page MenuHomePhabricator

Create LogpagesPageGenerator page generator
Closed, ResolvedPublic


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:

Event Timeline

jayvdb raised the priority of this task from to Medium.
jayvdb updated the task description. (Show Details)
jayvdb changed Security from none to None.
jayvdb subscribed.

I am porting the code over and assuming logpages() changes to logevents() []. 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() [] 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 [[ | 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.

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