python-ipython: re-add split-pkg.patch, it's still needed

This commit is contained in:
Alessio Sergi 2015-05-14 01:20:20 +02:00
parent 10a390ba0b
commit bc66ad89c8
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,32 @@
Description: don't fail startup if ipython-notebook is not installed
e.g. ipython locate triggers this code but doesn't need the notebook css files
--- IPython/core/profiledir.py
+++ IPython/core/profiledir.py
@@ -173,15 +173,18 @@ class ProfileDir(LoggingConfigurable):
self._mkdir(self.static_dir)
custom = os.path.join(self.static_dir, 'custom')
self._mkdir(custom)
- from IPython.html import DEFAULT_STATIC_FILES_PATH
- for fname in ('custom.js', 'custom.css'):
- src = os.path.join(DEFAULT_STATIC_FILES_PATH, 'custom', fname)
- dest = os.path.join(custom, fname)
- if not os.path.exists(src):
- self.log.warn("Could not copy default file to static dir. Source file %s does not exist.", src)
- continue
- if not os.path.exists(dest):
- shutil.copy(src, dest)
+ try:
+ from IPython.html import DEFAULT_STATIC_FILES_PATH
+ for fname in ('custom.js', 'custom.css'):
+ src = os.path.join(DEFAULT_STATIC_FILES_PATH, 'custom', fname)
+ dest = os.path.join(custom, fname)
+ if not os.path.exists(src):
+ self.log.warn("Could not copy default file to static dir. Source file %s does not exist.", src)
+ continue
+ if not os.path.exists(dest):
+ shutil.copy(src, dest)
+ except ImportError:
+ pass # ipython-notebook not installed
def check_dirs(self):
self.check_security_dir()

View File

@ -1,7 +1,7 @@
# Template file for 'python-ipython'
pkgname=python-ipython
version=3.1.0
revision=2
revision=3
noarch=yes
wrksrc="ipython-${version}"
build_style=python-module