Scott Sanderson
f20a7b41cb
TEST: Abstract out directory/file deletion methods.
2014-12-17 11:38:45 -08:00
Scott Sanderson
46f299ccf2
TEST: Refactor symlink tests.
2014-12-17 11:38:45 -08:00
Min RK
a4b47e7e8a
move symlink tests to TestFileManager
2014-12-17 11:38:45 -08:00
Scott Sanderson
61c2e0442f
TEST: Add checks for subdirectory name splitting.
...
Previously the tests failed to catch a bug where a ContentsManager
didn't split name from path in a nested subdirectory.
2014-12-17 11:38:45 -08:00
Scott Sanderson
c7ca3066ec
TEST: More fine-grained test for directory contents.
...
Verify that each entry in a directory listing matches the result of a
content-less direct get.
2014-12-17 11:38:45 -08:00
Scott Sanderson
23e5e6da4f
TEST: Expect a 404 on delete of non-existent file.
2014-12-17 11:38:45 -08:00
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
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
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
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
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
Thomas Kluyver
d04e41251d
Merge pull request #6915 from minrk/contents-no-0
...
use Untitled instead of Untitled0
2014-11-13 14:04:00 -08:00
Min RK
456e65b1f3
adjustments to filename increment
...
- start with no number (Untitled0 -> Untitled.ipynb)
- copy of copy increments instead of adding another `-Copy` (copy Foo-Copy1.ipynb gives Foo-Copy2.ipynb, not Foo-Copy1-Copy1.ipynb)
- copy file to new folder starts with the original filename, instead of unconditional `-Copy0`
2014-11-12 16:24:35 -08:00
Thomas Kluyver
c9b6e30526
Actually pass URL params with API request
2014-11-11 18:18:36 -08:00
Thomas Kluyver
f1f81e2efa
Rename get_model() to get()
2014-11-11 14:51:21 -08:00
Thomas Kluyver
6f48b58b18
Fix various review comments
2014-11-11 14:46:53 -08:00
Thomas Kluyver
b5a6cb7da1
Allow specifying format when getting files from contents API
2014-11-11 14:20:56 -08:00
Thomas Kluyver
ce6dd40c5c
Add type parameter for contents GET requests
2014-11-11 12:17:36 -08:00
Min RK
da832ef59f
split ContentsManager.new, add ContentsManager.new_untitled
2014-11-10 14:52:14 -08:00
Min RK
39041a9f03
address review in contents service
...
- various docstrings, comments clarified and updated
- misc typos
- fix and test creating an untitled directory via POST
- only define `message` if there's something to say
2014-11-10 14:02:21 -08:00
Min RK
74c897cc0b
unicode!
2014-11-10 14:02:20 -08:00
Min RK
bc4f0b32bb
rename ContentsManager.create_file->new
...
consistent with js API
2014-11-10 14:02:19 -08:00
Min RK
b6c4baa2fb
remove copy via PUT
...
only copy via POST to directories
2014-11-10 14:02:19 -08:00
MinRK
3ada0c2c27
Remove separate 'path', 'name' in Contents API
...
- path is full path (including name)
- name is only used for read-only convenience, and plays no role in any API
- remove 'untitled upload' (POST with content and no path)
2014-11-10 14:02:18 -08:00