From: W. Trevor King Date: Thu, 25 Oct 2012 21:35:11 +0000 (-0400) Subject: project|utils: expand info into kwargs for format(). X-Git-Tag: v0.5~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b50d5d2168a07cbbf216e7f556a8fcf316f32545;p=update-copyright.git project|utils: expand info into kwargs for format(). --- 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))