From f5629da9158f7f3467d986d51bd1f6ed2204da3a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 25 Oct 2012 17:53:28 -0400 Subject: [PATCH] project: add Project._split_paragraph(). 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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/update_copyright/project.py b/update_copyright/project.py index 452a33f..9c4849e 100644 --- a/update_copyright/project.py +++ b/update_copyright/project.py @@ -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') -- 2.26.2