(path, extension=None)
| 65 | |
| 66 | @staticmethod |
| 67 | def list_files(path, extension=None): |
| 68 | if extension is None: |
| 69 | extension = ['.*'] |
| 70 | zip_path, folder_path = ZipReader.split_zip_style_path(path) |
| 71 | |
| 72 | zfile = ZipReader.get_zipfile(zip_path) |
| 73 | file_lists = [] |
| 74 | for file_foler_name in zfile.namelist(): |
| 75 | file_foler_name = str.strip(file_foler_name, '/') |
| 76 | if file_foler_name.startswith(folder_path) and \ |
| 77 | str.lower(os.path.splitext(file_foler_name)[-1]) in extension: |
| 78 | if len(folder_path) == 0: |
| 79 | file_lists.append(file_foler_name) |
| 80 | else: |
| 81 | file_lists.append(file_foler_name[len(folder_path) + 1:]) |
| 82 | |
| 83 | return file_lists |
| 84 | |
| 85 | @staticmethod |
| 86 | def read(path): |
nothing calls this directly
no test coverage detected