[entropy.const] drop etpConst['clientconf']
This commit is contained in:
@@ -48,6 +48,16 @@ class ClientSystemSettingsPlugin(SystemSettingsPlugin):
|
||||
self.__package_repositories = []
|
||||
self.__package_repositories_meta = {}
|
||||
|
||||
@staticmethod
|
||||
def client_conf_path():
|
||||
"""
|
||||
Return current client.conf path, this takes into account the current
|
||||
configuration files directory path (which is affected by "root" path
|
||||
changes [default: /])
|
||||
"""
|
||||
# path to /etc/entropy/server.conf (usually, depends on systemroot)
|
||||
return os.path.join(etpConst['confdir'], "client.conf")
|
||||
|
||||
def _add_package_repository(self, repository_id, repository_metadata):
|
||||
"""
|
||||
Internal method, used by Entropy Client. Add a package repository
|
||||
@@ -526,7 +536,7 @@ class ClientSystemSettingsPlugin(SystemSettingsPlugin):
|
||||
'edelta_support': False, # disabled by default
|
||||
}
|
||||
|
||||
cli_conf = etpConst['clientconf']
|
||||
cli_conf = ClientSystemSettingsPlugin.client_conf_path()
|
||||
root = etpConst['systemroot']
|
||||
try:
|
||||
mtime = os.path.getmtime(cli_conf)
|
||||
|
||||
@@ -244,8 +244,7 @@ def const_default_settings(rootdir):
|
||||
'confsetsdirname': default_etp_setsdirname,
|
||||
# repositories.conf file
|
||||
'repositoriesconf': default_etp_confdir+"/repositories.conf",
|
||||
# client.conf file (generic entropy client side settings)
|
||||
'clientconf': default_etp_confdir+"/client.conf",
|
||||
|
||||
# used by entropy.spm to build pkgs relative URL metadata ("download",
|
||||
# returned by EntropyRepository.retrieveDownloadURL())
|
||||
'packagesrelativepath_basedir': "packages",
|
||||
|
||||
+6
-3
@@ -1625,11 +1625,14 @@ class ErrorReportInterface:
|
||||
with open(etpConst['repositoriesconf'], "r") as rc_f:
|
||||
self.params['repositories.conf'] = rc_f.read()
|
||||
|
||||
from entropy.client.interfaces.client import ClientSystemSettingsPlugin
|
||||
client_conf = ClientSystemSettingsPlugin.client_conf_path()
|
||||
self.params['client.conf'] = "---NA---"
|
||||
if os.access(etpConst['clientconf'], os.R_OK) and \
|
||||
os.path.isfile(etpConst['clientconf']):
|
||||
with open(etpConst['clientconf'], "r") as rc_f:
|
||||
try:
|
||||
with open(client_conf, "r") as rc_f:
|
||||
self.params['client.conf'] = rc_f.read()
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
self.generated = True
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ from entropy.output import print_generic
|
||||
from entropy.db.exceptions import ProgrammingError, OperationalError
|
||||
from entropy.core.settings.base import SystemSettings
|
||||
from entropy.services.client import WebService
|
||||
from entropy.client.interfaces.client import ClientSystemSettingsPlugin
|
||||
|
||||
# Sulfur Imports
|
||||
import gtk, gobject
|
||||
@@ -1220,6 +1221,7 @@ class SulfurApplication(Controller, SulfurApplicationEventsMixin):
|
||||
sys_settings_plg_id = \
|
||||
etpConst['system_settings_plugins_ids']['client_plugin']
|
||||
conf_files = self._settings.get_setting_files_data()
|
||||
client_conf = ClientSystemSettingsPlugin.client_conf_path()
|
||||
self._preferences = {
|
||||
conf_files['system']: [
|
||||
(
|
||||
@@ -1268,7 +1270,7 @@ class SulfurApplication(Controller, SulfurApplicationEventsMixin):
|
||||
self.ui.niceSpinSelect.get_value_as_int,
|
||||
)
|
||||
],
|
||||
etpConst['clientconf']: [
|
||||
client_conf: [
|
||||
(
|
||||
'collision-protect',
|
||||
self._settings[sys_settings_plg_id]['misc']['collisionprotect'],
|
||||
|
||||
Reference in New Issue
Block a user