|
|
|
@ -62,7 +62,7 @@ class VariableClVariableData(TableVariable):
|
|
|
|
|
|
|
|
|
|
def fix_cmdline_params(fullname, location, v):
|
|
|
|
|
if location.startswith("="):
|
|
|
|
|
if re.match("^.*?:[a-z]+$", location):
|
|
|
|
|
if re.match(r"^.*?:[a-z]+$", location):
|
|
|
|
|
location = location.rpartition(':')[2]
|
|
|
|
|
else:
|
|
|
|
|
location = "system"
|
|
|
|
@ -73,7 +73,7 @@ class VariableClVariableData(TableVariable):
|
|
|
|
|
prevval = self.Get(fullname)
|
|
|
|
|
typevar = self.parent.getInfo(fullname).type
|
|
|
|
|
val = self.parent.unserialize(typevar, v)
|
|
|
|
|
prevval.extend(filter(lambda x: x not in prevval, val))
|
|
|
|
|
prevval.extend(list(filter(lambda x: x not in prevval, val)))
|
|
|
|
|
else:
|
|
|
|
|
return fullname, location, v
|
|
|
|
|
|
|
|
|
@ -162,8 +162,8 @@ class VariableClVariableType(VarHelper, ReadonlyVariable):
|
|
|
|
|
return "%s%s" % (varobj.mode, varobj.getCharType())
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
return map(self.fill_type,
|
|
|
|
|
self.Get('cl_variable_fullname'))
|
|
|
|
|
return list(map(self.fill_type,
|
|
|
|
|
self.Get('cl_variable_fullname')))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClVariableValue(VarHelper, Variable):
|
|
|
|
@ -203,8 +203,8 @@ class VariableClVariableValue(VarHelper, Variable):
|
|
|
|
|
return ""
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
return map(self.fill_var,
|
|
|
|
|
self.Get('cl_variable_fullname'))
|
|
|
|
|
return list(map(self.fill_var,
|
|
|
|
|
self.Get('cl_variable_fullname')))
|
|
|
|
|
|
|
|
|
|
def check(self, value):
|
|
|
|
|
checklist = []
|
|
|
|
@ -238,15 +238,15 @@ class VariableClVariableLocation(VarHelper, Variable):
|
|
|
|
|
self.label = _("Location")
|
|
|
|
|
|
|
|
|
|
def choice(self):
|
|
|
|
|
return [("", "Default")] + map(lambda x: (x, x),
|
|
|
|
|
self.Get('cl_env_location'))
|
|
|
|
|
return [("", "Default")] + list(map(lambda x: (x, x),
|
|
|
|
|
self.Get('cl_env_location')))
|
|
|
|
|
|
|
|
|
|
def fill_write(self, var):
|
|
|
|
|
return self.parent.isFromIni(var)
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
return map(lambda x: self.parent.isFromIni(x),
|
|
|
|
|
self.Get('cl_variable_fullname'))
|
|
|
|
|
return list(map(lambda x: self.parent.isFromIni(x),
|
|
|
|
|
self.Get('cl_variable_fullname')))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClVariableFilter(VarHelper, Variable):
|
|
|
|
@ -294,7 +294,7 @@ class VariableClVariableShow(VarHelper, Variable):
|
|
|
|
|
self.help = _("show the variable value")
|
|
|
|
|
|
|
|
|
|
def raiseWrongChoice(self, name, choice_val, val, error):
|
|
|
|
|
re_index = re.compile("((?:\w+\.)?(\w+))(?:\[(\d+)\])?")
|
|
|
|
|
re_index = re.compile(r"((?:\w+\.)?(\w+))(?:\[(\d+)\])?")
|
|
|
|
|
varname = re_index.search(val)
|
|
|
|
|
if varname and not varname.group(1) in choice_val:
|
|
|
|
|
raise VariableError(_("Variable %s not found") % val)
|
|
|
|
|