MCPcopy Create free account
hub / github.com/SwinTransformer/Transformer-SSL / list_folder

Method list_folder

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

Source from the content-addressed store, hash-verified

47
48 @staticmethod
49 def list_folder(path):
50 zip_path, folder_path = ZipReader.split_zip_style_path(path)
51
52 zfile = ZipReader.get_zipfile(zip_path)
53 folder_list = []
54 for file_foler_name in zfile.namelist():
55 file_foler_name = str.strip(file_foler_name, '/')
56 if file_foler_name.startswith(folder_path) and \
57 len(os.path.splitext(file_foler_name)[-1]) == 0 and \
58 file_foler_name != folder_path:
59 if len(folder_path) == 0:
60 folder_list.append(file_foler_name)
61 else:
62 folder_list.append(file_foler_name[len(folder_path) + 1:])
63
64 return folder_list
65
66 @staticmethod
67 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