lpcmanager

Fix options handling : real space resistant parsing. Values surrounded by double quotes in key-value pairs. Dialog stops messing with other columnns. OnChange code overriden in PythonFileCTNMixin so that content of options can add Alaram and StoredValue calls. + various rework in SetOption GetOption to avoid being poisoned by user input
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from OptionsParsing import ParseOptions
@staticmethod
def GetVarOnChangeContent(var):
opts = variable.getopts()
parsed_opts = re.findall(opt_parser,opts)
needs_onChange = ('onchange', '') in parsed_opts
if needs_onchange:
existing_onchanges = [onchange.strip() for onchange in var.getonchange().split(',')]
for unwanted in ["Alarm", "StoredValue"]:
existing_onchanges.remove[unwanted]
new_onchange = existing_onchange[:]
if ('Static', '') in parsed_opts :
new_onchange += ["StoredValue"]
elif ('Alarm', '') in parsed_opts :
new_onchange += ["Alarm"]
return ','.join(new_onchange)
return var.getonchange()