huskar_api/models/tree/common.py
def parse(cls, path, base_path=''):
        """Parses a string path and creates a structured path.

        :param path: The path of a ZooKeeper node.
        :param base_path: The base path such as ``/huskar``.
        :returns Path: A path tuple. For unknown path, none path will be
                       returned.
        """
        base_path = '{0}/'.format(base_path.rstrip('/'))
        if not path.startswith(base_path):
            return cls.make()
        components = path[len(base_path):].rstrip('/').split('/')
        if components == [''] or len(components) > 4:
            return cls.make()
        return cls.make(*components)
Parses a string path and creates a structured path.

        :param path: The path of a ZooKeeper node.
        :param base_path: The base path such as ``/huskar``.
        :returns Path: A path tuple. For unknown path, none path will be
                       returned.
        
Parses a string path and creates a structured path.
Parses a string path and creates a structured path .
def parse(cls, path, base_path=''):
        base_path = '{0}/'.format(base_path.rstrip('/'))
        if not path.startswith(base_path):
            return cls.make()
        components = path[len(base_path):].rstrip('/').split('/')
        if components == [''] or len(components) > 4:
            return cls.make()
        return cls.make(*components)
def parse ( cls , path , base_path = '' ) : base_path = '{0}/' . format ( base_path . rstrip ( '/' ) ) if not path . startswith ( base_path ) : return cls . make ( ) components = path [ len ( base_path ) : ] . rstrip ( '/' ) . split ( '/' ) if components == [ '' ] or len ( components ) > 4 : return cls . make ( ) return cls . make ( * components )
Parses a string path and creates a structured path.
Parses a string path and creates a structured path .
"""Parses a string path and creates a structured path.

        :param path: The path of a ZooKeeper node.
        :param base_path: The base path such as ``/huskar``.
        :returns Path: A path tuple. For unknown path, none path will be
                       returned.
        """
A path tuple. For unknown path, none path will be
returned.
A path tuple . For unknown path none path will be returned .
Path
cls
path
The path of a ZooKeeper node.
The path of a ZooKeeper node .
base_path
The base path such as ``/huskar``.
The base path such as ` ` / huskar ` ` .