Note
This documentation is for a development version of IPython. There may be significant differences from the latest stable release.
A base class for contents managers.
Bases: IPython.config.configurable.LoggingConfigurable
Base class for serving files and directories.
This serves any text or binary file, as well as directories, with special handling for JSON notebook documents.
Most APIs take a path argument, which is always an API-style unicode path, and always refers to a directory.
name is also unicode, and refers to a specfic target:
Check for trusted cells, and sign the notebook.
Called as a part of saving notebooks.
| Parameters: | nb : dict
name : string
path : string
|
|---|
Copy an existing file and return its new model.
If to_name not specified, increment from_name-Copy#.ext.
copy_from can be a full path to a file, or just a base name. If a base name, path is used.
Create a checkpoint of the current state of a file
Returns a checkpoint_id for the new checkpoint.
Create a new file or directory and return its model with no content.
Delete file or directory by name and path.
delete a checkpoint for a file
Does a file or directory exist at the given name and path?
Like os.path.exists
| Parameters: | name : string
path : string
|
|---|---|
| Returns: | exists : bool
|
Does a file exist at the given name and path?
Like os.path.isfile
Override this method in subclasses.
| Parameters: | name : string
path : string
|
|---|---|
| Returns: | exists : bool
|
Return the path to start kernel in
Get the model of a file or directory with or without content.
Increment a filename until it is unique.
| Parameters: | filename : unicode
path : unicode
|
|---|---|
| Returns: | name : unicode
|
Does the API style path correspond to a hidden directory or file?
| Parameters: | path : string
|
|---|---|
| Returns: | hidden : bool
|
Return a list of checkpoints for a given file
Mark cells as trusted if the notebook signature matches.
Called as a part of loading notebooks.
| Parameters: | nb : dict
name : string
path : string
|
|---|
Does the API-style path (directory) actually exist?
Like os.path.isdir
Override this method in subclasses.
| Parameters: | path : string
|
|---|---|
| Returns: | exists : bool
|
Restore a file from one of its checkpoints
Save the file or directory and return the model with no content.
Should this file/directory name be displayed in a listing?
Explicitly trust a notebook
| Parameters: | name : string
path : string
|
|---|
Update the file or directory and return the model with no content.
For use in PATCH requests, to enable renaming a file without re-uploading its contents. Only used for renaming at the moment.
Add failed-validation message to model