fix get_quoted_value

The previous version also stripped quotes that are part of the string
This commit is contained in:
Juergen Spitzmueller 2024-08-15 08:04:48 +02:00
parent c993485782
commit eb16ecf8b6

View File

@ -430,7 +430,14 @@ def get_quoted_value(lines, token, start=0, end=0, default="", delete=False):
val = get_value(lines, token, start, end, "", delete) val = get_value(lines, token, start, end, "", delete)
if not val: if not val:
return default return default
return val.strip('"') # remove only outer pair of quotes,
# hence do not use strip('"')
if val[:1] == '"':
val = val[1:]
if val[-1:] == '"':
val = val[:-1]
return val
bool_values = {"true": True, "1": True, "false": False, "0": False} bool_values = {"true": True, "1": True, "false": False, "0": False}