Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from s3contents.genericfs import GenericFSError, NoSuchFile
from s3contents.ipycompat import (
ContentsManager,
GenericFileCheckpoints,
HasTraits,
Unicode,
from_dict,
reads,
)
DUMMY_CREATED_DATE = datetime.datetime.fromtimestamp(86400)
NBFORMAT_VERSION = 4
class GenericContentsManager(ContentsManager, HasTraits):
# This makes the checkpoints get saved on this directory
root_dir = Unicode("./", config=True)
def __init__(self, *args, **kwargs):
super(GenericContentsManager, self).__init__(*args, **kwargs)
self._fs = None
def get_fs(self):
return self._fs
fs = property(get_fs)
def _checkpoints_class_default(self):
return GenericFileCheckpoints