[Pydev-cvs] org.python.pydev/src/org/python/pydev/utils PyFileListing.java, 1.4, 1.5 MultiStringFie
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-09-28 12:46:38
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4313/src/org/python/pydev/utils Modified Files: PyFileListing.java MultiStringFieldEditor.java CounterThread.java Log Message: Synching to latest changes: Pydev <ul> <li><strong>Editor</strong>: Cursor settings no longer overridden</li> <li><strong>Code-completion</strong>: If __all__ is defined with runtime elements (and not only in a single assign statement), it's ignored for code-completion purposes</li> <li><strong>Debugger</strong>: Pythonpath the same in debug and regular modes (sys.path[0] is the same directory as the file run)</li> <li><strong>Debugger</strong>: Persist choices done in the debugger when files from the debugger are not found</li> <li><strong>Interpreter config</strong>: "email" automatically added to the "forced builtins"</li> <li><strong>Parser</strong>: Correctly recognizing absolute import with 3 or more levels</li> <li><strong>Syntax check</strong>: Option to do only on active editor</li> </ul> Also: tabs changed for spaces Index: MultiStringFieldEditor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/utils/MultiStringFieldEditor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MultiStringFieldEditor.java 20 Oct 2007 19:30:36 -0000 1.3 --- MultiStringFieldEditor.java 28 Sep 2008 12:45:49 -0000 1.4 *************** *** 4,9 **** package org.python.pydev.utils; - import org.eclipse.jface.preference.StringFieldEditor; import org.eclipse.core.runtime.Assert; import org.eclipse.swt.SWT; import org.eclipse.swt.events.DisposeEvent; --- 4,9 ---- package org.python.pydev.utils; import org.eclipse.core.runtime.Assert; + import org.eclipse.jface.preference.StringFieldEditor; import org.eclipse.swt.SWT; import org.eclipse.swt.events.DisposeEvent; *************** *** 13,18 **** import org.eclipse.swt.events.KeyAdapter; import org.eclipse.swt.events.KeyEvent; - import org.eclipse.swt.graphics.GC; - import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; --- 13,16 ---- Index: CounterThread.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/utils/CounterThread.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CounterThread.java 7 Jun 2006 21:54:33 -0000 1.2 --- CounterThread.java 28 Sep 2008 12:45:49 -0000 1.3 *************** *** 10,47 **** */ public class CounterThread extends Thread{ ! private ICallback callback; ! private int elapseTime; ! private int stopWhenReaches; ! /** ! * @param callback the callback that should be called whenever the time elapses (it passes an int, that ! * says which call is this one). ! * @param elapseTime this is the millis that should elapse between the calls ! * @param stopWhenReaches this is the number of times that it should be called ! */ ! public CounterThread(ICallback callback, int elapseTime, int stopWhenReaches){ ! this.callback = callback; ! this.elapseTime = elapseTime; ! this.stopWhenReaches = stopWhenReaches; setName("Callback (CounterThread)"); ! } ! ! @Override ! public void run() { ! try { ! for (int i = 0; i < stopWhenReaches; i++) { ! try { ! sleep(elapseTime); ! callback.call(i); ! } catch (Exception e) { ! Log.log(e); ! return; ! } ! } ! ! } catch (Exception e) { ! Log.log(e); ! return; ! } ! } } --- 10,47 ---- */ public class CounterThread extends Thread{ ! private ICallback callback; ! private int elapseTime; ! private int stopWhenReaches; ! /** ! * @param callback the callback that should be called whenever the time elapses (it passes an int, that ! * says which call is this one). ! * @param elapseTime this is the millis that should elapse between the calls ! * @param stopWhenReaches this is the number of times that it should be called ! */ ! public CounterThread(ICallback callback, int elapseTime, int stopWhenReaches){ ! this.callback = callback; ! this.elapseTime = elapseTime; ! this.stopWhenReaches = stopWhenReaches; setName("Callback (CounterThread)"); ! } ! ! @Override ! public void run() { ! try { ! for (int i = 0; i < stopWhenReaches; i++) { ! try { ! sleep(elapseTime); ! callback.call(i); ! } catch (Exception e) { ! Log.log(e); ! return; ! } ! } ! ! } catch (Exception e) { ! Log.log(e); ! return; ! } ! } } Index: PyFileListing.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/utils/PyFileListing.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyFileListing.java 13 Aug 2008 21:12:15 -0000 1.4 --- PyFileListing.java 28 Sep 2008 12:45:49 -0000 1.5 *************** *** 26,62 **** public class PyFileListing { ! /** ! * Information about a python file found (the actual file and the way it was resolved as a python module) ! */ public static final class PyFileInfo { ! private final String relPath; ! private final File file; ! public PyFileInfo(File file, String relPath) { ! this.file = file; ! this.relPath = relPath; ! } ! /** File object. */ ! public File getFile() { ! return file; ! } ! /** Returns fully qualified name of module. */ ! public String getModuleName() { ! return relPath; ! } ! } /** ! * Returns the directories and python files in a list. ! * ! * @param file ! * @param addSubFolders ! * indicates if sub-folders should be added ! * @return tuple with files in pos 0 and folders in pos 1 ! */ @SuppressWarnings("unchecked") private static PyFileListing getPyFilesBelow(File file, FileFilter filter, IProgressMonitor monitor, boolean addSubFolders, --- 26,62 ---- public class PyFileListing { ! /** ! * Information about a python file found (the actual file and the way it was resolved as a python module) ! */ public static final class PyFileInfo { ! private final String relPath; ! private final File file; ! public PyFileInfo(File file, String relPath) { ! this.file = file; ! this.relPath = relPath; ! } ! /** File object. */ ! public File getFile() { ! return file; ! } ! /** Returns fully qualified name of module. */ ! public String getModuleName() { ! return relPath; ! } ! } /** ! * Returns the directories and python files in a list. ! * ! * @param file ! * @param addSubFolders ! * indicates if sub-folders should be added ! * @return tuple with files in pos 0 and folders in pos 1 ! */ @SuppressWarnings("unchecked") private static PyFileListing getPyFilesBelow(File file, FileFilter filter, IProgressMonitor monitor, boolean addSubFolders, *************** *** 106,112 **** if (checkHasInit && hasInit == false){ //only check if it has __init__ if really needed ! if(PythonPathHelper.isValidInitFile(file2.getName())){ ! hasInit = true; ! } } --- 106,112 ---- if (checkHasInit && hasInit == false){ //only check if it has __init__ if really needed ! if(PythonPathHelper.isValidInitFile(file2.getName())){ ! hasInit = true; ! } } *************** *** 123,130 **** if(file2.isDirectory() && addSubFolders){ ! ret.extendWith(getPyFilesBelow(file2, filter, monitor, addSubFolders, level+1, ! checkHasInit, currModuleRep)); ! ! monitor.worked(1); } } --- 123,130 ---- if(file2.isDirectory() && addSubFolders){ ! ret.extendWith(getPyFilesBelow(file2, filter, monitor, addSubFolders, level+1, ! checkHasInit, currModuleRep)); ! ! monitor.worked(1); } } *************** *** 156,178 **** */ public static FileFilter getPyFilesFileFilter(final boolean includeDirs) { ! return new FileFilter() { public boolean accept(File pathname) { if (includeDirs){ ! if(pathname.isDirectory()){ ! return true; ! } ! if(PythonPathHelper.isValidSourceFile(pathname.toString())){ ! return true; ! } ! return false; }else{ ! if(pathname.isDirectory()){ ! return false; ! } ! if(PythonPathHelper.isValidSourceFile(pathname.toString())){ ! return true; ! } ! return false; } } --- 156,178 ---- */ public static FileFilter getPyFilesFileFilter(final boolean includeDirs) { ! return new FileFilter() { public boolean accept(File pathname) { if (includeDirs){ ! if(pathname.isDirectory()){ ! return true; ! } ! if(PythonPathHelper.isValidSourceFile(pathname.toString())){ ! return true; ! } ! return false; }else{ ! if(pathname.isDirectory()){ ! return false; ! } ! if(PythonPathHelper.isValidSourceFile(pathname.toString())){ ! return true; ! } ! return false; } } *************** *** 196,216 **** */ public static List<IFile> getAllIFilesBelow(IFolder member) { ! final ArrayList<IFile> ret = new ArrayList<IFile>(); ! try { ! member.accept(new IResourceVisitor(){ ! public boolean visit(IResource resource) { ! if(resource instanceof IFile){ ! ret.add((IFile) resource); ! return false; //has no members ! } ! return true; ! } ! ! }); ! } catch (CoreException e) { ! throw new RuntimeException(e); ! } ! return ret; } --- 196,216 ---- */ public static List<IFile> getAllIFilesBelow(IFolder member) { ! final ArrayList<IFile> ret = new ArrayList<IFile>(); ! try { ! member.accept(new IResourceVisitor(){ ! public boolean visit(IResource resource) { ! if(resource instanceof IFile){ ! ret.add((IFile) resource); ! return false; //has no members ! } ! return true; ! } ! ! }); ! } catch (CoreException e) { ! throw new RuntimeException(e); ! } ! return ret; } |