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
评论列表
文章目录