sections.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:configmanager 作者: jbasko 项目源码 文件源码
def _parse_path(self, path=None):
        if not path:
            return ()

        if isinstance(path, six.string_types):
            separator = self.settings.str_path_separator
            clean_path = []
            for part in path.split(separator):
                if part.endswith('_') and keyword.iskeyword(part[:-1]):
                    clean_path.append(part[:-1])
                else:
                    clean_path.append(part)
            clean_path = tuple(clean_path)
        else:
            clean_path = path

        # This is to raise NotFound in case path doesn't exist and to have it
        # handled by not_found hook callbacks.
        self._get_by_key(path)

        return clean_path
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号