From 718bb0cbb21253033d4e6a02c61be0e18e1a8bb4 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Sat, 19 Sep 2015 17:26:52 -0500 Subject: [PATCH 1/2] Editor: Forbid Jedi 0.9 as accepted version Fixes #2659 This version is generating hard crashes for Spyder when introspecting DataFrames, as it was reported in the mentioned issue. --- spyderlib/utils/introspection/jedi_plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spyderlib/utils/introspection/jedi_plugin.py b/spyderlib/utils/introspection/jedi_plugin.py index 350677667e6..c7ee4aae8d5 100644 --- a/spyderlib/utils/introspection/jedi_plugin.py +++ b/spyderlib/utils/introspection/jedi_plugin.py @@ -27,7 +27,7 @@ jedi = None -JEDI_REQVER = '>=0.8.1' +JEDI_REQVER = '>=0.8.1;<0.9.0' dependencies.add('jedi', _("(Experimental) Editor's code completion," " go-to-definition and help"), From aac864979430ee065c37825b1d8f2bcf9edb91a3 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Mon, 21 Sep 2015 15:47:03 -0500 Subject: [PATCH 2/2] Variable Explorer: Fetch more content for Arrays and DataFrames when resizing Fixes #2689 --- spyderlib/widgets/arrayeditor.py | 9 ++++++--- spyderlib/widgets/dataframeeditor.py | 12 +++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/spyderlib/widgets/arrayeditor.py b/spyderlib/widgets/arrayeditor.py index b46fdfd7486..b0089a8cf74 100644 --- a/spyderlib/widgets/arrayeditor.py +++ b/spyderlib/widgets/arrayeditor.py @@ -16,7 +16,7 @@ from __future__ import print_function from spyderlib.qt.QtGui import (QHBoxLayout, QColor, QTableView, QItemDelegate, - QLineEdit, QCheckBox, QGridLayout, + QLineEdit, QCheckBox, QGridLayout, QCursor, QDoubleValidator, QDialog, QDialogButtonBox, QMessageBox, QPushButton, QInputDialog, QMenu, QApplication, QKeySequence, QLabel, QComboBox, @@ -378,11 +378,14 @@ def load_more_data(self, value, rows=False, columns=False): self.model().fetch_more(rows=rows) if columns and value == self.horizontalScrollBar().maximum(): self.model().fetch_more(columns=columns) - + def resize_to_contents(self): """Resize cells to contents""" + QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) + self.resizeColumnsToContents() + self.model().fetch_more(columns=True) self.resizeColumnsToContents() - self.resizeRowsToContents() + QApplication.restoreOverrideCursor() def setup_menu(self): """Setup context menu""" diff --git a/spyderlib/widgets/dataframeeditor.py b/spyderlib/widgets/dataframeeditor.py index f9b5cfeb591..ca9e0792382 100644 --- a/spyderlib/widgets/dataframeeditor.py +++ b/spyderlib/widgets/dataframeeditor.py @@ -17,7 +17,7 @@ SIGNAL, SLOT) from spyderlib.qt.QtGui import (QDialog, QTableView, QColor, QGridLayout, QDialogButtonBox, QHBoxLayout, QPushButton, - QCheckBox, QMessageBox, QInputDialog, + QCheckBox, QMessageBox, QInputDialog, QCursor, QLineEdit, QApplication, QMenu, QKeySequence) from spyderlib.qt.compat import to_qvariant, from_qvariant from spyderlib.utils.qthelpers import (qapplication, get_icon, create_action, @@ -507,8 +507,7 @@ def setup_and_check(self, data, title=''): self.connect(btn, SIGNAL("clicked()"), self.change_format) btn = QPushButton(_('Resize')) btn_layout.addWidget(btn) - self.connect(btn, SIGNAL("clicked()"), - self.dataTable.resizeColumnsToContents) + self.connect(btn, SIGNAL("clicked()"), self.resize_to_contents) bgcolor = QCheckBox(_('Background color')) bgcolor.setChecked(self.dataModel.bgcolor_enabled) @@ -568,6 +567,13 @@ def get_value(self): else: return df + def resize_to_contents(self): + QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) + self.dataTable.resizeColumnsToContents() + self.dataModel.fetch_more(columns=True) + self.dataTable.resizeColumnsToContents() + QApplication.restoreOverrideCursor() + def test_edit(data, title="", parent=None): """Test subroutine"""