@staticmethod
    def List(svc, basenode, route, start, end, session, has_perm):
        route_array = Digest.ParseRoute(route)
        parent = basenode.GetItem(session.GetUser(), route_array, has_perm)
        if (not parent):
            raise WrongArgs('route %s does not exist!' % route)
        if (not parent.IsDir()):
            raise WrongArgs('route %s does not point to a dir!' % route)
        items = basenode.GetRange(session.GetUser(), route_array, start, end, has_perm)
        result = {}
        result['parent'] = parent.GetInfoForUser(session.GetUser())
        result['count'] = len(items)
        result_list = []
        for item in items:
            result_list += [item.GetInfoForUser(session.GetUser())]
        result['items'] = result_list

        svc.writedata(json.dumps(result))
dataset/ETHPy150Open HenryHu/pybbs/digest.py/Digest.List/original