Returns a list of files in the [Downloads Folder]. Depending on settings, that dir may have other files. If regex is provided, uses that to filter results.
(self, regex=None, browser=False)
| 8211 | return os.path.join(os.path.expanduser("~"), "downloads") |
| 8212 | |
| 8213 | def get_downloaded_files(self, regex=None, browser=False): |
| 8214 | """Returns a list of files in the [Downloads Folder]. |
| 8215 | Depending on settings, that dir may have other files. |
| 8216 | If regex is provided, uses that to filter results.""" |
| 8217 | df = self.get_downloads_folder() |
| 8218 | if browser: |
| 8219 | df = self.get_browser_downloads_folder() |
| 8220 | if not os.path.exists(df): |
| 8221 | return [] |
| 8222 | elif regex: |
| 8223 | return [fn for fn in os.listdir(df) if re.match(regex, fn)] |
| 8224 | else: |
| 8225 | return os.listdir(df) |
| 8226 | |
| 8227 | def get_path_of_downloaded_file(self, file, browser=False): |
| 8228 | """Returns the full OS path of the downloaded file.""" |
nothing calls this directly
no test coverage detected