Coverage for gws-app/gws/plugin/legend/static/__init__.py: 0%
15 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-17 01:37 +0200
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-17 01:37 +0200
1"""Static legend."""
3import gws
4import gws.lib.image
5import gws.lib.mime
6import gws.base.legend
9gws.ext.new.legend('static')
12class Config(gws.base.legend.Config):
13 """Static legend."""
15 path: gws.FilePath
16 """path to the image file"""
19class Object(gws.base.legend.Object):
20 path: str
22 def configure(self):
23 self.path = self.cfg('path')
25 def render(self, args=None):
26 img = gws.lib.image.from_path(self.path)
27 return gws.LegendRenderOutput(image=img, size=img.size(), mime=gws.lib.mime.for_path(self.path))