[Pydev-cvs] org.python.pydev/src/org/python/pydev/ui/pythonpathconf InterpreterInfo.java, 1.53, 1.
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-09-28 12:48:23
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/pythonpathconf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4313/src/org/python/pydev/ui/pythonpathconf Modified Files: InterpreterInfo.java AbstractInterpreterEditor.java AbstractInterpreterPreferencesPage.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: AbstractInterpreterPreferencesPage.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/AbstractInterpreterPreferencesPage.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AbstractInterpreterPreferencesPage.java 8 Jul 2007 21:14:53 -0000 1.8 --- AbstractInterpreterPreferencesPage.java 28 Sep 2008 12:45:44 -0000 1.9 *************** *** 30,40 **** /** ! * Initializer sets the preference store ! */ ! public AbstractInterpreterPreferencesPage() { ! super(GRID); ! setPreferenceStore(PydevPlugin.getDefault().getPreferenceStore()); changed = false; ! } protected abstract AbstractInterpreterEditor getInterpreterEditor(Composite p); --- 30,40 ---- /** ! * Initializer sets the preference store ! */ ! public AbstractInterpreterPreferencesPage() { ! super(GRID); ! setPreferenceStore(PydevPlugin.getDefault().getPreferenceStore()); changed = false; ! } protected abstract AbstractInterpreterEditor getInterpreterEditor(Composite p); *************** *** 42,53 **** /** * @return whether this page has changed ! */ ! protected boolean hasChanged(){ ! return changed || isEditorChanged(); ! } ! public void init(IWorkbench workbench) { ! } ! /** * Applies changes (if any) --- 42,53 ---- /** * @return whether this page has changed ! */ ! protected boolean hasChanged(){ ! return changed || isEditorChanged(); ! } ! public void init(IWorkbench workbench) { ! } ! /** * Applies changes (if any) Index: AbstractInterpreterEditor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/AbstractInterpreterEditor.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** AbstractInterpreterEditor.java 22 Oct 2007 00:28:51 -0000 1.19 --- AbstractInterpreterEditor.java 28 Sep 2008 12:45:44 -0000 1.20 *************** *** 74,80 **** private IInterpreterManager interpreterManager; ! /** ! * Tree to add libs. ! */ private Tree tree; --- 74,80 ---- private IInterpreterManager interpreterManager; ! /** ! * Tree to add libs. ! */ private Tree tree; *************** *** 165,175 **** private Tree getTreeLibsControl(Composite parent) { if (tree == null){ ! tree = new Tree(parent, SWT.BORDER|SWT.MULTI); ! tree.setFont(parent.getFont()); ! tree.addDisposeListener(new DisposeListener() { ! public void widgetDisposed(DisposeEvent event) { ! tree = null; ! } ! }); } return tree; --- 165,175 ---- private Tree getTreeLibsControl(Composite parent) { if (tree == null){ ! tree = new Tree(parent, SWT.BORDER|SWT.MULTI); ! tree.setFont(parent.getFont()); ! tree.addDisposeListener(new DisposeListener() { ! public void widgetDisposed(DisposeEvent event) { ! tree = null; ! } ! }); } return tree; *************** *** 222,234 **** super.doFillIntoGrid(parent, numColumns); ! l1 = new Label(parent, SWT.None); ! l1.setText("System PYTHONPATH"); ! GridData gd = new GridData(); ! gd.horizontalSpan = numColumns; ! l1.setLayoutData(gd); ! //the tree tree = getTreeLibsControl(parent); ! gd = new GridData(); gd.horizontalAlignment = SWT.FILL; gd.verticalAlignment = SWT.FILL; --- 222,234 ---- super.doFillIntoGrid(parent, numColumns); ! l1 = new Label(parent, SWT.None); ! l1.setText("System PYTHONPATH"); ! GridData gd = new GridData(); ! gd.horizontalSpan = numColumns; ! l1.setLayoutData(gd); ! //the tree tree = getTreeLibsControl(parent); ! gd = new GridData(); gd.horizontalAlignment = SWT.FILL; gd.verticalAlignment = SWT.FILL; *************** *** 238,253 **** //buttons at the side of the tree Composite control = getButtonBoxControlSystem(parent); ! gd = new GridData(); ! gd.verticalAlignment = GridData.BEGINNING; ! control.setLayoutData(gd); //label ! l2 = new Label(parent, SWT.None); ! l2.setText("Forced builtin libs (check http://pydev.sf.net/faq.html for more info)."); ! gd = new GridData(); ! l2.setLayoutData(gd); //the list with the builtins ! List list = getBuiltinsListControl(parent); gd = new GridData(); gd.horizontalAlignment = SWT.FILL; --- 238,253 ---- //buttons at the side of the tree Composite control = getButtonBoxControlSystem(parent); ! gd = new GridData(); ! gd.verticalAlignment = GridData.BEGINNING; ! control.setLayoutData(gd); //label ! l2 = new Label(parent, SWT.None); ! l2.setText("Forced builtin libs (check http://pydev.sf.net/faq.html for more info)."); ! gd = new GridData(); ! l2.setLayoutData(gd); //the list with the builtins ! List list = getBuiltinsListControl(parent); gd = new GridData(); gd.horizontalAlignment = SWT.FILL; *************** *** 255,261 **** gd.heightHint = 100; list.setLayoutData(gd); ! //the builtins buttons ! control = getButtonBoxControlOthers(parent); gd = new GridData(); gd.verticalAlignment = GridData.BEGINNING; --- 255,261 ---- gd.heightHint = 100; list.setLayoutData(gd); ! //the builtins buttons ! control = getButtonBoxControlOthers(parent); gd = new GridData(); gd.verticalAlignment = GridData.BEGINNING; *************** *** 443,455 **** if (listControl.getSelectionCount() == 1) { String executable = listControl.getSelection()[0]; ! InterpreterInfo info = (InterpreterInfo) interpreterManager.getInterpreterInfo(executable, new NullProgressMonitor()); ! ! InputDialog d = new InputDialog(this.getShell(), "Builtin to add", "Builtin to add", "", null); ! ! int retCode = d.open(); ! if (retCode == InputDialog.OK) { ! info.addForcedLib(d.getValue()); changed = true; ! } } --- 443,455 ---- if (listControl.getSelectionCount() == 1) { String executable = listControl.getSelection()[0]; ! InterpreterInfo info = (InterpreterInfo) interpreterManager.getInterpreterInfo(executable, new NullProgressMonitor()); ! ! InputDialog d = new InputDialog(this.getShell(), "Builtin to add", "Builtin to add", "", null); ! ! int retCode = d.open(); ! if (retCode == InputDialog.OK) { ! info.addForcedLib(d.getValue()); changed = true; ! } } *************** *** 465,471 **** String builtin = listBuiltins.getSelection()[0]; ! InterpreterInfo info = (InterpreterInfo) interpreterManager.getInterpreterInfo(executable, new NullProgressMonitor()); ! info.removeForcedLib(builtin); ! changed = true; } updateTree(); --- 465,471 ---- String builtin = listBuiltins.getSelection()[0]; ! InterpreterInfo info = (InterpreterInfo) interpreterManager.getInterpreterInfo(executable, new NullProgressMonitor()); ! info.removeForcedLib(builtin); ! changed = true; } updateTree(); *************** *** 522,541 **** if(executable != null){ ! TreeItem item = new TreeItem(tree, SWT.NONE); ! item.setText("System libs"); ! item.setImage(imageSystemLibRoot); ! InterpreterInfo info = (InterpreterInfo) interpreterManager.getInterpreterInfo(executable, new NullProgressMonitor()); ! ! for (Iterator<String> iter = info.libs.iterator(); iter.hasNext();) { ! TreeItem subItem = new TreeItem(item, SWT.NONE); ! subItem.setText(iter.next()); ! subItem.setImage(imageSystemLib); ! } ! item.setExpanded(true); ! ! //set the forced builtins ! for (Iterator<String> iter = info.forcedLibsIterator(); iter.hasNext();) { ! listBuiltins.add((String) iter.next()); } } --- 522,541 ---- if(executable != null){ ! TreeItem item = new TreeItem(tree, SWT.NONE); ! item.setText("System libs"); ! item.setImage(imageSystemLibRoot); ! InterpreterInfo info = (InterpreterInfo) interpreterManager.getInterpreterInfo(executable, new NullProgressMonitor()); ! ! for (Iterator<String> iter = info.libs.iterator(); iter.hasNext();) { ! TreeItem subItem = new TreeItem(item, SWT.NONE); ! subItem.setText(iter.next()); ! subItem.setImage(imageSystemLib); ! } ! item.setExpanded(true); ! ! //set the forced builtins ! for (Iterator<String> iter = info.forcedLibsIterator(); iter.hasNext();) { ! listBuiltins.add((String) iter.next()); } } *************** *** 551,599 **** */ protected String getNewInputObject() { ! CharArrayWriter charWriter = new CharArrayWriter(); ! PrintWriter logger = new PrintWriter(charWriter); ! logger.println("Information about process of adding new interpreter:"); try { ! ! FileDialog dialog = new FileDialog(getShell(), SWT.OPEN); ! String[] filterExtensions = getInterpreterFilterExtensions(); ! if (filterExtensions != null) { ! dialog.setFilterExtensions(filterExtensions); ! } ! if (lastPath != null) { ! if (new File(lastPath).exists()) ! dialog.setFilterPath(lastPath); ! } ! logger.println("- Opening dialog to request executable (or jar)."); ! String file = dialog.open(); ! if (file != null) { ! logger.println("- Chosen interpreter file:'"+file); ! file = file.trim(); ! if (file.length() == 0){ ! logger.println("- When trimmed, the chosen file was empty (returning null)."); ! return null; ! } ! lastPath = file; ! }else{ ! logger.println("- The file chosen was null (returning null)."); ! return null; ! } ! ! if (file != null) { ! //ok, now that we got the file, let's see if it is valid and get the library info. ! logger.println("- Ok, file is non-null. Getting info on:"+file); ! ProgressMonitorDialog monitorDialog = new ProgressMonitorDialog(this.getShell()); ! monitorDialog.setBlockOnOpen(false); ! Operation operation = new Operation(file, logger); ! monitorDialog.run(true, false, operation); ! if (operation.e != null) { ! logger.println("- Some error happened while getting info on the interpreter:"); ! operation.e.printStackTrace(logger); ! if(operation.e instanceof SimpleJythonRunner.JavaNotConfiguredException){ SimpleJythonRunner.JavaNotConfiguredException javaNotConfiguredException = (SimpleJythonRunner.JavaNotConfiguredException) operation.e; --- 551,599 ---- */ protected String getNewInputObject() { ! CharArrayWriter charWriter = new CharArrayWriter(); ! PrintWriter logger = new PrintWriter(charWriter); ! logger.println("Information about process of adding new interpreter:"); try { ! ! FileDialog dialog = new FileDialog(getShell(), SWT.OPEN); ! String[] filterExtensions = getInterpreterFilterExtensions(); ! if (filterExtensions != null) { ! dialog.setFilterExtensions(filterExtensions); ! } ! if (lastPath != null) { ! if (new File(lastPath).exists()) ! dialog.setFilterPath(lastPath); ! } ! logger.println("- Opening dialog to request executable (or jar)."); ! String file = dialog.open(); ! if (file != null) { ! logger.println("- Chosen interpreter file:'"+file); ! file = file.trim(); ! if (file.length() == 0){ ! logger.println("- When trimmed, the chosen file was empty (returning null)."); ! return null; ! } ! lastPath = file; ! }else{ ! logger.println("- The file chosen was null (returning null)."); ! return null; ! } ! ! if (file != null) { ! //ok, now that we got the file, let's see if it is valid and get the library info. ! logger.println("- Ok, file is non-null. Getting info on:"+file); ! ProgressMonitorDialog monitorDialog = new ProgressMonitorDialog(this.getShell()); ! monitorDialog.setBlockOnOpen(false); ! Operation operation = new Operation(file, logger); ! monitorDialog.run(true, false, operation); ! if (operation.e != null) { ! logger.println("- Some error happened while getting info on the interpreter:"); ! operation.e.printStackTrace(logger); ! if(operation.e instanceof SimpleJythonRunner.JavaNotConfiguredException){ SimpleJythonRunner.JavaNotConfiguredException javaNotConfiguredException = (SimpleJythonRunner.JavaNotConfiguredException) operation.e; *************** *** 602,612 **** PydevPlugin.makeStatus(IStatus.ERROR, "Java vm not configured.\n", javaNotConfiguredException)); ! }else if(operation.e instanceof JDTNotAvailableException){ ! JDTNotAvailableException noJdtException = (JDTNotAvailableException) operation.e; ErrorDialog.openError(this.getShell(), "Error getting info on interpreter", noJdtException.getMessage(), ! PydevPlugin.makeStatus(IStatus.ERROR, "JDT not available.\n", noJdtException)); ! ! }else{ String errorMsg = "Some error happened while getting info on the interpreter.\n\n" + "Common reasons include:\n\n" + --- 602,612 ---- PydevPlugin.makeStatus(IStatus.ERROR, "Java vm not configured.\n", javaNotConfiguredException)); ! }else if(operation.e instanceof JDTNotAvailableException){ ! JDTNotAvailableException noJdtException = (JDTNotAvailableException) operation.e; ErrorDialog.openError(this.getShell(), "Error getting info on interpreter", noJdtException.getMessage(), ! PydevPlugin.makeStatus(IStatus.ERROR, "JDT not available.\n", noJdtException)); ! ! }else{ String errorMsg = "Some error happened while getting info on the interpreter.\n\n" + "Common reasons include:\n\n" + *************** *** 620,637 **** "More info can also be found at the bug report: http://sourceforge.net/tracker/index.php?func=detail&aid=1523582&group_id=85796&atid=577329", operation.e)); ! } ! throw operation.e; ! } ! logger.println("- Success getting the info. Result:"+operation.result); ! return operation.result; ! } ! } catch (Exception e) { PydevPlugin.log(e); return null; } finally { ! PydevPlugin.logInfo(charWriter.toString()); } --- 620,637 ---- "More info can also be found at the bug report: http://sourceforge.net/tracker/index.php?func=detail&aid=1523582&group_id=85796&atid=577329", operation.e)); ! } ! throw operation.e; ! } ! logger.println("- Success getting the info. Result:"+operation.result); ! return operation.result; ! } ! } catch (Exception e) { PydevPlugin.log(e); return null; } finally { ! PydevPlugin.logInfo(charWriter.toString()); } *************** *** 643,647 **** String s = createList(list.getItems()); if (s != null){ ! interpreterManager.setPersistedString(s); } } --- 643,647 ---- String s = createList(list.getItems()); if (s != null){ ! interpreterManager.setPersistedString(s); } } *************** *** 650,654 **** protected void doLoad() { if (list != null) { ! String s = interpreterManager.getPersistedString(); String[] array = parseString(s); for (int i = 0; i < array.length; i++) { --- 650,654 ---- protected void doLoad() { if (list != null) { ! String s = interpreterManager.getPersistedString(); String[] array = parseString(s); for (int i = 0; i < array.length; i++) { *************** *** 660,664 **** public String getPreferenceName(){ ! throw new RuntimeException("The preferences should be stored/gotten from the IInterpreterManager, and not directly."); } --- 660,664 ---- public String getPreferenceName(){ ! throw new RuntimeException("The preferences should be stored/gotten from the IInterpreterManager, and not directly."); } *************** *** 679,711 **** private static class OperationMonitor extends ProgressMonitorWrapper{ ! private PrintWriter logger; ! protected OperationMonitor(IProgressMonitor monitor, PrintWriter logger) { ! super(monitor); ! this.logger = logger; ! } ! ! @Override ! public void beginTask(String name, int totalWork) { ! super.beginTask(name, totalWork); ! logger.print("- Beggining task:"); ! logger.print(name); ! logger.print(" totalWork:"); ! logger.println(totalWork); ! } ! ! @Override ! public void setTaskName(String name) { ! super.setTaskName(name); ! logger.print("- Setting task name:"); ! logger.println(name); ! } ! ! @Override ! public void subTask(String name) { ! super.subTask(name); ! logger.print("- Sub Task:"); ! logger.println(name); ! } } private class Operation implements IRunnableWithProgress{ --- 679,711 ---- private static class OperationMonitor extends ProgressMonitorWrapper{ ! private PrintWriter logger; ! protected OperationMonitor(IProgressMonitor monitor, PrintWriter logger) { ! super(monitor); ! this.logger = logger; ! } ! ! @Override ! public void beginTask(String name, int totalWork) { ! super.beginTask(name, totalWork); ! logger.print("- Beggining task:"); ! logger.print(name); ! logger.print(" totalWork:"); ! logger.println(totalWork); ! } ! ! @Override ! public void setTaskName(String name) { ! super.setTaskName(name); ! logger.print("- Setting task name:"); ! logger.println(name); ! } ! ! @Override ! public void subTask(String name) { ! super.subTask(name); ! logger.print("- Sub Task:"); ! logger.println(name); ! } } private class Operation implements IRunnableWithProgress{ *************** *** 714,718 **** public String file; public Exception e; ! private PrintWriter logger; /** --- 714,718 ---- public String file; public Exception e; ! private PrintWriter logger; /** *************** *** 729,738 **** */ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { ! monitor = new OperationMonitor(monitor, logger); monitor.beginTask("Getting libs", 100); try { result = interpreterManager.addInterpreter(file, monitor); } catch (Exception e) { ! logger.println("Exception detected: "+e.getMessage()); this.e = e; } --- 729,738 ---- */ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { ! monitor = new OperationMonitor(monitor, logger); monitor.beginTask("Getting libs", 100); try { result = interpreterManager.addInterpreter(file, monitor); } catch (Exception e) { ! logger.println("Exception detected: "+e.getMessage()); this.e = e; } Index: InterpreterInfo.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/pythonpathconf/InterpreterInfo.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** InterpreterInfo.java 14 Jun 2008 22:14:56 -0000 1.53 --- InterpreterInfo.java 28 Sep 2008 12:45:44 -0000 1.54 *************** *** 130,134 **** this.version = version; //deprecated (keep it cleared) ! dllLibs.clear(); setModulesManager(new SystemModulesManager()); --- 130,134 ---- this.version = version; //deprecated (keep it cleared) ! dllLibs.clear(); setModulesManager(new SystemModulesManager()); *************** *** 190,194 **** throw new RuntimeException("Unable to recreate the Interpreter info (Its format changed. Please, re-create your Interpreter information).Contents found:"+received); } ! received = received.replaceAll("\n", "").replaceAll("\r", ""); String[] forcedSplit = received.split("\\$"); String[] libsSplit = forcedSplit[0].split("\\@"); --- 190,194 ---- throw new RuntimeException("Unable to recreate the Interpreter info (Its format changed. Please, re-create your Interpreter information).Contents found:"+received); } ! received = received.replaceAll("\n", "").replaceAll("\r", ""); String[] forcedSplit = received.split("\\$"); String[] libsSplit = forcedSplit[0].split("\\@"); *************** *** 238,317 **** final Boolean[] result = new Boolean[]{true}; //true == OK, false == CANCELLED if(ProjectModulesManager.IN_TESTS){ ! if(InterpreterInfo.configurePathsCallback != null){ ! InterpreterInfo.configurePathsCallback.call(new Tuple<List<String>, List<String>>(toAsk, l)); ! } }else{ ! if(toAsk.size() > 0){ ! Runnable runnable = new Runnable(){ ! ! public void run() { ! ListSelectionDialog dialog = new ListSelectionDialog(Display.getDefault().getActiveShell(), toAsk, ! new IStructuredContentProvider(){ ! ! @SuppressWarnings("unchecked") ! public Object[] getElements(Object inputElement) { ! List<String> elements = (List<String>) inputElement; ! return elements.toArray(new String[0]); ! } ! ! public void dispose() { ! } ! ! public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { ! }}, ! ! ! new ILabelProvider(){ ! ! public Image getImage(Object element) { ! return PydevPlugin.getImageCache().get(UIConstants.LIB_SYSTEM); ! } ! ! public String getText(Object element) { ! return element.toString(); ! } ! ! public void addListener(ILabelProviderListener listener) { ! } ! ! public void dispose() { ! } ! ! public boolean isLabelProperty(Object element, String property) { ! return true; ! } ! ! public void removeListener(ILabelProviderListener listener) { ! }}, ! ! "Select the folders to be added to the SYSTEM pythonpath!\n" + ! "\n" + ! "IMPORTANT: The folders for your PROJECTS should NOT be added here, but in your project configuration.\n\n" + ! "Check:http://fabioz.com/pydev/manual_101_interpreter.html for more details."); ! dialog.setInitialSelections(l.toArray(new String[0])); ! int i = dialog.open(); if(i == Window.OK){ result[0] = true; ! Object[] result = dialog.getResult(); ! l.clear(); ! for (Object string : result) { ! l.add((String) string); ! } }else{ result[0] = false; } ! ! } ! ! }; ! try{ ! RunInUiThread.sync(runnable); ! }catch(NoClassDefFoundError e){ ! }catch(UnsatisfiedLinkError e){ ! //this means that we're running unit-tests, so, we don't have to do anything about it ! //as 'l' is already ok. ! } ! } } --- 238,317 ---- final Boolean[] result = new Boolean[]{true}; //true == OK, false == CANCELLED if(ProjectModulesManager.IN_TESTS){ ! if(InterpreterInfo.configurePathsCallback != null){ ! InterpreterInfo.configurePathsCallback.call(new Tuple<List<String>, List<String>>(toAsk, l)); ! } }else{ ! if(toAsk.size() > 0){ ! Runnable runnable = new Runnable(){ ! ! public void run() { ! ListSelectionDialog dialog = new ListSelectionDialog(Display.getDefault().getActiveShell(), toAsk, ! new IStructuredContentProvider(){ ! ! @SuppressWarnings("unchecked") ! public Object[] getElements(Object inputElement) { ! List<String> elements = (List<String>) inputElement; ! return elements.toArray(new String[0]); ! } ! ! public void dispose() { ! } ! ! public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { ! }}, ! ! ! new ILabelProvider(){ ! ! public Image getImage(Object element) { ! return PydevPlugin.getImageCache().get(UIConstants.LIB_SYSTEM); ! } ! ! public String getText(Object element) { ! return element.toString(); ! } ! ! public void addListener(ILabelProviderListener listener) { ! } ! ! public void dispose() { ! } ! ! public boolean isLabelProperty(Object element, String property) { ! return true; ! } ! ! public void removeListener(ILabelProviderListener listener) { ! }}, ! ! "Select the folders to be added to the SYSTEM pythonpath!\n" + ! "\n" + ! "IMPORTANT: The folders for your PROJECTS should NOT be added here, but in your project configuration.\n\n" + ! "Check:http://fabioz.com/pydev/manual_101_interpreter.html for more details."); ! dialog.setInitialSelections(l.toArray(new String[0])); ! int i = dialog.open(); if(i == Window.OK){ result[0] = true; ! Object[] result = dialog.getResult(); ! l.clear(); ! for (Object string : result) { ! l.add((String) string); ! } }else{ result[0] = false; } ! ! } ! ! }; ! try{ ! RunInUiThread.sync(runnable); ! }catch(NoClassDefFoundError e){ ! }catch(UnsatisfiedLinkError e){ ! //this means that we're running unit-tests, so, we don't have to do anything about it ! //as 'l' is already ok. ! } ! } } *************** *** 323,349 **** ArrayList<String> l1 = new ArrayList<String>(); if(libsSplit.length > 1){ ! String dllLibs = libsSplit[1]; ! String[] dllLibs1 = dllLibs.split("\\|"); ! for (int i = 0; i < dllLibs1.length; i++) { ! String trimmed = dllLibs1[i].trim(); ! if(trimmed.length() > 0){ ! l1.add(trimmed); ! } ! } } ! ArrayList<String> l2 = new ArrayList<String>(); if(forcedSplit.length > 1){ ! String forcedLibs = forcedSplit[1]; ! String[] forcedLibs1 = forcedLibs.split("\\|"); ! for (int i = 0; i < forcedLibs1.length; i++) { ! String trimmed = forcedLibs1[i].trim(); ! if(trimmed.length() > 0){ ! l2.add(trimmed); ! } ! } ! } return new InterpreterInfo(version, executable, l, l1, l2); ! } --- 323,349 ---- ArrayList<String> l1 = new ArrayList<String>(); if(libsSplit.length > 1){ ! String dllLibs = libsSplit[1]; ! String[] dllLibs1 = dllLibs.split("\\|"); ! for (int i = 0; i < dllLibs1.length; i++) { ! String trimmed = dllLibs1[i].trim(); ! if(trimmed.length() > 0){ ! l1.add(trimmed); ! } ! } } ! ArrayList<String> l2 = new ArrayList<String>(); if(forcedSplit.length > 1){ ! String forcedLibs = forcedSplit[1]; ! String[] forcedLibs1 = forcedLibs.split("\\|"); ! for (int i = 0; i < forcedLibs1.length; i++) { ! String trimmed = forcedLibs1[i].trim(); ! if(trimmed.length() > 0){ ! l2.add(trimmed); ! } ! } ! } return new InterpreterInfo(version, executable, l, l1, l2); ! } *************** *** 365,372 **** buffer.append("$"); if(forcedLibs.size() > 0){ ! for (Iterator<String> iter = forcedLibs.iterator(); iter.hasNext();) { ! buffer.append("|"); ! buffer.append(iter.next().toString()); ! } } --- 365,372 ---- buffer.append("$"); if(forcedLibs.size() > 0){ ! for (Iterator<String> iter = forcedLibs.iterator(); iter.hasNext();) { ! buffer.append("|"); ! buffer.append(iter.next().toString()); ! } } *************** *** 378,387 **** */ public void restoreCompiledLibs(IProgressMonitor monitor) { ! //the compiled with the interpreter should be already gotten. ! forcedLibs.add("os"); //we have it in source, but want to interpret it, source info (ast) does not give us much //as it is a set, there is no problem to add it twice ! forcedLibs.add("__builtin__"); //jython bug: __builtin__ is not added ! forcedLibs.add("sys"); //jython bug: sys is not added --- 378,388 ---- */ public void restoreCompiledLibs(IProgressMonitor monitor) { ! //the compiled with the interpreter should be already gotten. ! forcedLibs.add("os"); //we have it in source, but want to interpret it, source info (ast) does not give us much //as it is a set, there is no problem to add it twice ! forcedLibs.add("__builtin__"); //jython bug: __builtin__ is not added ! forcedLibs.add("sys"); //jython bug: sys is not added ! forcedLibs.add("email"); //email has some lazy imports that pydev cannot handle through the source |