entropy.const: const_read_equo_settings removed, parser is being moved

to SystemSettings
This commit is contained in:
Fabio Erculiani
2009-04-05 13:51:17 +02:00
parent 138e41bcf1
commit b935582f6d
-76
View File
@@ -849,82 +849,6 @@ def const_read_entropy_release():
myrev = rev_f.readline().strip()
etpConst['entropyversion'] = myrev
def const_read_equo_settings():
"""
XXX: will be probably moved away from here in future.
Setup Equo settings reading them from equo config file
specified in etpConst['clientconf'], by default (client.conf)
@return None
"""
equo_conf = etpConst['clientconf']
if not (os.path.isfile(equo_conf) and os.access(equo_conf, os.R_OK)):
return
equo_f = open(equo_conf,"r")
equoconf = [x.strip() for x in equo_f.readlines() if \
x.strip() and not x.strip().startswith("#")]
equo_f.close()
for line in equoconf:
if line.startswith("loglevel|") and \
(len(line.split("loglevel|")) == 2):
loglevel = line.split("loglevel|")[1]
try:
loglevel = int(loglevel)
except (ValueError,):
pass
if (loglevel > -1) and (loglevel < 3):
etpConst['equologlevel'] = loglevel
elif line.startswith("filesbackup|") and \
(len(line.split("|")) == 2):
compatopt = line.split("|")[1].strip()
if compatopt.lower() in ("disable", "disabled",
"false", "0", "no",):
etpConst['filesbackup'] = False
elif line.startswith("ignore-spm-downgrades|") and \
(len(line.split("|")) == 2):
compatopt = line.split("|")[1].strip()
if compatopt.lower() in ("enable", "enabled", "true", "1", "yes"):
etpConst['spm']['ignore-spm-downgrades'] = True
elif line.startswith("collisionprotect|") and \
(len(line.split("|")) == 2):
collopt = line.split("|")[1].strip()
if collopt.lower() in ("0", "1", "2",):
etpConst['collisionprotect'] = int(collopt)
elif line.startswith("configprotect|") and \
(len(line.split("|")) == 2):
configprotect = line.split("|")[1].strip()
for myprot in configprotect.split():
etpConst['configprotect'].append(
unicode(myprot,'raw_unicode_escape'))
elif line.startswith("configprotectmask|") and \
(len(line.split("|")) == 2):
configprotect = line.split("|")[1].strip()
for myprot in configprotect.split():
etpConst['configprotectmask'].append(
unicode(myprot,'raw_unicode_escape'))
elif line.startswith("configprotectskip|") and \
(len(line.split("|")) == 2):
configprotect = line.split("|")[1].strip()
for myprot in configprotect.split():
etpConst['configprotectskip'].append(
etpConst['systemroot']+unicode(myprot,'raw_unicode_escape'))
def const_setup_entropy_pid(just_read = False):