Browse Source

Copy widgets and their configuration from parent parsers. Resolves #608

pull/616/head
Stephen Tomkinson 4 years ago
committed by Chris
parent
commit
ebaa45a7ec
1 changed files with 5 additions and 0 deletions
  1. 5
      gooey/python_bindings/gooey_parser.py

5
gooey/python_bindings/gooey_parser.py

@ -68,6 +68,11 @@ class GooeyParser(object):
self.__dict__['parser'] = ArgumentParser(**kwargs) self.__dict__['parser'] = ArgumentParser(**kwargs)
self.widgets = {} self.widgets = {}
self.options = {} self.options = {}
if 'parents' in kwargs:
for parent in kwargs['parents']:
if isinstance(parent, self.__class__):
self.widgets.update(parent.widgets)
self.options.update(parent.options)
@property @property
def _mutually_exclusive_groups(self): def _mutually_exclusive_groups(self):

Loading…
Cancel
Save