From de33636cf825a574411b143d3b2c2c351215c557 Mon Sep 17 00:00:00 2001 From: Gareth Aneurin Tribello Date: Tue, 27 Feb 2024 16:16:01 +0000 Subject: [PATCH] Fixed a bug that is caused if you include files that don't finish with a newline character --- PlumedToHTML/PlumedToHTML.py | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/PlumedToHTML/PlumedToHTML.py b/PlumedToHTML/PlumedToHTML.py index 78d0d0c..367b42d 100644 --- a/PlumedToHTML/PlumedToHTML.py +++ b/PlumedToHTML/PlumedToHTML.py @@ -260,7 +260,8 @@ def resolve_includes( srcdir, inpt, foundfiles ) : final_inpt += "# " + clines+ "# ensures PLUMED loads the contents of the file called " + filename + "\n" final_inpt += "# The contents of this file are shown below (click the red comment to hide them).\n" foundfiles, parsed_inpt = resolve_includes( srcdir, include_contents, foundfiles ) - final_inpt += parsed_inpt + "#ENDEXPANSION " + filename + "\n" + if parsed_inpt.endswith("\n") : final_inpt += parsed_inpt + "#ENDEXPANSION " + filename + "\n" + else : final_inpt += parsed_inpt + "\n#ENDEXPANSION " + filename + "\n" else : final_inpt += clines return foundfiles, final_inpt diff --git a/setup.py b/setup.py index 6422e54..2e9a5e8 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setuptools.setup( name='PlumedToHTML', - version='0.53', + version='0.54', author="Gareth Tribello", author_email="gareth.tribello@gmail.com", description="A package for creating pretified HTML for PLUMED files",