Fixing bug that prevent to use global variables in configuration
authorlaurent
Fri, 18 Nov 2011 17:33:19 +0100
changeset 639 85dad46ae0f6
parent 638 865c7c60a1f3
child 640 d410fe057543
Fixing bug that prevent to use global variables in configuration
plugger.py
--- a/plugger.py	Fri Nov 18 17:32:57 2011 +0100
+++ b/plugger.py	Fri Nov 18 17:33:19 2011 +0100
@@ -1298,7 +1298,11 @@
                     # Split and Maps each field to dictionnary entries
                     attrs = dict(zip(VariablesListAttributeName,line.strip().split(';')))
                     # Truncate "C_path" to remove conf an ressources names
-                    attrs["C_path"] = '__'.join(attrs["C_path"].split(".",2)[1:])
+                    parts = attrs["C_path"].split(".",2)
+                    if len(parts) > 2:
+                        attrs["C_path"] = '__'.join(parts[1:])
+                    else:
+                        attrs["C_path"] = '__'.join(parts)
                     # Push this dictionnary into result.
                     self._VariablesList.append(attrs)
                     # Fill in IEC<->C translation dicts