# HG changeset patch
# User Laurent Bessard
# Date 1365978736 -7200
# Node ID c4989e53f9c333ad635b81e2f5a4790f7536b647
# Parent  5743398071ebb9a623bc405d4ba4a9965fcbbb9b
Fix bug defining string initial value using quotes

diff -r 5743398071eb -r c4989e53f9c3 PLCGenerator.py
--- a/PLCGenerator.py	Mon Apr 15 00:27:30 2013 +0200
+++ b/PLCGenerator.py	Mon Apr 15 00:32:16 2013 +0200
@@ -106,9 +106,9 @@
     # Compute value according to type given
     def ComputeValue(self, value, var_type):
         base_type = self.Controler.GetBaseType(var_type)
-        if base_type == "STRING":
+        if base_type == "STRING" and not value.startswith("'") and not value.endswith("'"):
             return "'%s'"%value
-        elif base_type == "WSTRING":
+        elif base_type == "WSTRING" and not value.startswith('"') and not value.endswith('"'):
             return "\"%s\""%value
         return value