(tmp_dir, mode="", ext="")
| 150 | |
| 151 | |
| 152 | def get_temp_path(tmp_dir, mode="", ext=""): |
| 153 | file_path = next(tempfile._get_candidate_names()) + mode + ext |
| 154 | if not os.path.exists(tmp_dir): |
| 155 | os.makedirs(tmp_dir) |
| 156 | file_path = os.path.join(tmp_dir, file_path) |
| 157 | return file_path |
| 158 | |
| 159 | |
| 160 | def swp_extension(file, ext): |