Skip to content

Commit

Permalink
Compatibility with spyder 3
Browse files Browse the repository at this point in the history
  • Loading branch information
rproepp committed Dec 26, 2015
1 parent 7edc322 commit 2bd1577
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def find_version():
name="spykeviewer",
version=version,
packages=find_packages(),
install_requires=['guidata', 'guiqwt>=2.1.4,<4.0', 'spyder>=2.1.0',
install_requires=['guidata', 'guiqwt>=2.1.4,<4.0', 'spyder>=2.1.0,<4.0',
'spykeutils[plot,plugin]>=0.4.0',
'neo>=0.2.1', 'matplotlib', 'scipy'],
entry_points={'gui_scripts': ['spykeviewer = spykeviewer.start:main']},
Expand Down
15 changes: 12 additions & 3 deletions spykeviewer/ui/main_window.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
QSettings, QCoreApplication, QUrl)

from spyderlib.widgets.internalshell import InternalShell
from spyderlib.widgets.externalshell.namespacebrowser import NamespaceBrowser
try: # Support for spyder < 3
from spyderlib.widgets.externalshell.namespacebrowser import \
NamespaceBrowser
except ImportError:
from spyderlib.widgets.variableexplorer.namespacebrowser import \
NamespaceBrowser
from spyderlib.widgets.sourcecode.codeeditor import CodeEditor
from spyderlib.utils.misc import get_error_match

Expand All @@ -47,8 +52,12 @@
logger = logging.getLogger('spykeviewer')


# Monkeypatch variable editor
from spyderlib.widgets.dicteditor import DictDelegate
# Monkeypatch variable editor to report error in message box
try: # spyder < 3
from spyderlib.widgets.dicteditor import DictDelegate
except ImportError:
from spyderlib.widgets.variableexplorer.collectionseditor import \
CollectionsDelegate as DictDelegate
_orig_createEditor = DictDelegate.createEditor


Expand Down
6 changes: 5 additions & 1 deletion spykeviewer/ui/main_window_neo.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
from PyQt4.QtCore import (Qt, pyqtSignature, QThread)
from PyQt4.QtGui import (QMessageBox, QApplication,
QProgressDialog, QFileDialog)
from spyderlib.widgets.dicteditor import DictEditor
try: # Support for spyder < 3
from spyderlib.widgets.dicteditor import DictEditor
except ImportError:
from spyderlib.widgets.variableexplorer.collectionseditor import \
CollectionsEditor as DictEditor

from spykeutils import SpykeException
from spykeutils.progress_indicator import ignores_cancel
Expand Down

0 comments on commit 2bd1577

Please sign in to comment.