|
|
@ -89,7 +89,7 @@ public class PythonTask extends AbstractTask { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String getPreScript() { |
|
|
|
public String getPreScript() { |
|
|
|
String rawPythonScript = pythonParameters.getRawScript().replaceAll("\\r\\n", "\n"); |
|
|
|
String rawPythonScript = pythonParameters.getRawScript().replaceAll("\\r\\n", System.lineSeparator()); |
|
|
|
try { |
|
|
|
try { |
|
|
|
rawPythonScript = convertPythonScriptPlaceholders(rawPythonScript); |
|
|
|
rawPythonScript = convertPythonScriptPlaceholders(rawPythonScript); |
|
|
|
} catch (StringIndexOutOfBoundsException e) { |
|
|
|
} catch (StringIndexOutOfBoundsException e) { |
|
|
@ -182,9 +182,9 @@ public class PythonTask extends AbstractTask { |
|
|
|
logger.info("generate python script file:{}", pythonScriptFile); |
|
|
|
logger.info("generate python script file:{}", pythonScriptFile); |
|
|
|
|
|
|
|
|
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
sb.append("#-*- encoding=utf8 -*-\n"); |
|
|
|
sb.append("#-*- encoding=utf8 -*-").append(System.lineSeparator()); |
|
|
|
|
|
|
|
|
|
|
|
sb.append("\n\n"); |
|
|
|
sb.append(System.lineSeparator()); |
|
|
|
sb.append(pythonScript); |
|
|
|
sb.append(pythonScript); |
|
|
|
logger.info(sb.toString()); |
|
|
|
logger.info(sb.toString()); |
|
|
|
|
|
|
|
|
|
|
@ -212,7 +212,7 @@ public class PythonTask extends AbstractTask { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected String buildPythonScriptContent() throws Exception { |
|
|
|
protected String buildPythonScriptContent() throws Exception { |
|
|
|
logger.info("raw python script : {}", pythonParameters.getRawScript()); |
|
|
|
logger.info("raw python script : {}", pythonParameters.getRawScript()); |
|
|
|
String rawPythonScript = pythonParameters.getRawScript().replaceAll("\\r\\n", "\n"); |
|
|
|
String rawPythonScript = pythonParameters.getRawScript().replaceAll("\\r\\n", System.lineSeparator()); |
|
|
|
Map<String, Property> paramsMap = mergeParamsWithContext(pythonParameters); |
|
|
|
Map<String, Property> paramsMap = mergeParamsWithContext(pythonParameters); |
|
|
|
return ParameterUtils.convertParameterPlaceholders(rawPythonScript, ParamUtils.convert(paramsMap)); |
|
|
|
return ParameterUtils.convertParameterPlaceholders(rawPythonScript, ParamUtils.convert(paramsMap)); |
|
|
|
} |
|
|
|
} |
|
|
|