From 12ee1ccb3687f2b790cbf3e271d4d939f46ad444 Mon Sep 17 00:00:00 2001 From: Alessandro Cresto Miseroglio Date: Mon, 18 May 2020 01:10:48 +0200 Subject: [PATCH 1/2] Fix newlines --- lice/core.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lice/core.py b/lice/core.py index 296b21c..897799b 100644 --- a/lice/core.py +++ b/lice/core.py @@ -183,11 +183,9 @@ def format_license(template, lang): lang = 'txt' out = StringIO() template.seek(0) # from the start of the buffer - out.write(LANG_CMT[LANGS[lang]][0] + u'\n') for line in template.readlines(): out.write(LANG_CMT[LANGS[lang]][1] + u' ') out.write(line) - out.write(LANG_CMT[LANGS[lang]][2] + u'\n') template.close() # force garbage collector return out From 40045ba55ec6d95a520ec9d5ac2216e62604be83 Mon Sep 17 00:00:00 2001 From: Alessandro Cresto Miseroglio Date: Mon, 18 May 2020 01:56:44 +0200 Subject: [PATCH 2/2] Remove space at beginning of every txt output line --- lice/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lice/core.py b/lice/core.py index 897799b..a7304f8 100644 --- a/lice/core.py +++ b/lice/core.py @@ -184,7 +184,10 @@ def format_license(template, lang): out = StringIO() template.seek(0) # from the start of the buffer for line in template.readlines(): - out.write(LANG_CMT[LANGS[lang]][1] + u' ') + if lang == 'txt': + out.write(LANG_CMT[LANGS[lang]][1]) + else: + out.write(LANG_CMT[LANGS[lang]][1] + u' ') out.write(line) template.close() # force garbage collector return out