[Pydev-code] How to refresh the interpreter
Brought to you by:
fabioz
From: vincent l. <lap...@ho...> - 2009-11-05 21:47:06
|
Hi, I'm changing the INTERPRETER_PATH_NEW preference with the preference store of the pydev plugin. How can I send a refresh command to the pydev plugin to make sure it is updated? See the sample below... Note: sometimes, pydev automatically detected my preference change and automatically refresh the plugin, but sometimes it doesn't. Is there a particular reason? Thanks Vincent /** * String template used to define the interpreter value */ private static final String INTERPRETER_PATH_NEW_TEMPLATE = "Version$versionExecutable:" + pathTag + "\\python.exe|" + "$path\\DLLs|" + "$path\\lib|" + "$path\\lib\\lib-tk|" + "$path|" + "$path\\lib\\site-packages|" + "$path\\lib\\site-packages\\win32|" + "$path\\lib\\site-packages\\win32\\lib|" + "$path\\lib\\site-packages\\Pythonwin@$|" + "OpenGL|__builtin__|__main__|_codecs|_hotshot|_locale|_weakref|array|audioop|binascii|cPickle|cStringIO|cmath|email|errno|exceptions|gc|imageop|imp|marshal|math|md5|msvcrt|new|nt|operator|os|pcre|regex|rgbimg|rotor|sha|signal|strop|struct|sys|thread|time|wx|wxPython|xreadlines|xxsubtype&&&&&"; private void setPydevInterpreter(File pythonRootDirExecFile, String version) { String pythonPath = pythonRootDirExecFile.getAbsolutePath(); // Calculate interpreter value String interpreterValue = INTERPRETER_PATH_NEW_TEMPLATE; // replace version interpreterValue = interpreterValue.replace("$version", version); // replace python path interpreterValue = interpreterValue.replace("$path", pythonPath); // Set INTERPRETER_PATH_NEW preference pydevPlugin.getPreferenceStore().setValue(INTERPRETER_PATH_NEW, interpreterValue); // Refresh pydev plugin // How can I force the refresh of the plugin } _________________________________________________________________ Windows Live: Keep your friends up to date with what you do online. http://go.microsoft.com/?linkid=9691815 |