Jason Grout
3f3012a4d4
Don't trap any copying errors - allow them to bubble up.
11 years ago
Jason Grout
996d77cc89
Add documentation to check_nbextension, and switch order of parameters to be consistent with install_nbextension.
11 years ago
Jason Grout
25b475bc0a
Refactor the logic to get the nbextension directory
...
We do this so that check_nbextension corresponds to install_nbextension.
11 years ago
Jason Grout
6b4c986407
Work around a bug in setting and getting the mtime in python 2
...
See http://bugs.python.org/issue12904 . Basically, we can get the mtime in
nanosecond precision, but only set it in microsecond precision. This means
that the shutil.copy2 will not set the destination's mtime to exactly the same
mtime as our source. The end result is that we can *always* end up copying
the extension because the source always appears newer. We add a microsecond of fudge time when checking to see
if the source is newer than the destination to get around this.
This bug is fixed in Python 3.3+, I believe.
11 years ago
Jason Grout
3beb707717
Copy as much of the nbextension as we can, even if there are errors for some of the files.
11 years ago
Jason Grout
a3d0a1764b
Fix the path we use when walking to include the path separator
...
This is so that parent[len(path):] isn't an absolute path, so the pjoin doesn't throw dest away.
11 years ago
Jason Grout
fc5a3bb304
Don't overwrite the dest variable
11 years ago
Jason Grout
bf4a20f382
Initial take on implementing configurable destinations for nbextensions.
...
This allows for a directory in a package to be called 'nbextensions', but be installed to an nbextension named after the package, for example.
11 years ago
Min RK
07b1e77d3b
path.sep
11 years ago
Min RK
9a1dba2c14
remove duplicate arg conflict check
11 years ago
Min RK
cebf80d881
s/nbextensions/nbextensions_dir
...
make it clearer from name that arg refers to dir
11 years ago
Min RK
f3da69c38d
allow system-wide paths for nbextensions
...
like kernel specs, default install is `/usr/local/share/jupyter/nbextensions`
add `--user` for .ipython/nbextensions path
11 years ago
Jason Grout
5a39c0c9bd
Use os.remove instead of shutil.rmtree if we try to remove a symbolic link
...
If we try to remove a symbolic link to a directory with shutil.rmtree, we get
the error “Cannot call rmtree on a symbolic link”
11 years ago
Thomas Kluyver
5f456ef438
Document limitations of symlink parameter to install_nbextension
...
Closes gh-6239
11 years ago
MinRK
934e731237
add utils.path.ensure_dir_exists
...
Ensures that a directory exists,
and protects against a common race condition when multiple
processes try to create the same directory.
12 years ago
MinRK
e903297a15
clarify with all in check_nbextension
12 years ago
MinRK
475ac234b4
typo
12 years ago
MinRK
b413efd397
add check_nbextension
12 years ago
MinRK
68c91ffc88
allow installing nbextensions with symlinks
12 years ago
MinRK
f3664e1beb
support URLs and zip/tarballs in install_extension
12 years ago
MinRK
a8b7b853a2
add `ipython install-nbextension` entrypoint
12 years ago
MinRK
704b349302
add IPython.html.nbextensions.install_nbextension
...
for installing files into IPYTHONDIR/nbextensions
12 years ago