]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
Fix problem with unicode symbols in path to home directory
authorvsr <vsr@opencascade.com>
Thu, 23 Jul 2015 07:14:16 +0000 (10:14 +0300)
committervsr <vsr@opencascade.com>
Thu, 23 Jul 2015 07:14:16 +0000 (10:14 +0300)
bin/launchConfigureParser.py

index 39c3d22cbe50dee89ae6576aac1de58750373cec..82ab8e6510a3ab0abda34c8f22b5492a7fb50316 100755 (executable)
@@ -312,6 +312,15 @@ class xml_parser:
                 return string.atoi(strloc)
         return strloc
         pass
+    
+    def strValue( self, str ):
+        strloc = str
+        try:
+            if isinstance(strloc, types.UnicodeType): strloc = strloc.encode().strip()
+            else: strloc = strloc.strip()
+        except:
+            pass
+        return strloc
 
     def startElement(self, name, attrs):
         self.space.append(name)
@@ -347,14 +356,15 @@ class xml_parser:
                 key = nam
             else:                         # key for <module> section
                 key = self.section + "_" + nam
+            key = self.strValue( key )
             if nam in boolKeys:
                 self.opts[key] = self.boolValue( val )  # assign boolean value: 0 or 1
             elif nam in intKeys:
                 self.opts[key] = self.intValue( val )   # assign integer value
             elif nam in listKeys:
-                self.opts[key] = filter( lambda a: a.strip(), re.split( "[:;,]", val ) ) # assign list value: []
+                self.opts[key] = [ self.strValue( a ) for a in re.split( "[:;,]", val ) ] # assign list value: []
             else:
-                self.opts[key] = val
+                self.opts[key] = self.strValue( val ) # string value
             pass
         pass