Skip to content
Permalink
Browse files
changed how user dir is found
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@40 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
volayaf committed Mar 13, 2012
1 parent b3584dc commit ee0c8577168864390fe797ae3cc17c48d9b93f3e
Showing with 10 additions and 8 deletions.
  1. +1 −4 .pydevproject
  2. +2 −2 src/sextante/core/SextanteUtils.py
  3. +5 −2 src/sextante/r/RAlgorithm.py
  4. +2 −0 src/sextante/r/RAlgorithmProvider.py
@@ -2,9 +2,6 @@
<?eclipse-pydev version="1.0"?>

<pydev_project>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/sextante/src</path>
</pydev_pathproperty>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
</pydev_project>
@@ -7,7 +7,7 @@ class SextanteUtils:

@staticmethod
def userFolder():
userfolder = os.getenv('HOME') + os.sep + "sextante"
userfolder = os.path.expanduser("~") + os.sep + "sextante"
mkdir(userfolder)

return userfolder
@@ -18,7 +18,7 @@ def isWindows():

@staticmethod
def tempFolder():
tempfolder = os.getenv('HOME') + os.sep + "sextante" + os.sep + "tempdata"
tempfolder = os.path.expanduser("~") + os.sep + "sextante" + os.sep + "tempdata"
mkdir(tempfolder)

return tempfolder
@@ -44,7 +44,10 @@ def defineCharacteristicsFromFile(self):
line = lines.readline().strip("\n")
while line != "":
if line.startswith("##"):
self.processParameterLine(line)
try:
self.processParameterLine(line)
except Exception:
raise WrongScriptException("Could not load R script:" + self.descriptionFile + ".\n Problem with line \"" + line + "\"")
elif line.startswith(">"):
self.commands.append(line[1:])
self.verboseCommands.append(line[1:])
@@ -67,7 +70,7 @@ def processParameterLine(self,line):
param = None
out = None
line = line.replace("#", "");
if line.strip(" ") == "showplots":
if line.lower().strip().startswith("showplots"):
self.showPlots = True
self.addOutput(OutputHTML(RAlgorithm.RPLOTS, "R Plots"));
return
@@ -39,6 +39,8 @@ def _loadAlgorithms(self):
self.algs.append(alg)
except WrongScriptException,e:
SextanteLog.addToLog(SextanteLog.LOG_ERROR,e.msg)
except Exception, e:
SextanteLog.addToLog(SextanteLog.LOG_ERROR,"Could not load R script:" + descriptionFile)



0 comments on commit ee0c857

Please sign in to comment.