# HG changeset patch # User Laurent Bessard # Date 1368089800 -7200 # Node ID 2fc1eef45bda576632bfa15041f15244a6dcb5e0 # Parent cd4a996ddaa7ca39aefc692031303470ff5efaac Fixed python global variable declaration example in generated runtime python file diff -r cd4a996ddaa7 -r 2fc1eef45bda 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