Jason Grout
996d77cc89
Add documentation to check_nbextension, and switch order of parameters to be consistent with install_nbextension.
2015-01-22 21:23:12 +00:00
Jason Grout
25b475bc0a
Refactor the logic to get the nbextension directory
...
We do this so that check_nbextension corresponds to install_nbextension.
2015-01-22 21:18:09 +00:00
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.
2015-01-22 20:49:51 +00:00
Jason Grout
3beb707717
Copy as much of the nbextension as we can, even if there are errors for some of the files.
2015-01-22 20:47:10 +00:00
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.
2015-01-22 20:46:42 +00:00
Jason Grout
fc5a3bb304
Don't overwrite the dest variable
2015-01-22 20:41:27 +00:00
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.
2015-01-22 18:23:39 +00:00
Min RK
07b1e77d3b
path.sep
2015-01-09 14:18:31 -08:00
Min RK
9a1dba2c14
remove duplicate arg conflict check
2015-01-09 14:15:32 -08:00
Min RK
cebf80d881
s/nbextensions/nbextensions_dir
...
make it clearer from name that arg refers to dir
2015-01-09 14:15:32 -08:00
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
2015-01-09 14:15:31 -08:00
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”
2014-11-19 04:46:13 -05:00
Thomas Kluyver
5f456ef438
Document limitations of symlink parameter to install_nbextension
...
Closes gh-6239
2014-11-07 10:48:06 -08:00
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.
2014-04-29 10:18:36 -07:00
MinRK
e903297a15
clarify with all in check_nbextension
2014-02-13 19:38:16 -08:00
MinRK
475ac234b4
typo
2014-02-13 19:37:57 -08:00
MinRK
b413efd397
add check_nbextension
2014-02-08 21:32:30 -08:00
MinRK
68c91ffc88
allow installing nbextensions with symlinks
2014-02-08 21:32:30 -08:00
MinRK
f3664e1beb
support URLs and zip/tarballs in install_extension
2014-02-08 20:08:15 -08:00
MinRK
a8b7b853a2
add ipython install-nbextension
entrypoint
2014-02-08 20:03:33 -08:00
MinRK
704b349302
add IPython.html.nbextensions.install_nbextension
...
for installing files into IPYTHONDIR/nbextensions
2014-02-08 20:02:56 -08:00