Skip to content
Permalink
Browse files
[processing] Search for description files also in the sub-directories…
… of the script/model directory
  • Loading branch information
Rado Guzinski committed May 26, 2014
1 parent 8499b4d commit 3799f115b490e7667ed39d5e585341afa464a1b2
@@ -88,16 +88,17 @@ def _loadAlgorithms(self):
def loadFromFolder(self, folder):
if not os.path.exists(folder):
return
for descriptionFile in os.listdir(folder):
if descriptionFile.endswith('rsx'):
try:
fullpath = os.path.join(folder, descriptionFile)
alg = RAlgorithm(fullpath)
if alg.name.strip() != '':
self.algs.append(alg)
except WrongScriptException, e:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR, e.msg)
except Exception, e:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
'Could not load R script:' + descriptionFile + '\n'
+ unicode(e))
for path, subdirs, files in os.walk(folder):
for descriptionFile in files:
if descriptionFile.endswith('rsx'):
try:
fullpath = os.path.join(path, descriptionFile)
alg = RAlgorithm(fullpath)
if alg.name.strip() != '':
self.algs.append(alg)
except WrongScriptException, e:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR, e.msg)
except Exception, e:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
'Could not load R script:' + descriptionFile + '\n'
+ unicode(e))
@@ -80,16 +80,17 @@ def _loadAlgorithms(self):
def loadFromFolder(self, folder):
if not os.path.exists(folder):
return
for descriptionFile in os.listdir(folder):
if descriptionFile.endswith('model'):
try:
alg = ModelerAlgorithm()
fullpath = os.path.join(folder, descriptionFile)
alg.openModel(fullpath)
if alg.name.strip() != '':
alg.provider = self
self.algs.append(alg)
except WrongModelException, e:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
'Could not load model ' + descriptionFile + '\n'
+ e.msg)
for path, subdirs, files in os.walk(folder):
for descriptionFile in files:
if descriptionFile.endswith('model'):
try:
alg = ModelerAlgorithm()
fullpath = os.path.join(path, descriptionFile)
alg.openModel(fullpath)
if alg.name.strip() != '':
alg.provider = self
self.algs.append(alg)
except WrongModelException, e:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
'Could not load model ' + descriptionFile + '\n'
+ e.msg)
@@ -82,16 +82,17 @@ def _loadAlgorithms(self):
def loadFromFolder(self, folder):
if not os.path.exists(folder):
return
for descriptionFile in os.listdir(folder):
if descriptionFile.endswith('py'):
try:
fullpath = os.path.join(folder, descriptionFile)
alg = ScriptAlgorithm(fullpath)
if alg.name.strip() != '':
self.algs.append(alg)
except WrongScriptException, e:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR, e.msg)
except Exception, e:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
'Could not load script:' + descriptionFile + '\n'
+ unicode(e))
for path, subdirs, files in os.walk(folder):
for descriptionFile in files:
if descriptionFile.endswith('py'):
try:
fullpath = os.path.join(path, descriptionFile)
alg = ScriptAlgorithm(fullpath)
if alg.name.strip() != '':
self.algs.append(alg)
except WrongScriptException, e:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR, e.msg)
except Exception, e:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
'Could not load script:' + descriptionFile + '\n'
+ unicode(e))

0 comments on commit 3799f11

Please sign in to comment.