file_system_helper

File system helpers.

librepy.file_system_helper.create_dir_if_needed(path)[source]

Creates new directory at given location if there is no such directory

librepy.file_system_helper.generate_file_from_template(path, template_name, context, render_method='xml')[source]

Generate file at given path using template and given context

Parameters:
  • path – path where the file will be generated
  • template_name – name of template which will be used to generate the file content. It must be in templates dir configured in Genshi.
  • context – dictionary containing values which will be injected into template slots
  • render_method – document rendering method. See Genshi documentation.

Previous topic

epub_gen

Next topic

models

This Page