自动化 PyDev 解释器设置
我有一个场景,我希望能够自动设置在 PyDev 中使用的各种 Python 解释器。这些解释器具有特殊的环境变量、强制内置函数和定义的库。有没有办法通过 .ini 文件或通过 PyDev / Jython API 以编程方式为 PyDev 定义 Python 解释器?
I have a scenario where I want to be able automate the setting up of various Python interpreters for use in PyDev. These interpreters have special environment variables, forced built-ins and libraries defined. Is there a way through perhaps an .ini file or through the PyDev / Jython API to programmatically define Python interpreters for PyDev?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Java API 中,它是这样的:
exesList 是
org.python.pydev.ui.pythonpathconf.InterpreterInfo
的列表,而interpreterNamesToRestore
是已更改的解释器的列表(即:应该恢复 pythonpath)。您可能可以从 Jython 执行此操作,但 PyDev 没有提供您可以执行此操作的钩子(即:它只提供用于设置编辑器的钩子),因此,现在最好的解决方案是创建一个简单的 eclipse 插件有一个 EarlyStartup 来执行您想要的配置(应该很简单)。
In the Java API it's something as:
The exesList is a list of
org.python.pydev.ui.pythonpathconf.InterpreterInfo
and theinterpreterNamesToRestore
a list of the interpreters that were changed (i.e.: should have the pythonpath restored).You could probably do this from Jython, but PyDev provides no hooks where you'd be able to do that (i.e.: it only provides hooks for setting up an editor), so, the best solution right now would be creating a simple eclipse plugin that had an earlyStartup to do the configuration you want (should be straightforward).
不久前,我对 Eclipse 插件互相争斗并破坏了“原始”设置感到沮丧,所以我四处挖掘并发现了这些漂亮的花絮:
Eclipse 运行时选项(用于运行否则会被捕获的内容的 cli 选项-UI 功能。
运行 Eclipse 的更新因此
,如果您仔细阅读一下运行时选项,您会发现..
这可能会做您想要的事情。
I had this same question a while back after getting frustrated with Eclipse plug-ins fighting each other and ruining otherwise 'pristine' setups so I dug around and found these nifty tidbits:
Eclipse run-time options (cli options for running what would otherwise be captive-UI features.
Running Eclipse's update manager from the CLI
So, if you read through the run-time options a bit, you'll come across..
Which will probably do what you want.