MCPcopy
hub / github.com/DingXiaoH/RepVGG / list_folder

Method list_folder

data/zipreader.py:42–57  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

40
41 @staticmethod
42 def list_folder(path):
43 zip_path, folder_path = ZipReader.split_zip_style_path(path)
44
45 zfile = ZipReader.get_zipfile(zip_path)
46 folder_list = []
47 for file_foler_name in zfile.namelist():
48 file_foler_name = str.strip(file_foler_name, '/')
49 if file_foler_name.startswith(folder_path) and \
50 len(os.path.splitext(file_foler_name)[-1]) == 0 and \
51 file_foler_name != folder_path:
52 if len(folder_path) == 0:
53 folder_list.append(file_foler_name)
54 else:
55 folder_list.append(file_foler_name[len(folder_path) + 1:])
56
57 return folder_list
58
59 @staticmethod
60 def list_files(path, extension=None):

Callers

nothing calls this directly

Calls 2

split_zip_style_pathMethod · 0.80
get_zipfileMethod · 0.80

Tested by

no test coverage detected