You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.8 KiB

2 years ago
  1. """
  2. Parser containing all Gooey widgets.
  3. """
  4. from gooey import GooeyParser
  5. parser = GooeyParser()
  6. parser.add_argument('--textfield', default=2, widget="TextField")
  7. parser.add_argument('--textarea', default="oneline twoline", widget='Textarea')
  8. parser.add_argument('--password', default="hunter42", widget='PasswordField')
  9. parser.add_argument('--commandfield', default="cmdr", widget='CommandField')
  10. parser.add_argument('--dropdown', choices=["one", "two"], default="two", widget='Dropdown')
  11. parser.add_argument(
  12. '--listboxie',
  13. nargs='+',
  14. default=['three', 'four'],
  15. choices=['one', 'two', 'three', 'four'],
  16. widget='Listbox',
  17. gooey_options={
  18. 'height': 300,
  19. 'validate': '',
  20. 'heading_color': '',
  21. 'text_color': '',
  22. 'hide_heading': True,
  23. 'hide_text': True,
  24. }
  25. )
  26. parser.add_argument('--counter', default=3, action='count', widget='Counter')
  27. parser.add_argument("--overwrite1", action="store_true", default=True, widget='CheckBox')
  28. parser.add_argument("--overwrite2", action="store_true", default=True, widget='BlockCheckbox')
  29. verbosity = parser.add_mutually_exclusive_group(
  30. gooey_options={
  31. 'initial_selection': 0
  32. }
  33. )
  34. verbosity.add_argument('--mutexone', default='hello')
  35. parser.add_argument('--mutextwo', default='3', widget='Slider')
  36. parser.add_argument('--mutextwo', default='1', widget='IntegerField')
  37. parser.add_argument('--mutextwo', default='4', widget='DecimalField')
  38. parser.add_argument("--filechooser", default="fc-value", widget='FileChooser')
  39. parser.add_argument("--filesaver", default="fs-value", widget='FileSaver')
  40. parser.add_argument("--dirchooser", default="dc-value", widget='DirChooser')
  41. parser.add_argument("--datechooser", default="2015-01-01", widget='DateChooser')
  42. parser.add_argument("--colourchooser", default="#000000", widget='ColourChooser')