[python-SimpleCV] Fix an import problem when trying to run simplecv notebook in fedora 21.

Julien Enselme jujens at fedoraproject.org
Sun Dec 7 16:43:15 UTC 2014


commit 4416702d32722f6fd5910c757f27e589aa721b18
Author: Julien Enselme <jujens at jujens.eu>
Date:   Sun Dec 7 17:43:06 2014 +0100

    Fix an import problem when trying to run simplecv notebook in fedora 21.

 python-SimpleCV-1.3-shell_import_frontend.patch |   29 +++++++++++++++++++++++
 python-SimpleCV.spec                            |    9 ++++++-
 2 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/python-SimpleCV-1.3-shell_import_frontend.patch b/python-SimpleCV-1.3-shell_import_frontend.patch
new file mode 100644
index 0000000..294f7cd
--- /dev/null
+++ b/python-SimpleCV-1.3-shell_import_frontend.patch
@@ -0,0 +1,29 @@
+--- SimpleCV/Shell/Shell.py	2012-08-08 21:58:38.000000000 +0200
++++ SimpleCV/Shell/Shell.py	2014-12-07 17:35:06.494507973 +0100
+@@ -48,7 +48,10 @@
+   try:
+     import IPython
+     from IPython.config.loader import Config
+-    from IPython.frontend.terminal.embed import InteractiveShellEmbed
++    if IPython.version_info[0] >= 1:
++      from IPython.terminal.embed import InteractiveShellEmbed
++    else:
++      from IPython.frontend.terminal.embed import InteractiveShellEmbed
+     IPVER = 11
+   except Exception as e:
+     raise(e)
+@@ -163,8 +166,12 @@
+ 
+ def run_notebook():
+     'Run the ipython notebook server'
+-    from IPython.frontend.html.notebook import notebookapp
+-    from IPython.frontend.html.notebook import kernelmanager
++    if IPython.version_info[0] >= 2:
++        from IPython.html import notebookapp
++        from IPython.html.services.kernels import kernelmanager
++    else:
++        from IPython.frontend.html.notebook import notebookapp
++        from IPython.frontend.html.notebook import kernelmanager
+ 
+     code = ""
+     code += "from SimpleCV import *;"
diff --git a/python-SimpleCV.spec b/python-SimpleCV.spec
index 8d1ae77..c7fa886 100644
--- a/python-SimpleCV.spec
+++ b/python-SimpleCV.spec
@@ -1,6 +1,6 @@
 Name:           python-SimpleCV
 Version:        1.3
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Open source framework for building computer vision applications
 
 License:        BSD
@@ -17,6 +17,9 @@ Patch3:         %{name}-%{version}-test_cameras.patch
 # Make sure that we use the packaged fonts and remove reference to unpackaged
 # fonts : ubuntu
 Patch4:         %{name}-%{version}-font.patch
+# Fix the import from non existant package in ipython >= 2
+#See: https://github.com/sightmachine/SimpleCV/pull/582
+Patch5:         %{name}-%{version}-shell_import_frontend.patch
 
 BuildArch:      noarch
 BuildRequires:  python-devel
@@ -73,6 +76,7 @@ rm -r SimpleCV/fonts
 %patch2
 %patch3
 %patch4
+%patch5
 
 
 %build
@@ -112,6 +116,9 @@ nosetests
 
 
 %changelog
+* Sun Dec 7 2014 Julien Enselme <jujens at jujens.eu> - 1.3-4
+- Fix an import problem when trying to run simplecv notebook in fedora 21.
+
 * Thu Oct 2 2014 Julien Enselme <jujens at jujens.eu> - 1.3-3
 - Correct dependancy python-pip -> python-pillow.
 - Add bundled fonts as dependancies.


More information about the scm-commits mailing list