robotframework / PythonRemoteServer

Robot Framework remote server implemented with Python
Apache License 2.0
152 stars 83 forks source link

Adding support for dynamic API libraries #1

Closed ombre42 closed 10 years ago

ombre42 commented 12 years ago

I am new to Python so excuse me if my code is not very Pythonic. Some tests are excluded for dynamic libraries not implementing get_keyword_arguments because the error message comes from Python and will not be the same as when RF "knows" the arguments and issues the error.

BTW the three tests stating "Fails with ExpatError when server runs on Jython 2.5" also fail for me on Python 2.7.2 as well (Win7).

ombre42 commented 12 years ago

After some consideration, I think that not exposing methods when the dynamic user library does not implement is not the best way to code this. Even though RF & RIDE handle it fine, it means exceptions are raised unnecessarily. Should change to returning ['*args'] or '' for the optional methods if the user library doesn't have get_keyword_arguments or get_keyword_documentation respectively. What do you think?

pekkaklarck commented 10 years ago

Unfortunately this pull request cannot be cleanly merged anymore after changes done for 1.0 release. I also have pretty big refactoring plans for the code in general, and the approach here isn't compatible with them.

Adding support for dynamic libs is definitely a valid enhancement and I opened separate issue #18 to cover it. Sorry @ombre42 for neglecting this pull requests.

ombre42 commented 10 years ago

It is OK @pekkaklarck . You already apologized. I implemented this because I was using the Python server in Jython to serve a Java dyanic API library(AnnotationLibrary). Dynamic API libraries in Python are less common due to multiple-inheritance. It was good experience for me.

pekkaklarck commented 10 years ago

Dynamic libs in Python are pretty rare and that's why this feature wasn't implemented initially. Serving Java libraries is a very good use case, though, and for some reason I had never thought about that earlier. Great that there is jrobotremoteserver these days to handle it nowadays!