diff --git a/cuneiform-core/src/main/java/de/huberlin/wbi/cuneiform/core/invoc/Invocation.java b/cuneiform-core/src/main/java/de/huberlin/wbi/cuneiform/core/invoc/Invocation.java index fa477df..972e7cd 100644 --- a/cuneiform-core/src/main/java/de/huberlin/wbi/cuneiform/core/invoc/Invocation.java +++ b/cuneiform-core/src/main/java/de/huberlin/wbi/cuneiform/core/invoc/Invocation.java @@ -298,7 +298,12 @@ public String toScript() throws NotBoundException, NotDerivableException { // report stage in file sizes and report error when something is missing buf.append( comment( "report stage in file sizes and report error when something is missing" ) ); buf.append( getStageInCollect() ).append( '\n' ); - + + // insert body prefix + buf.append( comment( "insert body prefix" ) ); + buf.append( getBodyPrefix() ).append( '\n' ); + + // insert function body buf.append( comment( "insert function body" ) ); buf.append( ticket.getBody() ).append( '\n' ); @@ -332,6 +337,11 @@ protected String declareString( String outputName ) { protected String getImport() { return ""; } + + @SuppressWarnings("static-method") + protected String getBodyPrefix() { + return ""; + } protected abstract String callFunction( String name, String... argValue ); protected abstract String callProcedure( String name, String... argValue ); diff --git a/cuneiform-core/src/main/java/de/huberlin/wbi/cuneiform/core/invoc/PythonInvocation.java b/cuneiform-core/src/main/java/de/huberlin/wbi/cuneiform/core/invoc/PythonInvocation.java index 0a202b2..81679d6 100644 --- a/cuneiform-core/src/main/java/de/huberlin/wbi/cuneiform/core/invoc/PythonInvocation.java +++ b/cuneiform-core/src/main/java/de/huberlin/wbi/cuneiform/core/invoc/PythonInvocation.java @@ -137,6 +137,11 @@ protected String forEach( String listName, String elementName, String body ) { "for "+elementName+" in "+listName+":\n " +body.replace( "\n", "\n " )+"\n"; } + + @Override + protected String getBodyPrefix() { + return "if True:\n"; + } @Override protected String getImport() {