rivescript-java icon indicating copy to clipboard operation
rivescript-java copied to clipboard

Adding python as a scripting language

Open pmioulet opened this issue 6 years ago • 6 comments

I was able to add python as a scripting language using jython and a simple handler.

However I needed to modify this commit in order avoid losing indentation in Object handler.

Adding python requires jython as a dependency, not sure if you want to also add this library to the core as a dep, but my first fix gives the possibility of adding it manually if desired.

pmioulet avatar Mar 30 '18 06:03 pmioulet

Hi @pmioulet the commit you mentioned is also part of #55 right?

Yes we would be interested in adding Python support. Did you implement it using the JSR-223 scripting engine?

marceloverdijk avatar Mar 30 '18 06:03 marceloverdijk

Yes correct jython supports it so it did not require too much work on my end :)

pmioulet avatar Mar 30 '18 06:03 pmioulet

Sounds cool, could you make a PR for that (including a PythonObjectIT similar as e.g. https://github.com/aichaos/rivescript-java/blob/master/rivescript-core/src/integration-test/java/com/rivescript/RubyObjectIT.java

I know I did some experiments with Jython a year ago and faced some problems, but can't remember it exactly anymore I'm afraid.

marceloverdijk avatar Mar 30 '18 06:03 marceloverdijk

@pmioulet could you please develop the local changes on another branch than master?

marceloverdijk avatar Mar 30 '18 06:03 marceloverdijk

@pmioulet #55 is merged now. I will wait with a new release for the Python support PR.

marceloverdijk avatar Mar 30 '18 06:03 marceloverdijk

I just pushed one (a year after sorry about that got busy on other stuff)

pmioulet avatar Oct 22 '19 04:10 pmioulet