camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Using Python script in Camel
Date Wed, 05 Apr 2017 11:21:42 GMT
[[CDATA[ is only when using XML.

Also do a simple python example, try to see some of the unit tests of
camel-script for a jython example.


On Tue, Apr 4, 2017 at 4:42 PM, samer <razzook@gmail.com> wrote:
> Thanks for reply!
>
> One thing I missed writing in my above code, is that the directory I am
> loading the file from is populated by Camel:
>
>         <python>
>                         H = dict(line.strip().split('=') for line in
> open('{{datadir}}/properties/VaraExport.properties') if not
> line.startswith('#') and not line.startswith('\n'))
>                         if H.has_key("time"):
>                         result = H["time"]
>                         else :
>                         result = '2001-01-01T00:00:00'
>         </python>
>
>
> So putting this code in python file and referencing it means I will have to
> somehow replace this variable. I am not python programmer, but is trying to
> use it instead of groovy, due to the memoryleak problem of groovy version
> that Camel is using.
>
> Note that I tried to put only one line instead of the above code and still I
> get same error!
> <python>
>     result = '2001-01-01T00:00:00'
> </python>
>
>
> Maybe I will have to try doing this in java if its easier. Do I have to
> inline my code using [CDATA[]] xml style for that as well or was it due to
> the "tab/indentation" sensitivity of python you meant?
>
> Thanks!
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Using-Python-script-in-Camel-tp5796914p5796922.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Mime
View raw message