From b2391672fb27166cfe91c4b19dc30e1c851286bc Mon Sep 17 00:00:00 2001 From: eblondel Date: Wed, 23 Oct 2019 10:44:49 +0200 Subject: [PATCH] #31 support software argument handler --- R/geoflow_software.R | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/R/geoflow_software.R b/R/geoflow_software.R index 07c6f2fd..5a5ab8a5 100644 --- a/R/geoflow_software.R +++ b/R/geoflow_software.R @@ -94,6 +94,13 @@ geoflow_software <- R6Class("geoflow_software", handler_params = paste(sapply(names(self$parameters), function(paramName){ paramValue <- self$parameters[[paramName]] if(is.character(paramValue)) paramValue <- paste0("\"",paramValue,"\"") + #manage argument handler (if defined) + argIdx = which(paramName == names(self$arguments)) + if(length(argIdx)>0){ + if(!is.null(self$arguments[[argIdx]]$handler)){ + paramValue <- paste0("self$arguments[[",argIdx,"]]$handler", "(", paramValue, ")") + } + } return(paste(paramName," = ",paramValue)) }),collapse=", ") instance <- eval(parse(text=paste0("self$handler(",handler_params,")")))