[Pydev-cvs] org.python.pydev/src/org/python/pydev/plugin PythonNature.java,1.6,1.7
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2004-12-01 16:59:27
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv691/src/org/python/pydev/plugin Modified Files: PythonNature.java Log Message: Index: PythonNature.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/plugin/PythonNature.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PythonNature.java 1 Dec 2004 14:38:08 -0000 1.6 --- PythonNature.java 1 Dec 2004 16:59:15 -0000 1.7 *************** *** 8,12 **** import java.io.File; - import java.io.IOException; import org.eclipse.core.resources.ICommand; --- 8,11 ---- *************** *** 172,180 **** protected IStatus run(IProgressMonitor monitor) { ! File file = getCompletionsCacheFile(); ! //this is ok, just set it directly... (it is still null anyway, and it ! //might return null if some error happens). ! astManager = ASTManager.restoreASTManager(file, monitor, this); //failed if still null. --- 171,179 ---- protected IStatus run(IProgressMonitor monitor) { ! File dir = getCompletionsCacheDir(); ! //this is ok, just set it directly... (if it is still null anyway, ! //some error happened). ! astManager = ASTManager.restoreASTManager(dir, monitor, this); //failed if still null. *************** *** 206,212 **** * @return the file that should be used to store the completions. */ ! private File getCompletionsCacheFile() { IProject p = project; ! return getCompletionsCacheFile(p, p.getName()); } --- 205,211 ---- * @return the file that should be used to store the completions. */ ! private File getCompletionsCacheDir() { IProject p = project; ! return getCompletionsCacheDir(p); } *************** *** 215,221 **** * @return */ ! public static File getCompletionsCacheFile(IProject p, String name) { IPath location = p.getWorkingLocation(PydevPlugin.getPluginID()); ! IPath path = location.addTrailingSeparator().append(name + ".pydevcompletions"); File file = new File(path.toOSString()); --- 214,220 ---- * @return */ ! public static File getCompletionsCacheDir(IProject p) { IPath location = p.getWorkingLocation(PydevPlugin.getPluginID()); ! IPath path = location;//.addTrailingSeparator().append(name + ".pydevcompletions"); File file = new File(path.toOSString()); *************** *** 236,252 **** //synchronize it!! synchronized (astManager) { - File file = getCompletionsCacheFile(); - //create file if needed - if (file.exists() == false) { - try { - file.createNewFile(); - } catch (IOException e1) { - e1.printStackTrace(); - PydevPlugin.log(e1); - } - } - //write completions cache to outputstream. ! astManager.saveASTManager(file, new JobProgressComunicator(monitor, "Save ast manager", astManager.getSize()+10, this)); } } --- 235,240 ---- //synchronize it!! synchronized (astManager) { //write completions cache to outputstream. ! astManager.saveASTManager(getCompletionsCacheDir(), new JobProgressComunicator(monitor, "Save ast manager", astManager.getSize()+10, this)); } } |