From 0dd21f5cf6f44674da377a1e972b1e763156f49f 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 d582263..80b10c0 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(u'\n\n') for p in paragraphs: - lines.append(u" '{}' % info,".format( + lines.append(u" '{}'.format(**info),".format( p.replace(u"'", ur"\'"))) lines.extend([ u' ]', diff --git a/update_copyright/utils.py b/update_copyright/utils.py index 3135c79..32373fc 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