Skip to content
Permalink
Browse files
R-scripts can have up to 10 consecutive empty lines before the parser…
… exits
  • Loading branch information
MatMatt committed Mar 7, 2013
1 parent 5ac7d03 commit 0b6fcdafe927d0ef9ac8cb9f14a2c2a1c744b81d
Showing with 6 additions and 1 deletion.
  1. +6 −1 python/plugins/sextante/r/RAlgorithm.py
@@ -97,9 +97,10 @@ def defineCharacteristicsFromFile(self):
filename = os.path.basename(self.descriptionFile)
self.name = filename[:filename.rfind(".")].replace("_", " ")
self.group = "User R scripts"
ender = 0
lines = open(self.descriptionFile)
line = lines.readline().strip("\n").strip("\r")
while line != "":
while ender < 10:
if line.startswith("##"):
try:
self.processParameterLine(line)
@@ -112,6 +113,10 @@ def defineCharacteristicsFromFile(self):
self.addOutput(OutputHTML(RAlgorithm.R_CONSOLE_OUTPUT, "R Console Output"))
self.showConsoleOutput = True
else:
if line == '':
ender += 1
else:
ender=0
self.commands.append(line)
self.script += line + "\n"
line = lines.readline().strip("\n").strip("\r")

0 comments on commit 0b6fcda

Please sign in to comment.