# HG changeset patch
# User Laurent Bessard
# Date 1368179255 -7200
# Node ID 16e5b6abd91c30eb4be214186f5429086a1f8646
# Parent  ff3fcad17b472fdc7be34955cab20a2b91278923
Fixed bug in generated code in py_ext runtime file

diff -r ff3fcad17b47 -r 16e5b6abd91c py_ext/PythonFileCTNMixin.py
--- a/py_ext/PythonFileCTNMixin.py	Fri May 10 10:25:35 2013 +0200
+++ b/py_ext/PythonFileCTNMixin.py	Fri May 10 11:47:35 2013 +0200
@@ -77,10 +77,10 @@
             ("__retrieve_", "", "", self.CodeFile.retrieveFunction),
             ("__publish_", "", "", self.CodeFile.publishFunction),]:
             text += "def %s%s(%s):\n" % (func, location_str, args)
-            lines = code_object.gettext().splitlines()
+            lines = code_object.gettext().strip().splitlines()
             if len(lines) > 0 or return_code != "":
-                for line in code_object.gettext().splitlines():
-                    text += "    " + line
+                for line in lines:
+                    text += "    " + line + "\n"
                 text += "    " + return_code + "\n\n"
             else:
                 text += "    pass\n\n"