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.

59 lines
1.3 KiB

  1. from gooey.gui import formatters
  2. from gooey.gui.components.widgets import core
  3. from gooey.gui.components.widgets.bases import TextContainer, BaseChooser
  4. __ALL__ = [
  5. 'FileChooser',
  6. 'MultiFileChooser',
  7. 'FileSaver',
  8. 'DirChooser',
  9. 'MultiDirChooser',
  10. 'DateChooser',
  11. 'ColourChooser',
  12. 'TimeChooser'
  13. ]
  14. class FileChooser(BaseChooser):
  15. # todo: allow wildcard from argparse
  16. widget_class = core.FileChooser
  17. class MultiFileChooser(BaseChooser):
  18. # todo: allow wildcard from argparse
  19. widget_class = core.MultiFileChooser
  20. def formatOutput(self, metatdata, value):
  21. return formatters.multiFileChooser(metatdata, value)
  22. class FileSaver(BaseChooser):
  23. # todo: allow wildcard
  24. widget_class = core.FileSaver
  25. class DirChooser(BaseChooser):
  26. # todo: allow wildcard
  27. widget_class = core.DirChooser
  28. class MultiDirChooser(BaseChooser):
  29. # todo: allow wildcard
  30. widget_class = core.MultiDirChooser
  31. def formatOutput(self, metadata, value):
  32. return formatters.multiFileChooser(metadata, value)
  33. class DateChooser(BaseChooser):
  34. # todo: allow wildcard
  35. widget_class = core.DateChooser
  36. class ColourChooser(BaseChooser):
  37. widget_class = core.ColourChooser
  38. class TimeChooser(BaseChooser):
  39. widget_class = core.TimeChooser