Merge branch 'master' of git.calculate.ru:/calculate-lib

Conflicts:
	pym/cl_opt.py
develop
Самоукин Алексей 14 years ago
commit ba90501a21

@ -805,13 +805,13 @@ class glob_attr:
config config file name
name param name
"""
reMatch = re.compile("^%s\s*=\s*\"?(.*)\"?$"%name, re.I)
reMatch = re.compile("^%s\s*=\s*\"?(.*?)\"?$"%name, re.I)
try:
if os.path.exists(config):
for line in open(config,"r").readlines():
match = reMatch.match(line)
if match:
return group().strip()
return match.groups()[0].strip()
except:
pass
return False

@ -197,6 +197,9 @@ class clLocale:
def isLangExists(self,lang):
return lang in self.lang.keys()
def isValueInFieldExists(self,field,value):
return value in map(lambda x:self.lang[x][field],self.lang.keys())
def getFields(self,field):
return [ l[1][field] for l in self.lang.items() ]
@ -569,6 +572,9 @@ class fillVars(glob_attr):
elif os.environ.has_key("LANG"):
return os.environ["LANG"]
else:
localeVal = self.getValueFromConfig('/etc/env.d/02locale','LANG')
if locale.isValueInFieldExists('locale',localeVal):
return localeVal
return locale.getFieldByLang("locale","default")
def get_os_locale_lang(self):
@ -724,7 +730,7 @@ class fillVars(glob_attr):
if matchSect:
resDriver = re.search(r'Driver\s*"([^"]+)"',
matchSect.group(0),re.S)
if resDriver:
if resDriver and resDriver.group(1) in list_avialable_drivers:
return resDriver.group(1)
defaultDriver = {
'vesa':'vesa',

Loading…
Cancel
Save