Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automate PyDev Interpreter setup

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?

like image 800
Will Avatar asked Jan 12 '11 23:01

Will


1 Answers

In the Java API it's something as:

IInterpreterManager manager = PydevPlugin.getPythonInterpreterManager(true);
manager.setInfos(exesList, interpreterNamesToRestore, monitor);

The exesList is a list of org.python.pydev.ui.pythonpathconf.InterpreterInfo and the interpreterNamesToRestore 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).

like image 110
Fabio Zadrozny Avatar answered Sep 20 '22 14:09

Fabio Zadrozny