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
3.1 KiB

  1. '''
  2. Created on Dec 21, 2013
  3. @author: Chris
  4. '''
  5. import sys
  6. import hashlib
  7. from time import time as _time
  8. from time import sleep as _sleep
  9. from gooey import Gooey
  10. from gooey import GooeyParser
  11. from gooey.examples import display_message
  12. @Gooey(language='russian', program_name=u'\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b')
  13. def arbitrary_function():
  14. desc = u"\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u002c \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c "
  15. file_help_msg = u"\u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430\u002c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c"
  16. my_cool_parser = GooeyParser(description=desc)
  17. my_cool_parser.add_argument(u"\u0432\u044b\u0431\u043e\u0440\u0430\u0444\u0430\u0439\u043b\u043e\u0432", help=file_help_msg, widget="FileChooser") # positional
  18. my_cool_parser.add_argument(u"\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u043e\u0432 \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c", help=file_help_msg, widget="MultiFileChooser") # positional
  19. my_cool_parser.add_argument('-d', u'--\u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c', default=2, type=int, help=u'\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0028 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445 \u0029 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b')
  20. my_cool_parser.add_argument('-s', u'--\u043a\u0440\u043e\u043d \u002d \u0433\u0440\u0430\u0444\u0438\u043a', type=int, help=u'\u0414\u0430\u0442\u0430', widget='DateChooser')
  21. my_cool_parser.add_argument("-c", "--showtime", action="store_true", help="display the countdown timer")
  22. my_cool_parser.add_argument("-p", "--pause", action="store_true", help="Pause execution")
  23. my_cool_parser.add_argument('-v', '--verbose', action='count')
  24. my_cool_parser.add_argument("-o", "--overwrite", action="store_true", help="Overwrite output file (if present)")
  25. my_cool_parser.add_argument('-r', '--recursive', choices=['yes', 'no'], help='Recurse into subfolders')
  26. my_cool_parser.add_argument("-w", "--writelog", default="writelogs", help="Dump output to local file")
  27. my_cool_parser.add_argument("-e", "--error", action="store_true", help="Stop process on error (default: No)")
  28. verbosity = my_cool_parser.add_mutually_exclusive_group()
  29. verbosity.add_argument('-t', '--verbozze', dest='verbose', action="store_true", help="Show more details")
  30. verbosity.add_argument('-q', '--quiet', dest='quiet', action="store_true", help="Only output on error")
  31. # print my_cool_parser._actions
  32. # print 'inside of main(), my_cool_parser =', my_cool_parser
  33. args = my_cool_parser.parse_args()
  34. main(args)
  35. def main(args):
  36. display_message()
  37. def here_is_smore():
  38. pass
  39. if __name__ == '__main__':
  40. arbitrary_function()