Returns a list of files that match the given pattern(s).
(self, filename)
| 173 | f.write(compatify(file_content)) |
| 174 | |
| 175 | def glob(self, filename): |
| 176 | """Returns a list of files that match the given pattern(s).""" |
| 177 | if isinstance(filename, str): |
| 178 | return [ |
| 179 | # Convert the filenames to string from bytes. |
| 180 | compat.as_str_any(matching_filename) |
| 181 | for matching_filename in py_glob.glob(compat.as_bytes(filename)) |
| 182 | ] |
| 183 | else: |
| 184 | return [ |
| 185 | # Convert the filenames to string from bytes. |
| 186 | compat.as_str_any(matching_filename) |
| 187 | for single_filename in filename |
| 188 | for matching_filename in py_glob.glob( |
| 189 | compat.as_bytes(single_filename) |
| 190 | ) |
| 191 | ] |
| 192 | |
| 193 | def isdir(self, dirname): |
| 194 | """Returns whether the path is a directory or not.""" |