From: W. Trevor King Date: Thu, 25 Oct 2012 21:53:28 +0000 (-0400) Subject: project: add Project._split_paragraph(). X-Git-Tag: v0.5~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f5629da9158f7f3467d986d51bd1f6ed2204da3a;p=update-copyright.git 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. --- 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')