Fix the bin path preferences.

This commit is contained in:
Khushboo Vashi 2017-03-27 12:25:59 -04:00 committed by Dave Page
parent 757500c478
commit 633d2ad28c

View File

@ -45,27 +45,23 @@ class ServerType(object):
@classmethod @classmethod
def register_preferences(cls): def register_preferences(cls):
# Introduce inner function as we need to register the preferences after paths = Preferences('paths', _('Paths'))
# we get the user language and its translation.
def register_paths():
paths = Preferences('paths', _('Paths'))
for key in cls.registry: for key in cls.registry:
st = cls.registry[key] st = cls.registry[key]
default_path = config.DEFAULT_BINARY_PATHS[st.stype] or "" default_path = config.DEFAULT_BINARY_PATHS[st.stype] or ""
st.utility_path = paths.register( st.utility_path = paths.register(
'bin_paths', st.stype + '_bin_dir', 'bin_paths', st.stype + '_bin_dir',
_("{0} Binary Path").format(st.desc), _("{0} Binary Path").format(st.desc),
'text', default_path, category_label=_('Binary paths'), 'text', default_path, category_label=_('Binary paths'),
help_str=_( help_str=_(
"Path to the directory containing the {0} utility" "Path to the directory containing the {0} utility"
" programs (pg_dump, pg_restore etc).".format( " programs (pg_dump, pg_restore etc).".format(
st.desc st.desc
)
) )
) )
return register_paths )
@property @property
def priority(self): def priority(self):