Salome HOME
Fix small bug introduced with commit 485e5e1d
authorvsr <vsr@opencascade.com>
Mon, 19 Jan 2015 14:35:35 +0000 (17:35 +0300)
committervsr <vsr@opencascade.com>
Mon, 19 Jan 2015 14:35:35 +0000 (17:35 +0300)
bin/launchConfigureParser.py

index 99db4a7cd4f4de5f6d16c34616535e44bc8a594f..647e992308819e44d3e0560e8a01ad3cb7f5e055 100755 (executable)
@@ -197,16 +197,19 @@ def userFile(appname, cfgname):
     if not id0: return None                      # bad version id -> can't detect appropriate file
 
     # ... get all existing user preferences files
-    filetmpl = sys.platform == "win32" and "{0}.xml.*" or "{0}rc.*"
+    filetmpl1 = sys.platform == "win32" and "{0}.xml.*" or "{0}rc.*"
+    filetmpl2 = sys.platform == "win32" and filetmpl1 or "." + filetmpl1
     files = []
     if cfgname:
         # Since v6.6.0 - in ~/.config/salome directory, without dot prefix
-        files += glob.glob(os.path.join(getHomeDir(), ".config", cfgname, filetmpl.format(appname)))
-            # Since v6.5.0 - in ~/.config/salome directory, dot-prefixed (backward compatibility)
-        files += glob.glob(os.path.join(getHomeDir(), ".config", cfgname, filetmpl.format(appname)))
+        files += glob.glob(os.path.join(getHomeDir(), ".config", cfgname, filetmpl1.format(appname)))
+        # Since v6.5.0 - in ~/.config/salome directory, dot-prefixed (backward compatibility)
+        if filetmpl2 and filetmpl2 != filetmpl1:
+            files += glob.glob(os.path.join(getHomeDir(), ".config", cfgname, filetmpl2.format(appname)))
         pass
     # old style (before v6.5.0) - in ~ directory, dot-prefixed
-    files += glob.glob(os.path.join(getHomeDir(), filetmpl.format(appname)))
+    if filetmpl2 and filetmpl2 != filetmpl1:
+        files += glob.glob(os.path.join(getHomeDir(), filetmpl2.format(appname)))
     pass
 
     # ... loop through all files and find most appopriate file (with closest id)