Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 ee0c857
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
5 changes: 1 addition & 4 deletions .pydevproject
Expand Up @@ -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>
4 changes: 2 additions & 2 deletions src/sextante/core/SextanteUtils.py
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 5 additions & 2 deletions src/sextante/r/RAlgorithm.py
Expand Up @@ -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:])
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/sextante/r/RAlgorithmProvider.py
Expand Up @@ -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.