TemplateWriter

A general class that can take a directory layout and apply template parameters to it Very unsophisticated but workable

Properties and Methods

ignored_files: list

 

__init__(self, template_dir, replacements=None, file_filter=None, **opts): 

 

@property
replacements(self): 

 

apply_replacements(self, string): 

Applies the defined replacements to the

  • string: Any

    No description…

  • :returns: _

    No description…

 

write_file(self, template_file, out_dir, apply_template=True, template_dir=None): 

writes a single file to dir and fills the template from the parameters passed when intializing the class

  • template_file: str

    the file to load and write into

  • out_dir: str

    the directory to write the file into

  • apply_template: bool

    whether to apply the template parameters to the file content or not

  • :returns: _

    No description…

 

iterate_write(self, out_dir, apply_template=True, src_dir=None, template_dir=None): 

Iterates through the files in the template_dir and writes them out to dir

  • :returns: _

    No description…

Examples


Edit Examples or Create New Examples
Edit Template or Create New Template
Edit Docstrings