RDFLib / pyLDAPI

A very small module to add Linked Data API functionality to a Python Flask installation
BSD 3-Clause "New" or "Revised" License
41 stars 11 forks source link

Missing kwargs parameter added to Renderer constructor #16

Closed alex-ip closed 5 years ago

alex-ip commented 5 years ago

G'day Nick & Edmond...

This small change fixes a bug where the call to the Renderer constructor fails when one or more optional kwargs are specified. The base class constructor didn't have a '**kwargs' parameter, but the RegisterRenderer constructor still passes optional keywords through to the superclass constructor. I have also added the code to update the _template_context dict from the kwargs.

This fix is necessary to enable something like a register search without subclassing RegisterRenderer (as has been done in VocPrez with the SkosRegisterRenderer class). The bug showed up when I tried to implement a search in the Placenames register, which uses a RegisterRenderer object.

I've also changed the cosmetic layout of the function parameters to place them one per line, just for readability.

Feel free to squash the commits - I should have done it in a single commit, anyway.

Cheers,

Alex