Skip to content

Commit

Permalink
R-scripts can have up to 10 consecutive empty lines before the parser…
Browse files Browse the repository at this point in the history
… exits
  • Loading branch information
MatMatt committed Mar 7, 2013
1 parent 5ac7d03 commit 0b6fcda
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/plugins/sextante/r/RAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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")
Expand Down

0 comments on commit 0b6fcda

Please sign in to comment.