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.

62 lines
2.8 KiB

  1. '''
  2. Created on Dec 21, 2013
  3. __ __ _
  4. \ \ / / | |
  5. \ \ /\ / /__| | ___ ___ _ __ ___ ___
  6. \ \/ \/ / _ \ |/ __/ _ \| '_ ` _ \ / _ \
  7. \ /\ / __/ | (_| (_) | | | | | | __/
  8. ___\/__\/ \___|_|\___\___/|_| |_| |_|\___|
  9. |__ __|
  10. | | ___
  11. | |/ _ \
  12. | | (_) |
  13. _|_|\___/ _ _
  14. / ____| | | |
  15. | | __ ___ ___ ___ _ _| | |
  16. | | |_ |/ _ \ / _ \ / _ \ | | | | |
  17. | |__| | (_) | (_) | __/ |_| |_|_|
  18. \_____|\___/ \___/ \___|\__, (_|_)
  19. __/ |
  20. |___/
  21. @author: Chris
  22. '''
  23. from gooey import Gooey
  24. from gooey import GooeyParser
  25. from gooey.examples import display_message
  26. @Gooey(dump_build_config=True, program_name="Widget Demo")
  27. def main():
  28. desc = "Example application to show Gooey's various widgets"
  29. file_help_msg = "Name of the file you want to process"
  30. my_cool_parser = GooeyParser(description=desc)
  31. my_cool_parser.add_argument("FileChooser", help=file_help_msg, widget="FileChooser") # positional
  32. # my_cool_parser.add_argument("DirectoryChooser", help=file_help_msg, widget="DirChooser") # positional
  33. # my_cool_parser.add_argument("FileSaver", help=file_help_msg, widget="FileSaver") # positional
  34. my_cool_parser.add_argument("MultiFileSaver", help=file_help_msg, widget="MultiFileChooser") # positional
  35. # my_cool_parser.add_argument("directory", help="Directory to store output") # positional
  36. my_cool_parser.add_argument('-d', '--duration', default=2, type=int, help='Duration (in seconds) of the program output')
  37. my_cool_parser.add_argument('-s', '--cron-schedule', type=int, help='datetime when the cron should begin', widget='DateChooser')
  38. my_cool_parser.add_argument("-c", "--showtime", action="store_true", help="display the countdown timer")
  39. my_cool_parser.add_argument("-p", "--pause", action="store_true", help="Pause execution")
  40. my_cool_parser.add_argument('-v', '--verbose', action='count')
  41. my_cool_parser.add_argument("-o", "--overwrite", action="store_true", help="Overwrite output file (if present)")
  42. my_cool_parser.add_argument('-r', '--recursive', choices=['yes', 'no'], help='Recurse into subfolders')
  43. my_cool_parser.add_argument("-w", "--writelog", default="writelogs", help="Dump output to local file")
  44. my_cool_parser.add_argument("-e", "--error", action="store_true", help="Stop process on error (default: No)")
  45. verbosity = my_cool_parser.add_mutually_exclusive_group()
  46. verbosity.add_argument('-t', '--verbozze', dest='verbose', action="store_true", help="Show more details")
  47. verbosity.add_argument('-q', '--quiet', dest='quiet', action="store_true", help="Only output on error")
  48. args = my_cool_parser.parse_args()
  49. display_message()
  50. def here_is_smore():
  51. pass
  52. if __name__ == '__main__':
  53. main()