Scott Sanderson
2b73f1e620
DEV: Implement os.walk analog for ContentsManagers.
11 years ago
Scott Sanderson
1e2e86dcca
MAINT: Return dicts from CheckpointManager.get_checkpoint.
...
The output is going to get converted to a dict anyway, and this makes it
easier to pipe output from a CheckpointManager directly to a
ContentsManager.
11 years ago
Scott Sanderson
7030a8717a
DEV: Add full support for non-notebook checkpoints.
11 years ago
Scott Sanderson
23837e9ad4
DEV: Remove unnecessary notary calls.
11 years ago
Scott Sanderson
631a68d83e
TEST: Test separate roots for Contents and Checkpoints.
11 years ago
Scott Sanderson
f71f216880
DEV: More checkpoint API refactoring.
...
Changed the public checkpoint API to:
- `create_checkpoint(self, nb, path)`
- `get_checkpoint_content(self, checkpoint_id, path)`
- `rename_checkpoint(self, checkpoint_id, old_path, new_path)`
- `delete_checkpoint(self, checkpoint_id, path)`
- `list_checkpoints(self, path)`
All paths in the above are API-style paths, and the `nb` argument to
`create_checkpoint` is a dictionary suitable for passing to
`nbformat.write`.
The new `get_checkpoint_content` method returns an unvalidated notebook
content dictionary. It is used by `ContentManager.restore_checkpoint`
to load content to be written via `save`.
11 years ago
Scott Sanderson
dc295f67bd
MAINT: Add missing `config=True`s.
11 years ago
Scott Sanderson
4da8a30f20
DEV: Refactor checkpoint logic from FileContentsManager.
...
- Add a `CheckpointManager` base class and infrastructure for creating a
`checkpoint_manager` instance attribute on `ContentsManager`.
- Provide default implementations of `delete` and `rename` in the base
`ContentsManager` class. `ContentsManager` subclasses are now
required to implement `delete_file` and `rename_file`. These methods
no longer need to manage checkpoints.
- Move checkpoint-related functionality from `FileContentsManager` to a
dedicated `FileCheckpointManager` subclass.
- Move shared filesystem interaction logic into `FileManagerMixin`
used by both `FileContentsManager` and `FileCheckpointManager`.
- Minor tweaks to ContentsManager tests to get methods from the right
object.
The purpose of this change is to provide an API for users to replace
just the checkpoint logic associated with a particular
`ContentsManager`. In particular, this change makes it possible to
easily support remote storage of checkpoints while otherwise retaining
normal filesystem interactions.
11 years ago
Scott Sanderson
9aad3c631f
MAINT: Move `update` from FileContentsManager to ContentsManager.
...
The implementation in FileContentsManager is written entirely in terms
of the required API, and is sensible for other ContentsManager
implementations.
11 years ago
Min RK
ad995dfdb8
Merge pull request #7244 from minrk/rm-signature
...
don't store signatures in notebooks
11 years ago
Min RK
db5147998d
docstring on test_dir
11 years ago
Min RK
00e4ad59c0
add counter to new notebooks in test_manager
...
ensures brand new notebooks are untrusted
previously, all new notebooks were identical,
so once one was trusted, they would all start trusted.
11 years ago
Scott Sanderson
a1ad9abe51
MAINT: Unicode literal in assertDictContainsSubset
11 years ago
Scott Sanderson
4a2149d1c3
TEST: Add a non-notebook file to directory test.
11 years ago
Scott Sanderson
af7d1cdb50
STY: Define dirs as a single expression.
11 years ago
Scott Sanderson
f7cf204b25
BUG: Convert to bytes before comparing binary blobs.
11 years ago
Scott Sanderson
e9b81b6c7a
TEST: Verify base64 return values after decoding.
11 years ago
Scott Sanderson
fcc1bbecb3
MAINT: Remove unused blob and b64_blob attributes.
11 years ago
Scott Sanderson
f20a7b41cb
TEST: Abstract out directory/file deletion methods.
11 years ago
Scott Sanderson
46f299ccf2
TEST: Refactor symlink tests.
11 years ago
Min RK
a4b47e7e8a
move symlink tests to TestFileManager
11 years ago
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.
11 years ago
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.
11 years ago
Scott Sanderson
23e5e6da4f
TEST: Expect a 404 on delete of non-existent file.
11 years ago
Scott Sanderson
6bfab2de08
BUG: Allow for the possibility that to_path is empty string.
...
This is a legal input for representing the root directory.
11 years ago
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.
11 years ago
Scott Sanderson
7ab1bf7487
BUG: Set default mimetype when base64 is requested
11 years ago
Min RK
c166a05f5d
abstract some methods in contents service tests
...
should allow re-use for ContentsManager subclasses
11 years ago
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.
11 years ago
Matthias Bussonnier
efbe695523
Merge pull request #7226 from takluyver/win-sleep-session-tests
...
Add a brief sleep after shutting down sessions in test teardown
11 years ago
Matthias Bussonnier
5829ceacb9
s/Json/JSON/g **/*.py
11 years ago
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.
11 years ago
Matthias Bussonnier
4bd9ac7882
Add json in the base config manager name
11 years ago
Bussonnier Matthias
6f38f7b014
generalise manager
11 years ago
Min RK
42a92d4794
Merge pull request #6896 from minrk/save-hooks
...
Proposal: add pre/post-save hooks
11 years ago
Thomas Kluyver
f2e1b6f65f
Merge pull request #7145 from minrk/type____
...
ContentsManager type kwarg to match model key
11 years ago
Thomas Kluyver
4c62fd4210
Merge pull request #7149 from minrk/thread-nb
...
run test notebook server in thread
11 years ago
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.
11 years ago
Scott Sanderson
70eb9e219f
DOC: Add docstring for validate_model.
11 years ago
Scott Sanderson
a45b8a0c67
DEV: Validate models returned from ContentsManager methods.
11 years ago
Min RK
22e206de6f
ContentsManager type kwarg to match model key
...
remove `_` suffix, making it consistent with models,
REST API, etc.
11 years ago
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
11 years ago
Thomas Kluyver
9f48e86477
Merge pull request #7136 from minrk/octet-stream
...
set default mimetype to octet-stream for binary files
11 years ago
Scott Sanderson
ccc8cb9cbf
Minor cleanups in the contents API.
...
Noticed while poking around with a linter enabled.
11 years ago
Min RK
f0181836b2
run test server in thread
...
instead of subprocess
11 years ago
Min RK
407e63cb80
set default mimetype to octet-stream for binary files
...
mimetype only specified if content=True
11 years ago
Min RK
c81609f5d6
redirect /edit/ to /files/ if not (utf8) text
11 years ago
Min RK
c238553a4e
set application/json on contents model replies
11 years ago
Min RK
ee00dcf083
docstring
11 years ago
Min RK
f2343e4ec5
update `--script` behavior to use `nbconvert --to script`
11 years ago