Commit Graph

33 Commits

Author SHA1 Message Date
Scott Sanderson
2569c3069d STY: s/CheckpointManager/Checkpoints
It's easy to confuse CheckpointManager and ContentsManager.
2015-01-08 14:41:46 -05:00
Scott Sanderson
7030a8717a DEV: Add full support for non-notebook checkpoints. 2015-01-01 20:52:00 -05:00
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.
2014-12-27 00:23:14 -05:00
Min RK
ad995dfdb8 Merge pull request #7244 from minrk/rm-signature
don't store signatures in notebooks
2014-12-20 16:47:05 -08:00
Min RK
db5147998d docstring on test_dir 2014-12-19 12:26:16 -08:00
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.
2014-12-17 14:27:38 -08:00
Scott Sanderson
a1ad9abe51 MAINT: Unicode literal in assertDictContainsSubset 2014-12-17 11:38:46 -08:00
Scott Sanderson
4a2149d1c3 TEST: Add a non-notebook file to directory test. 2014-12-17 11:38:46 -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
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
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
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
Min RK
f0181836b2 run test server in thread
instead of subprocess
2014-12-08 15:50:02 -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
f1f81e2efa Rename get_model() to get() 2014-11-11 14:51:21 -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
bc4f0b32bb rename ContentsManager.create_file->new
consistent with js API
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
MinRK
af735018f3 don't use nbformat.current in IPython.html
use top-level nbformat.read/write, v4 directly for compose
2014-11-01 16:41:11 -07:00
MinRK
07079095a8 update html/js to nbformat 4 2014-11-01 16:41:02 -07:00
MinRK
4ae05c729c trust is stored in code_cell.metadata
not top-level code_cell
2014-10-08 12:33:33 -07:00
Thomas Kluyver
fa6056e9ed Sort directory contents in test before assertion
Should fix recent test failures, but I can't replicate failure on my
computer, so it's not clear that it's fixed.
2014-09-05 18:44:58 -07:00
MinRK
819c3c326c fix directory listing with broken symlinks
directory listing would 404 if any listed file doesn't exist
(e.g. symlink to missing target).

Previously-failing test included.
2014-08-26 09:12:54 -07:00
MinRK
8c4069cc00 add support and tests for uploading and saving regular files 2014-07-31 11:57:36 -07:00
MinRK
0c0eb43719 teach contents service about non-notebook files 2014-07-31 11:57:36 -07:00
MinRK
6cce477e07 rename notebooks service to contents service
minimal functional changes, committing because tests are passing.
2014-07-31 11:57:36 -07:00