project|utils: expand info into kwargs for format().
authorW. Trevor King <wking@tremily.us>
Thu, 25 Oct 2012 21:35:11 +0000 (17:35 -0400)
committerW. Trevor King <wking@tremily.us>
Thu, 25 Oct 2012 21:35:50 +0000 (17:35 -0400)
update_copyright/project.py
update_copyright/utils.py

index 63b9cfd52c2cd471de0fa655450becf40991f89f..7b67e014cf96a683d4d2d34fff185f3478e2b653 100644 (file)
@@ -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([
                 '        ]',
index 7af60f9ec4e049114ad026cab1ea52d3b6e1e671..8c39060320792dd3e825ff86e0fbe26a4287e9f5 100644 (file)
@@ -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))