From b50d5d2168a07cbbf216e7f556a8fcf316f32545 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 25 Oct 2012 17:35:11 -0400 Subject: [PATCH] project|utils: expand info into kwargs for format(). --- update_copyright/project.py | 2 +- update_copyright/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/update_copyright/project.py b/update_copyright/project.py index 63b9cfd..7b67e01 100644 --- a/update_copyright/project.py +++ b/update_copyright/project.py @@ -240,7 +240,7 @@ class Project (object): author_format_fn=_utils.short_author_formatter, wrap=False, ).split('\n\n') for p in paragraphs: - lines.append(" '{}'.format(info),".format( + lines.append(" '{}'.format(**info),".format( p.replace("'", r"\'"))) lines.extend([ ' ]', diff --git a/update_copyright/utils.py b/update_copyright/utils.py index 7af60f9..8c39060 100644 --- a/update_copyright/utils.py +++ b/update_copyright/utils.py @@ -127,7 +127,7 @@ def copyright_string(original_year, final_year, authors, text, info={}, for i,paragraph in enumerate(text): try: - text[i] = paragraph.format(info) + text[i] = paragraph.format(**info) except ValueError as e: _LOG.error( "{}: can't format {} with {}".format(e, paragraph, info)) -- 2.26.2