The following forum message was posted by eswierk at 
http://sourceforge.net/projects/pydev/forums/forum/293649/topic/3953077:

We use a script to install Eclipse and set up a workspace automatically on each
user's machine. The first time the user starts Eclipse, Pydev should be set
up to use a specific Python interpreter and path--no clicking required.

At first I tried to implement the initial setup in an Eclipse plugin, which
worked, but seems an awfully complex way to solve such a simple problem. Pydev
already knows how to read its settings from a file. I just need to populate
the settings file and then cause Pydev to do its normal scan of the path.

I figured out a rather hacky but simple way to initialize the Pydev settings
file:

PYTHONPATH=/my/extra/python/modules python
/my/eclipse/plugins/org.python.pydev_*/PySrc/interpreterInfo.py 2>/dev/null
| sed 's/INS_PATH$//g;s/OUT_PATH$//g;s/^EXECUTABLE:/Executable\\:/g' | tr -d
'\n' | cat <(echo -en
'eclipse.preferences.version=1\nINTERPRETER_PATH_NEW=Name\:python\:EndName\:')
- <(echo '&&&&&')
>/my/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.python.
pydev.prefs

This only works in a fresh workspace; if it already contains Pydev metadata,
then Pydev doesn't try to scan the path and the user is stuck doing it manually.

I thought I'd share this in case anyone else is trying to solve a similar
problem.


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Pydev-users mailing list
Pydev-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pydev-users

Reply via email to