From: W. Trevor King <wking@tremily.us>
Date: Thu, 25 Oct 2012 21:35:11 +0000 (-0400)
Subject: project|utils: expand info into kwargs for format().
X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0dd21f5cf6f44674da377a1e972b1e763156f49f;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 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))