在 Eclipse 中运行 Jython 脚本/重复工作区设置

发布于 2024-11-18 16:05:33 字数 512 浏览 5 评论 0原文

我创建了一堆 Python 脚本,用于设置 Eclipse 工作区设置并从 Buildout 配置工具导入 Python 项目:

http://svn.plone.org/svn/collective/collective.eclipsescripts/trunk/README.txt

(脚本扫描某些文件夹,将所有 Python Egg 项目导入工作区并设置一些设置)

我一直在使用这些脚本与 Aptana Studio 2.0 + Eclipse Monkey + PythonMonkey 组合。

然而,EclipseMonkey 项目似乎已经停止。对于这样的脚本任务,使用 Jython 在 Eclipse 运行时上下文中运行脚本的现代推荐方法是什么?

目标环境:Aptana Studio 3.0。

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/collective.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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦初启 2024-11-25 16:05:33

我不认为有真正的替代品...... PyDev 确实有 Jython 脚本,但它只提供编辑器中发生的情况的挂钩(请参阅:http://pydev.org/manual_articles_scripting.html)。

PyDev 理论上可以进行改进,为您提供更多钩子,因为它确实提供了一个可以访问 Eclipse 内部的内部 Jython ——您甚至可以启动一个内部解释器来探测它(Ctrl+Alt+Enter 并选择使用 Eclipse 内部 Jython ),但目前还没有计划对其进行实际改进(当前内部 Jython 仍处于 2.1 版本)。

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).

·深蓝 2024-11-25 16:05:33

另一个尝试的选择是通过 Aptana Ruble 支持以您自己的自定义卢布运行您的 python 脚本。我们支持在 JRuby 下运行 shell 脚本或内联 ruby​​。因此,您可以连接将 python 脚本作为 shell 脚本启动的命令。

如果脚本实际上通过 Jython 调用 Java 代码,那么这实际上是不可行的。在这种情况下,我想您的选择是将它们移植到 ruby​​,因为 Rubles 中的命令在 JRuby 下运行,并且可以完全访问 eclipse 插件/Java API。

请参阅http://wiki.appcelerator.org/display/tis/Ruble+Specificationhttp://wiki.appcelerator.org/display/tis/Ruble+Cookbook

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文