My app structure is like this:
For the Python 3 migration I switched from the unmaintained
LocalFs (which made files on the file system available as objects) to using a
resourceDirectory via zcml.
Access via browser works like a charm via eg.
++resource++assets/images/ClassIcons/SoftwareLicence.png, which maps the access to
The related zcml looks like this (abbreviated):
<browser:resourceDirectory name="assets" directory="static" />
Now I have to access these icons from my app via Python.
assets is no Zope product, how would I access the images? I can't use an absolute path.
I have several working experiments but they all feel a bit odd.
a) using something like
return pkg_resources.resource_filename( 'Products.assets', 'static/images/ClassIcons/' + self.className())
c) (not tried yet) Make the assets folder a Zope product?
Thank you for any tipps.