project: add Project._split_paragraph().
authorW. Trevor King <wking@tremily.us>
Thu, 25 Oct 2012 21:53:28 +0000 (17:53 -0400)
committerW. Trevor King <wking@tremily.us>
Thu, 25 Oct 2012 21:54:26 +0000 (17:54 -0400)
Now we split on double-newlines, not single newlines.  This is how our
README example and internal .update-copyright.conf are formatted.

update_copyright/project.py

index 452a33fac388fe6b68fcf6bf7f91901c80e41001..9c4849e8ac991e45f5fdf04b9f3c8e194838674a 100644 (file)
@@ -101,15 +101,19 @@ class Project (object):
 
     def _load_copyright_conf(self, parser):
         try:
-            self._copyright = parser.get('copyright', 'long').splitlines()
+            self._copyright = self._split_paragraphs(
+                parser.get('copyright', 'long'))
         except _configparser.NoOptionError:
             pass
         try:
-            self._short_copyright = parser.get(
-                'copyright', 'short').splitlines()
+            self._short_copyright = self._split_paragraphs(
+                parser.get('copyright', 'short'))
         except _configparser.NoOptionError:
             pass
 
+    def _split_paragraphs(self, text):
+        return [p.strip() for p in text.split('\n\n')]
+
     def _load_files_conf(self, parser):
         try:
             self.with_authors = parser.get('files', 'authors')