Пример #1
0
 def processAlgorithm(self, progress):
     if SextanteUtils.isWindows():
         path = RUtils.RFolder()
         if path == "":
             raise GeoAlgorithmExecutionException("R folder is not configured.\nPlease configure it before running R scripts.")
     loglines = []
     loglines.append("R execution commands")
     loglines += self.getFullSetOfRCommands()
     for line in loglines:
         progress.setCommand(line)
     SextanteLog.addToLog(SextanteLog.LOG_INFO, loglines)
     RUtils.executeRAlgorithm(self, progress)
     if self.showPlots:
         htmlfilename = self.getOutputValue(RAlgorithm.RPLOTS)
         f = open(htmlfilename, "w")
         f.write("<img src=\"" + self.plotsFilename + "\"/>")
         f.close()
     if self.showConsoleOutput:
         htmlfilename = self.getOutputValue(RAlgorithm.R_CONSOLE_OUTPUT)
         f = open(htmlfilename, "w")
         f.write(RUtils.getConsoleOutput())
         f.close()
Пример #2
0
 def processAlgorithm(self, progress):
     if SextanteUtils.isWindows():
         path = RUtils.RFolder()
         if path == "":
             raise GeoAlgorithmExecutionException(
                 "R folder is not configured.\nPlease configure it before running R scripts."
             )
     loglines = []
     loglines.append("R execution commands")
     loglines += self.getFullSetOfRCommands()
     for line in loglines:
         progress.setCommand(line)
     SextanteLog.addToLog(SextanteLog.LOG_INFO, loglines)
     RUtils.executeRAlgorithm(self, progress)
     if self.showPlots:
         htmlfilename = self.getOutputValue(RAlgorithm.RPLOTS)
         f = open(htmlfilename, "w")
         f.write("<img src=\"" + self.plotsFilename + "\"/>")
         f.close()
     if self.showConsoleOutput:
         htmlfilename = self.getOutputValue(RAlgorithm.R_CONSOLE_OUTPUT)
         f = open(htmlfilename, "w")
         f.write(RUtils.getConsoleOutput())
         f.close()