Skip to content

Commit

Permalink
Python scripts work with and without indentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
joergen7 committed Jan 4, 2016
1 parent b917c5d commit 37d61a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public String toScript() throws NotBoundException, NotDerivableException {

// insert function body
buf.append( comment( "insert function body" ) );
buf.append( ticket.getBody() ).append( '\n' );
buf.append( postProcess( ticket.getBody() ) ).append( '\n' );

// rename output files
buf.append( comment( "rename output files" ) );
Expand Down Expand Up @@ -769,6 +769,9 @@ protected String getStageOutCollect() {
return buf.toString();
}

@SuppressWarnings("static-method")
protected String postProcess( String body ) { return body; }

public static Invocation createInvocation( Ticket ticket ) {

String label, libPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,5 +256,10 @@ protected String varDef( String varname, String value ) {
protected String getLibPath() {
return callProcedure( "sys.path.append", quote( libPath ) );
}

@Override
protected String postProcess( String body ) {
return body.replace( "\n", "\n " );
}

}

0 comments on commit 37d61a5

Please sign in to comment.