Skip to content

Commit

Permalink
use normalize path (use native separators, avoid duplicate separators)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Dec 20, 2012
1 parent 8cb888c commit e242af4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
4 changes: 2 additions & 2 deletions python/plugins/sextante/modeler/ModelerUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class ModelerUtils:
def modelsFolder():
folder = SextanteConfig.getSetting(ModelerUtils.MODELS_FOLDER)
if folder == None:
folder = SextanteUtils.userFolder() + os.sep + "models"
folder = unicode(os.path.join(SextanteUtils.userFolder(), "models"))
mkdir(folder)

return folder
return os.path.abspath(folder)

@staticmethod
def getAlgorithm(name):
Expand Down
15 changes: 4 additions & 11 deletions python/plugins/sextante/r/RUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,18 @@ class RUtils:
def RFolder():
folder = SextanteConfig.getSetting(RUtils.R_FOLDER)
if folder == None:
folder =""
folder = ""

return folder
return os.path.abspath(unicode(folder))

@staticmethod
def RScriptsFolder():
folder = SextanteConfig.getSetting(RUtils.RSCRIPTS_FOLDER)
if folder == None:
#folder = os.path.join(os.path.dirname(__file__), "scripts")
folder = SextanteUtils.userFolder() + os.sep + "rscripts"
folder = unicode(os.path.join(SextanteUtils.userFolder(), "rscripts"))
mkdir(folder)

return folder
return os.path.abspath(folder)

@staticmethod
def createRScriptFromRCommands(commands):
Expand All @@ -61,17 +60,14 @@ def createRScriptFromRCommands(commands):
scriptfile.write(command + "\n")
scriptfile.close()


@staticmethod
def getRScriptFilename():
return SextanteUtils.userFolder() + os.sep + "sextante_script.r"


@staticmethod
def getConsoleOutputFilename():
return RUtils.getRScriptFilename()+".Rout"


@staticmethod
def executeRAlgorithm(alg, progress):
RUtils.verboseCommands = alg.getVerboseCommands();
Expand Down Expand Up @@ -113,7 +109,6 @@ def createConsoleOutput():
RUtils.consoleResults.append("<p>" + line + "</p>\n");
RUtils.allConsoleResults.append(line);


@staticmethod
def getConsoleOutput():
s = "<font face=\"courier\">\n"
Expand All @@ -123,5 +118,3 @@ def getConsoleOutput():
s+="</font>\n"

return s


4 changes: 2 additions & 2 deletions python/plugins/sextante/script/ScriptUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ScriptUtils:
def scriptsFolder():
folder = SextanteConfig.getSetting(ScriptUtils.SCRIPTS_FOLDER)
if folder == None:
folder = SextanteUtils.userFolder() + os.sep + "scripts"
folder = unicode(os.path.join(SextanteUtils.userFolder(), "scripts"))
mkdir(folder)

return folder
return os.path.abspath(folder)

0 comments on commit e242af4

Please sign in to comment.