Assign style if a str is passed

Otherwise assign self.help as passed.

Co-authored-by: Dan Bungert <danielbungert@gmail.com>
This commit is contained in:
Carlos Nihelton 2022-08-29 13:55:07 -03:00 committed by GitHub
parent eb722fef0b
commit 6d51deedb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -305,10 +305,10 @@ class FormField(abc.ABC):
def __init__(self, caption=None, help=None):
self.caption = caption
# Allows styling at instantiation
if help is None or isinstance(help, tuple) or help is NO_HELP:
self.help = help
else:
if isinstance(help, str):
self.help = ('info_minor', help)
else:
self.help = help
self.index = FormField.next_index
FormField.next_index += 1