Fixed bug in generated code in py_ext runtime file
authorLaurent Bessard
Fri, 10 May 2013 11:47:35 +0200
changeset 1113 16e5b6abd91c
parent 1112 ff3fcad17b47
child 1114 1a97222ffee9
Fixed bug in generated code in py_ext runtime file
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"