'\'Pops\' off the next segment of PATH_INFO, returns the popped
segment. Do NOT push it onto SCRIPT_NAME.'

def _pop_path_info(self, req):

    path = req.path_info
    if (not path):
        return None
    while path.startswith('/'):
        path = path[1:]
    idx = path.find('/')
    if (idx == (-1)):
        idx = len(path)
    r = path[:idx]
    req.path_info = path[idx:]
    return r
