MCPcopy Index your code
hub / github.com/fatihak/InkyPi / render_image

Method render_image

src/plugins/base_plugin/base_plugin.py:87–104  ·  view source on GitHub ↗
(self, dimensions, html_file, css_file=None, template_params={})

Source from the content-addressed store, hash-verified

85 return template_params
86
87 def render_image(self, dimensions, html_file, css_file=None, template_params={}):
88 # load the base plugin and current plugin css files
89 css_files = [os.path.join(BASE_PLUGIN_RENDER_DIR, "plugin.css")]
90 if css_file:
91 plugin_css = os.path.join(self.render_dir, css_file)
92 css_files.append(plugin_css)
93
94 template_params["style_sheets"] = css_files
95 template_params["width"] = dimensions[0]
96 template_params["height"] = dimensions[1]
97 template_params["font_faces"] = get_fonts()
98 template_params["static_dir"] = STATIC_DIR
99
100 # load and render the given html template
101 template = self.env.get_template(html_file)
102 rendered_html = template.render(template_params)
103
104 return take_screenshot_html(rendered_html, dimensions)

Callers 10

generate_imageMethod · 0.80
generate_imageMethod · 0.80
generate_imageMethod · 0.80
generate_imageMethod · 0.80
stars_generate_imageFunction · 0.80
sponsors_generate_imageFunction · 0.80
generate_imageMethod · 0.80
generate_imageMethod · 0.80
generate_imageMethod · 0.80

Calls 2

get_fontsFunction · 0.90
take_screenshot_htmlFunction · 0.90

Tested by

no test coverage detected