This function will check the utility file exists on given path. :return:
(file)
| 335 | |
| 336 | |
| 337 | def does_utility_exist(file): |
| 338 | """ |
| 339 | This function will check the utility file exists on given path. |
| 340 | :return: |
| 341 | """ |
| 342 | error_msg = None |
| 343 | |
| 344 | if file is None: |
| 345 | error_msg = gettext("Utility file not found. Please correct the Binary" |
| 346 | " Path in the Preferences") |
| 347 | return error_msg |
| 348 | |
| 349 | if Path(config.STORAGE_DIR) == Path(file) or \ |
| 350 | Path(config.STORAGE_DIR) in Path(file).parents: |
| 351 | error_msg = gettext("Please correct the Binary Path in the " |
| 352 | "Preferences. pgAdmin storage directory cannot " |
| 353 | "be a utility binary directory.") |
| 354 | |
| 355 | if not os.path.exists(file): |
| 356 | error_msg = gettext("'%s' file not found. Please correct the Binary" |
| 357 | " Path in the Preferences" % file) |
| 358 | return error_msg |
| 359 | |
| 360 | |
| 361 | def get_server(sid, only_owned=False): |