projects
/
iramuteq
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
R script
[iramuteq]
/
chemins.py
diff --git
a/chemins.py
b/chemins.py
index
24a76de
..
f43969c
100644
(file)
--- a/
chemins.py
+++ b/
chemins.py
@@
-5,12
+5,22
@@
#License: GNU/GPL
import os
#License: GNU/GPL
import os
+import sys
import tempfile
import logging
log = logging.getLogger('iramuteq.chemins')
import tempfile
import logging
log = logging.getLogger('iramuteq.chemins')
+def normpath_win32(path) :
+ if not sys.platform == 'win32' :
+ return path
+ while '\\\\' in path :
+ path = path.replace('\\\\', '\\')
+ if sys.platform == 'win32' and path.startswith('\\') and not path.startswith('\\\\') :
+ path = '\\' + path
+ return path
+
class PathOut :
def __init__(self, filename = None, analyse_type = '', dirout = None) :
if filename is not None :
class PathOut :
def __init__(self, filename = None, analyse_type = '', dirout = None) :
if filename is not None :
@@
-48,9
+58,13
@@
class PathOut :
self.temp = tempfile.mkstemp(prefix='iramuteq')[1].replace('\\', '\\\\')
return self.temp
elif key not in self.d :
self.temp = tempfile.mkstemp(prefix='iramuteq')[1].replace('\\', '\\\\')
return self.temp
elif key not in self.d :
- return os.path.join(self.dirout, key).replace('\\', '\\\\')
+ f = os.path.join(self.dirout, key).replace('\\', '\\\\')
+ return normpath_win32(f)
+ #return os.path.join(self.dirout, key).replace('\\', '\\\\')
else :
else :
- return os.path.join(self.dirout, self.d[key]).replace('\\', '\\\\')
+ f = os.path.join(self.dirout, self.d[key]).replace('\\', '\\\\')
+ return normpath_win32(f)
+ #return os.path.join(self.dirout, self.d[key]).replace('\\', '\\\\')
def getF(self, key) :
return self.__getitem__(key).replace('\\', '/')
def getF(self, key) :
return self.__getitem__(key).replace('\\', '/')
@@
-145,6
+159,7
@@
def ConstructGlobalPath(AppliPath):
ConfigPath = os.path.join(AppliPath, 'configuration')
DictConfigPath = {
'global': os.path.join(ConfigPath, 'global.cfg'),
ConfigPath = os.path.join(AppliPath, 'configuration')
DictConfigPath = {
'global': os.path.join(ConfigPath, 'global.cfg'),
+ 'preferences': os.path.join(ConfigPath, 'iramuteq.cfg'),
}
return DictConfigPath
}
return DictConfigPath