Commits
224 224 | url = f"{h}/{qs}" |
225 225 | casalog.post(f"Trying {url} ...", "NORMAL") |
226 226 | antpos = _query(url) |
227 227 | if antpos: |
228 228 | break |
229 229 | if not antpos: |
230 230 | raise RuntimeError("All URLs failed to return an antenna position list.") |
231 231 | if os.path.exists(outfile): |
232 232 | if overwrite: |
233 233 | if os.path.isdir(outfile): |
234 - | casalog.post(f"Removing existing directory {outfile}", "WARN") |
234 + | casalog.post( |
235 + | f"Removing existing directory {outfile} before writing new " |
236 + | "file of same name", |
237 + | "WARN" |
238 + | ) |
235 239 | shutil.rmtree(outfile) |
236 240 | else: |
237 - | casalog.post(f"Removing existing file {outfile}", "WARN") |
241 + | casalog.post( |
242 + | f"Removing existing file {outfile} before writing now file of " |
243 + | "same name", |
244 + | "WARN" |
245 + | ) |
238 246 | os.remove(outfile) |
239 247 | else: |
240 248 | raise RuntimeError( |
241 249 | "Logic Error: shouldn't have gotten to this point with overwrite=False" |
242 250 | ) |
243 251 | with open(outfile, "w") as f: |
244 252 | json.dump(antpos, f) |