Commit Graph

338 Commits

Author SHA1 Message Date
Scott Sanderson
6bfab2de08 BUG: Allow for the possibility that to_path is empty string.
This is a legal input for representing the root directory.
2014-12-17 11:38:45 -08:00
Scott Sanderson
44805b94db BUG: Sanitize to_path in ContentsManager.copy.
Without this, one of the test cases in `test_copy` attempts a copy to a
directory that starts with a leading double-slash.
2014-12-17 11:38:45 -08:00
Scott Sanderson
7ab1bf7487 BUG: Set default mimetype when base64 is requested 2014-12-17 11:38:44 -08:00
Min RK
c166a05f5d abstract some methods in contents service tests
should allow re-use for ContentsManager subclasses
2014-12-17 11:38:44 -08:00
Min RK
dc70ae6b07 allow ContentsManager methods to return Futures
mainly adding `@gen.coroutine` and `yield gen.maybe_future` all over the place.

No FileContentsManager methods are actually async at this point.
2014-12-16 15:01:59 -08:00
Matthias Bussonnier
efbe695523 Merge pull request #7226 from takluyver/win-sleep-session-tests
Add a brief sleep after shutting down sessions in test teardown
2014-12-16 10:33:53 +01:00
Matthias Bussonnier
5829ceacb9 s/Json/JSON/g **/*.py 2014-12-15 21:54:54 +01:00
Thomas Kluyver
0178e2add0 Add a brief sleep after shutting down sessions in test teardown
This fixes a test failure for me on my Windows VM. See the comment for
details.
2014-12-15 12:45:45 -08:00
Matthias Bussonnier
4bd9ac7882 Add json in the base config manager name 2014-12-14 13:21:33 +01:00
Bussonnier Matthias
6f38f7b014 generalise manager 2014-12-14 13:20:04 +01:00
Min RK
42a92d4794 Merge pull request #6896 from minrk/save-hooks
Proposal: add pre/post-save hooks
2014-12-12 11:14:18 -08:00
Thomas Kluyver
f2e1b6f65f Merge pull request #7145 from minrk/type____
ContentsManager type kwarg to match model key
2014-12-10 14:28:32 -08:00
Thomas Kluyver
4c62fd4210 Merge pull request #7149 from minrk/thread-nb
run test notebook server in thread
2014-12-10 10:06:02 -08:00
Scott Sanderson
2216b9522c DEV: Tweaks from PR feedback.
- Reformat expected keys for in `validate_model`.
- Require `'mimetype'` to be non-None only when the model being
  validated is a file.
- Add more information to the error when keys are unexpectedly non-None.
2014-12-09 18:08:49 -05:00
Scott Sanderson
70eb9e219f DOC: Add docstring for validate_model. 2014-12-09 18:05:25 -05:00
Scott Sanderson
a45b8a0c67 DEV: Validate models returned from ContentsManager methods. 2014-12-09 18:05:25 -05:00
Min RK
22e206de6f ContentsManager type kwarg to match model key
remove `_` suffix, making it consistent with models,
REST API, etc.
2014-12-09 14:53:08 -08:00
Thomas Kluyver
4cee2f5f3a Merge pull request #7128 from minrk/more-v-less-m
A little more V, a little less M in the text editor
2014-12-09 14:03:04 -08:00
Thomas Kluyver
9f48e86477 Merge pull request #7136 from minrk/octet-stream
set default mimetype to octet-stream for binary files
2014-12-08 18:23:31 -08:00
Scott Sanderson
ccc8cb9cbf Minor cleanups in the contents API.
Noticed while poking around with a linter enabled.
2014-12-08 19:22:03 -05:00
Min RK
f0181836b2 run test server in thread
instead of subprocess
2014-12-08 15:50:02 -08:00
Min RK
407e63cb80 set default mimetype to octet-stream for binary files
mimetype only specified if content=True
2014-12-08 14:31:32 -08:00
Min RK
c81609f5d6 redirect /edit/ to /files/ if not (utf8) text 2014-12-08 11:34:21 -08:00
Min RK
c238553a4e set application/json on contents model replies 2014-12-07 13:10:15 -08:00
Min RK
ee00dcf083 docstring 2014-12-07 11:20:30 -08:00
Min RK
f2343e4ec5 update --script behavior to use nbconvert --to script 2014-12-07 11:18:59 -08:00
Min RK
1731b9b449 --script triggers post_save hook with nbconvert 2014-12-07 11:18:59 -08:00
Min RK
58c0a97ec3 add pre/post-save hooks
- `ContentsManager.pre_save_hook` runs on the path and model with content
- `FileContentsManager.post_save_hook` runs on the filesystem path and model without content

- use pre_save_hook for things like stripping output
- use post_save_hook for things like nbconvert --to python
2014-12-07 11:18:58 -08:00
Min RK
11ef669ec6 kernelspecs is a dict
sort menus client-side
2014-12-05 12:06:55 -08:00
Matthias Bussonnier
de52775797 Merge pull request #7078 from takluyver/kernelpath
Rework get_kernel_path logic
2014-12-04 16:59:54 +01:00
Thomas Kluyver
3cad1f4b4d Expose ConfigManager one level up the hierarchy
Because `from IPython.html.services.config import ConfigManager` is long
enough.
2014-12-02 16:51:35 -08:00
Kyle Kelley
a6d3d6a93e Log warning directly. 2014-12-02 15:12:14 -06:00
Kyle Kelley
7a48687929 Update CSP tests for new default. 2014-12-02 15:12:14 -06:00
Kyle Kelley
17d1c2d488 Report CSP violations as warnings. 2014-12-02 15:12:14 -06:00
Kyle Kelley
0c22c140c3 Turn x-frame-options tests into CSP tests 2014-12-02 15:12:14 -06:00
Kyle Kelley
392118d536 One unified CSP report URI 2014-12-02 15:12:13 -06:00
Kyle Kelley
cb19f07c9a csp_report_uri caused a cyclic dependency 2014-12-02 15:12:13 -06:00
Kyle Kelley
23b9f09177 Log CSP violations via report 2014-12-02 15:12:13 -06:00
Kyle Kelley
1f03954dd8 Handle CSP Reports 2014-12-02 15:12:13 -06:00
Thomas Kluyver
d273b56044 Clean up get_kernel_path logic 2014-12-02 11:54:19 -08:00
Matthias Bussonnier
fd2588612a return API path instead of filesystem 2014-11-28 11:31:22 +01:00
Thomas Kluyver
f1295c6b8d Add default for profile_dir
So ConfigManager is useful outside an IPython application
2014-11-25 18:08:21 -08:00
Thomas Kluyver
febd670716 First stab at ConfigManager class 2014-11-25 18:02:24 -08:00
Thomas Kluyver
25ee73a554 Loading a file works 2014-11-20 11:52:35 -08:00
Min RK
837ef7f122 s/open_w/atomic_writing/ 2014-11-19 19:56:54 -08:00
Min RK
c9a4e5b00d handle various permission failures
- turn various EPERM, EACCES errors into 403
- add `writable` bool field to contents models
- if a notebook is not `writable`, save is disabled
2014-11-19 19:56:52 -08:00
Thomas Kluyver
8252f56b00 Allow FileContentsManager and MappingKernelManager to be used outside NotebookApp 2014-11-18 17:41:21 -08:00
Thomas Kluyver
6d776a5292 Allow starting the server with both file_to_run and notebook_dir
file_to_run and notebook_dir would collide, with possible dictionary
ordering randomness depending on how they were passed.

With this change, the default value of notebook_dir is pulled from
file_to_run, instead of pushing the value when file_to_run is changed.
This makes it possible to specify both and have the server behave as
expected.
2014-11-18 17:41:21 -08:00
Min RK
a62a9abdef update MappingKernelManager module docstring 2014-11-18 13:29:44 -08:00
Min RK
1914e27cff Don't pass IPython-specific args to non-IPython kernels
add a few FIXME notes that the IPython-kernel special treatment
will probably want to be removed in the Jupyter explosion.
2014-11-17 11:17:08 -08:00