def get_dir_entrys_by_id(request, dir_id): dentrys = [] try: dirs = seafserv_threaded_rpc.list_dir(dir_id) except SearpcError, e: return api_error(request, "416")
def get_dir_entrys_by_id(request, repo_id, path, dir_id): try: dirs = seafserv_threaded_rpc.list_dir(dir_id) except SearpcError, e: return api_error(HTTP_520_OPERATION_FAILED, "Failed to list dir.")
""" List wiki pages in group. """ repo = find_wiki_repo(request, group) if not repo: return render_error(request, _('Wiki is not found.')) try: dir_id = seafserv_threaded_rpc.get_dir_id_by_path(repo.id, '/') except SearpcError, e: dir_id = None if not dir_id: return render_error(request, _('Wiki root path is missing.')) try: dirs = seafserv_threaded_rpc.list_dir(dir_id) except SearpcError, e: return render_error(request, _('Failed to list wiki directories.')) pages = [] for e in dirs: if stat.S_ISDIR(e.mode): continue # skip directories name, ext = os.path.splitext(e.obj_name) if ext == '.md': pages.append(name) is_staff = True if check_group_staff(group.id, request.user) else False return render_to_response("group/group_wiki_pages.html", { "group": group,