开发者

Running Jython scripts in Eclipse / repeat workspace set-ups

I have created a bunch of Python scripts which I use to set-up Eclipse workspace settings and import Python projects from Buildout configuration tool:

http://svn.plone.org/svn/collective/colle开发者_运维知识库ctive.eclipsescripts/trunk/README.txt

(the script scans certain folders, imports all Python egg projects to workspace and sets up some settings)

I have been using these scripts with Aptana Studio 2.0 + Eclipse Monkey + PythonMonkey combo.

However, looks like EclipseMonkey project has been discontinued. What would the modern recommended way to use Jython to run a script within Eclipse run-time context for scripting tasks like this?

Target environment: Aptana Studio 3.0.


I don't think there's a real replacement for it... PyDev does have Jython scripting, but it only provides the hooks for what happens in the editor (see: http://pydev.org/manual_articles_scripting.html).

PyDev could in theory be improved to give you more hooks, as it does provide an internal Jython that can access the Eclipse internals -- you may even start an internal interpreter to probe it (Ctrl+Alt+Enter with option to use Eclipse internal Jython), but there are no plans to actually improve it right now (and the current internal Jython is still in version 2.1).


Another option to try is to run your python scripts through the Aptana Ruble support in a custom ruble of your own. We support running shell scripts, or inline ruby under JRuby. So you could hook up commands that would launch the python script as a shell script.

If the scripts actually call into Java code through Jython, then that won't really be feasible. In that case, I guess your option would be to port them to ruby, since the commands in Rubles get run under JRuby with full access to the eclipse plugins/Java APIs.

See http://wiki.appcelerator.org/display/tis/Ruble+Specification and http://wiki.appcelerator.org/display/tis/Ruble+Cookbook

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜