def generate_cover_letters(self, context):
"""
Generate cover letters for all companies in the business YAML file.
Parameters
----------
context : ContextRenderer
The renderer to use.
"""
businesses = load_yaml(
posixpath.join(config.YAML_DIR,
config.YAML_BUSINESSES + ".yaml"))
if not businesses:
return
# Create cover letter directory
os.makedirs(posixpath.join(config.OUTPUT_DIR, config.LETTERS_DIR),
exist_ok=True)
self.data["pwd"] = posixpath.abspath(".").replace("\\", "/")
for business in tqdm.tqdm(businesses, desc="Generating cover letters",
unit="letter", leave=True):
self.data["business"] = businesses[business]
self.data["business"]["body"] = context.render_template(
config.LETTER_FILE_NAME, self.data
)
self.process_resume(context, base=business)
评论列表
文章目录