From 3ff49a787a8fa5e6a7a7e6e72caf6579ceb2c0a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Robert=20B=C5=82aut?= Date: Wed, 29 Jan 2014 15:48:48 +0100 Subject: [PATCH 1/1] [txt] return Windows friendly txt file with \r\n line ends instead of \n POSIX editors recognize Windows line end. Notepad on Windows does not recognize POSIX line ends. --- librarian/text.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/librarian/text.py b/librarian/text.py index 9a4fd7a..9edfa62 100644 --- a/librarian/text.py +++ b/librarian/text.py @@ -82,7 +82,7 @@ def transform(wldoc, flags=None, **options): source = "" contributors = "" funders = "" - return OutputFile.from_string((TEMPLATE % { + result = (TEMPLATE % { 'description': description, 'url': url, 'license_description': license_description, @@ -90,7 +90,8 @@ def transform(wldoc, flags=None, **options): 'source': source, 'contributors': contributors, 'funders': funders, - }).encode('utf-8')) + }).encode('utf-8') else: - return OutputFile.from_string(unicode(result).encode('utf-8')) + result = unicode(result).encode('utf-8') + return OutputFile.from_string("\r\n".join(result.splitlines())) -- 2.20.1