Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. async def _generate_resource_html(www_directory_path: str, resource: Union[Resource, Identifiable], environment: Environment) -> None:
  2.     resource_path = os.path.join(www_directory_path, resource.resource_type_name, resource.id)
  3.     with _create_html_resource(resource_path) as f:
  4.         f.write(await environment.get_template('page/%s.html.j2' % resource.resource_type_name).render_async({
  5.             'page_resource': resource,
  6.             resource.resource_type_name: resource,
  7.         }))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement