# Path: nbx/nbmanager/dispatch.py
# class DispatcherMixin(object):
#     """
#     This Mixin class handles the dispatching of Contents API calls to
#     model type specific methods.
# 
#     i.e. get_model for a directory would call get_model_dir
#     """
# 
#     def save(self, model, path=''):
#         return save(self, model, path,
#                              dispatcher=self.dispatch_method.__func__)
# 
#     def update(self, model, path=''):
#         return update(self, model, path,
#                              dispatcher=self.dispatch_method.__func__)
# 
#     def delete(self, path=''):
#         return delete(self, path,
#                              dispatcher=self.dispatch_method.__func__)
# 
#     def get(self, path='', content=True, **kwargs):
#         return get(self, path, content,
#                                   dispatcher=self.dispatch_method.__func__, **kwargs)
# 
#     def dispatch_method(self, hook, model_type, *args, **kwargs):
#         return dispatch_method(self, hook, model_type, *args, **kwargs)


import datetime
import os.path
from notebook.services.contents.manager import ContentsManager
from notebook.utils import url_path_join
from .dispatch import DispatcherMixin



def _fullpath(name, path):
    fullpath = url_path_join(path, name)
    return fullpath

def _path_split(path):
    bits = path.rsplit('/', 1)
    path = ''
    name = bits.pop()
    if bits:
        path = bits[0]
    return name, path


# Path: nbx/nbmanager/dispatch.py
# class DispatcherMixin(object):
#     """
#     This Mixin class handles the dispatching of Contents API calls to
#     model type specific methods.
# 
#     i.e. get_model for a directory would call get_model_dir
#     """
# 
#     def save(self, model, path=''):
#         return save(self, model, path,
#                              dispatcher=self.dispatch_method.__func__)
# 
#     def update(self, model, path=''):
#         return update(self, model, path,
#                              dispatcher=self.dispatch_method.__func__)
# 
#     def delete(self, path=''):
#         return delete(self, path,
#                              dispatcher=self.dispatch_method.__func__)
# 
#     def get(self, path='', content=True, **kwargs):
#         return get(self, path, content,
#                                   dispatcher=self.dispatch_method.__func__, **kwargs)
# 
#     def dispatch_method(self, hook, model_type, *args, **kwargs):
#         return dispatch_method(self, hook, model_type, *args, **kwargs)


# Path: nbx/nbmanager/nbxmanager.py
import datetime
import os.path
from notebook.services.contents.manager import ContentsManager
from notebook.utils import url_path_join
from .dispatch import DispatcherMixin




def _fullpath(name, path):
    fullpath = url_path_join(path, name)
    return fullpath

def _path_split(path):
    bits = path.rsplit('/', 1)
    path = ''
    name = bits.pop()
    if bits:
        path = bits[0]
    return name, path


class NBXContentsManager(DispatcherMixin, ContentsManager):