Fixed python global variable declaration example in generated runtime python file
authorLaurent Bessard
Thu, 09 May 2013 10:56:40 +0200
changeset 1103 2fc1eef45bda
parent 1102 cd4a996ddaa7
child 1104 017cd95bc07e
Fixed python global variable declaration example in generated runtime python file
py_ext/PythonFileCTNMixin.py
--- a/py_ext/PythonFileCTNMixin.py	Thu May 09 09:00:24 2013 +0200
+++ b/py_ext/PythonFileCTNMixin.py	Thu May 09 10:56:40 2013 +0200
@@ -53,9 +53,14 @@
         
         # Adding variables
         text += "## User variables reference\n"
+        config = self.GetCTRoot().GetProjectConfigNames()[0]
         for variable in self.CodeFile.variables.variable:
-            text += "%s = %s\n" % (variable.getname(),
-                                   str(variable.getinitial()))
+            global_name = "%s_%s" % (config.upper(), variable.getname().upper())
+            text += "# global_var:%s python_var:%s type:%s initial:%s\n" % (
+                global_name,
+                variable.getname(),
+                variable.gettype(),
+                str(variable.getinitial()))
         text += "\n"
         
         # Adding user global variables and routines