lpcmanager

Parents e19831529c8c
Children 9cb1cbceeadc
Variable Options : fix parsing again (bug was because of saving corrupted data) and fix generator so that it is more compatible with legacy code.
--- a/OptionsParsing.py Thu Nov 12 13:50:22 2020 +0100
+++ b/OptionsParsing.py Fri Nov 13 10:45:29 2020 +0100
@@ -37,16 +37,17 @@
options += " static"
if opts.min is not None or opts.max is not None:
- options += ' min="' + str(opts.min if opts.min is not None else 0) + '"'
- options += ' max="' + str(opts.max if opts.min is not None else 0) + '"'
+ options += ' min=' + str(opts.min if opts.min is not None else 0)
+ options += ' max=' + str(opts.max if opts.min is not None else 0)
if opts.precision:
- options += ' precision="' + str(opts.precision) + '"'
+ options += ' precision=' + str(opts.precision)
for name in ['subgroup', 'unit', 'other', 'tags']:
content = opts[name]
if content is not None:
- options += ' ' + name + '="' + content + '"'
+ quoting = '"' if ' ' in content else ''
+ options += ' ' + name + '=' + quoting + content + quoting
return options
@@ -58,11 +59,6 @@
for key,dblquote_value,smpl_value in options:
- # sometime there is a dblquote at the end only of the value
- # because of old bug in previous version, fix for backward compatibility
- if len(smpl_value) > 0 and smpl_value[-1] == '"':
- smpl_value = smpl_value[:-1]
-
value = dblquote_value+smpl_value
if value == "":
if key == "onchange":