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>
Wed, 2 Jan 2013 00:27:08 +0000 (19:27 -0500)
update_copyright/project.py
update_copyright/utils.py

index d582263b12f544e0ee96dc069fe3fac599db8dee..80b10c0bf689d4835c5b1576d3aa278d898769f2 100644 (file)
@@ -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'        ]',
index 3135c794023724fb3912db48cc041c21f098d6bf..32373fcfd47cfc96056061eb14df8274b1dc0b0c 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))