Thank you both for the help. I'll try to play with copying packages in the local directory and see whether Jython picks it up, there might be other restrictions. If I find anything useful, I'll update the doc site.
Cheers Sebastian -----Original Message----- From: users [mailto:users-boun...@xwiki.org] On Behalf Of Thomas Mortagne Sent: Thursday, May 26, 2016 12:34 AM To: XWiki Users Subject: Re: [xwiki-users] Python macro scripting - available packages? And same comment as Vincent, if you find a nice trick please don't hesitate to share it on http://extensions.xwiki.org/xwiki/bin/view/Extension/Python+Macro On Thu, May 26, 2016 at 9:29 AM, Thomas Mortagne <thomas.morta...@xwiki.com> wrote: > If you want to see the embedded modules, they are all located in the > jython-standalone jar (you can open it as a zip) file in /Lib folder. > > On Thu, May 26, 2016 at 9:27 AM, Thomas Mortagne > <thomas.morta...@xwiki.com> wrote: >> Actually Vincent is talking about the ruby macro. >> >> The python macro implementation is Jython (through JSR223) that you >> can find on http://jython.org/. >> >> Some ideas: It might be enough to just put the egg file of the module >> you need directly in WEB-INF/lib since Jython is scanning the >> classpath (renaming .egg to .jar might help depending on the >> application server). If that does not work then you will need to >> create a proper jar (with MANIFEST and all) and put in it whatever >> the .egg file contains (that's pretty much what I did for the >> Pygments module). >> >> In any case you should get more accurate information by asking Jython guys. >> >> On Thu, May 26, 2016 at 8:26 AM, Vincent Massol <vinc...@massol.net> wrote: >>> Hi Sebastian, >>> >>>> On 26 May 2016, at 02:17, Sebastian Schafer <s.scha...@samsung.com> wrote: >>>> >>>> Hi, >>>> I'm trying to import some packages into the Python macro on Xwiki 7.2, and >>>> while standard packages import fine (working with os and re, etc.), some >>>> (like xlrd) don't. >>>> Looking through the scripting guide and macro documentation I could not >>>> figure out how the Python macro actually works. >>>> Is it just a collection of bindings and translates the python script into >>>> groovy or something else, or is it calling the local Python installation? >>>> This might sound stupid, but I thought the latter was the case and this >>>> would limit the available packages (the ones I want to load are installed >>>> locally). >>> >>> We’re using jruby through JSR223 (java scripting api). >>> >>> Maybe https://github.com/jruby/jruby/wiki/ApplicationsAndLibraries can help? >>> >>> Once you find out how to do it, it’ll be interesting if you could >>> document it on >>> http://extensions.xwiki.org/xwiki/bin/view/Extension/Ruby+Macro >>> >>> Thanks >>> -Vincent >>> >>>> Thank you >>>> >>>> Sebastian >>> >>> _______________________________________________ >>> users mailing list >>> users@xwiki.org >>> http://lists.xwiki.org/mailman/listinfo/users >> >> >> >> -- >> Thomas Mortagne > > > > -- > Thomas Mortagne -- Thomas Mortagne _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users