MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / does_utility_exist

Function does_utility_exist

web/pgadmin/utils/__init__.py:337–358  ·  view source on GitHub ↗

This function will check the utility file exists on given path. :return:

(file)

Source from the content-addressed store, hash-verified

335
336
337def 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
361def get_server(sid, only_owned=False):

Callers 15

refresh_dataMethod · 0.90
check_utility_existsMethod · 0.90
use_restore_utilityFunction · 0.90
use_sql_utilityFunction · 0.90
check_utility_existsFunction · 0.90
setUpMethod · 0.90
setUpMethod · 0.90
create_maintenance_jobFunction · 0.90
check_utility_existsFunction · 0.90
setUpMethod · 0.90
setUpMethod · 0.90

Calls 2

gettextFunction · 0.85
existsMethod · 0.45

Tested by 11

setUpMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72