Skip to content

Commit

Permalink
[Optionable][Fixed] How we extract the choices
Browse files Browse the repository at this point in the history
- We must strip spaces
- Affected some options of panelize.page.type
  • Loading branch information
set-soft committed Jul 8, 2024
1 parent 9eb341f commit dc967b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kibot/optionable.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _check_str(key, val, doc, valid):
# If the docstring specifies the allowed values in the form [v1,v2...] enforce it
m = Optionable._str_values_re.search(doc)
if m:
vals = m.group(1).split(',')
vals = [v.strip() for v in m.group(1).split(',')]
if val not in vals and '*' not in vals:
wrong = True
if ',' in val and 'list(string)' in valid:
Expand Down Expand Up @@ -169,7 +169,7 @@ def get_valid_types(self, doc, skip_extra=False):
if v == 'string' or v == 'list(string)':
m = Optionable._str_values_re.search(doc)
if m:
validation.append(m.group(1).split(','))
validation.append([v.strip() for v in m.group(1).split(',')])
continue
validation.append(None)
return valid, validation, def_val, real_help
Expand Down

0 comments on commit dc967b4

Please sign in to comment.