(path, warn_existing=False, overwrite=False)
| 195 | |
| 196 | |
| 197 | def has_stuff(path, warn_existing=False, overwrite=False): |
| 198 | if os.path.exists(path) and (dir_has_stuff(path) or file_has_stuff(path)): |
| 199 | if warn_existing: |
| 200 | print('%s exists, do you want to re-download and overwrite the existing files (y/n)?' % path, end=' ') |
| 201 | overwrite = input() |
| 202 | if 'n' in overwrite.lower(): |
| 203 | print('USING EXISTING %s - Try rerunning and overwriting if you run into problems.' % path) |
| 204 | return True |
| 205 | elif not overwrite: |
| 206 | return True |
| 207 | return False |
| 208 | |
| 209 | |
| 210 | def ensure_executable(path): |
no test coverage detected