diff --git a/web/config.py b/web/config.py index 6598b9a97..00fc5e447 100644 --- a/web/config.py +++ b/web/config.py @@ -263,6 +263,21 @@ STORAGE_DIR = os.path.join( 'storage' ) +########################################################################## +# Default locations for binary utilities (pg_dump, pg_restore etc) +# +# These are intentionally left empty in the main config file, but are +# expected to be overridden by packagers in config_distro.py. +# +# A default location can be specified for each database driver ID, in +# a dictionary. A relative (to the working directory for the package) +# location may be specified, or absolute. +########################################################################## +DEFAULT_BINARY_PATHS = { + "pg": "", + "ppas": "" +} + ########################################################################## # Test settings - used primarily by the regression suite, not for users ########################################################################## diff --git a/web/pgadmin/browser/server_groups/servers/types.py b/web/pgadmin/browser/server_groups/servers/types.py index 01f49a5a1..9488e2032 100644 --- a/web/pgadmin/browser/server_groups/servers/types.py +++ b/web/pgadmin/browser/server_groups/servers/types.py @@ -13,6 +13,7 @@ from flask import render_template from flask_babel import gettext as _ from pgadmin.utils.preferences import Preferences +import config class ServerType(object): """ @@ -48,11 +49,12 @@ class ServerType(object): for key in cls.registry: st = cls.registry[key] + default_path = config.DEFAULT_BINARY_PATHS[st.stype] or "" st.utility_path = paths.register( 'bin_paths', st.stype + '_bin_dir', _("{0} Binary Path").format(st.desc), - 'text', "", category_label=_('Binary paths'), + 'text', default_path, category_label=_('Binary paths'), help_str=_( "Path to the directory containing the {0} utility programs (pg_dump, pg_restore etc).".format( st.desc