Advertisement
Guest User

Untitled

a guest
May 24th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. class View():
  2. """
  3. The main view class for the PyGest tkinter interface.
  4. """
  5. .
  6. .
  7. .
  8. def configure_buttons(self):
  9. """
  10. Configure button frame and two buttons: hash and clear.
  11. """
  12. logging.info("We're in the configure buttons method.")
  13. buttons_frame = tkinter.Frame(self.mainframe, background="blue", borderwidth=2, relief='flat')
  14. buttons_frame.grid(row=3, column=0, sticky=('N', 'S', 'E', 'W'))
  15. buttons_frame.columnconfigure(0, weight=1)
  16. buttons_frame.rowconfigure(0, weight=1)
  17. buttons_frame.rowconfigure(1, weight=1)
  18.  
  19. hash_button = tkinter.Button(buttons_frame, text='Hash', relief='raised', command=self.runHash)
  20. hash_button.grid(row=0, column=0, sticky=('N', 'S', 'E', 'W'))
  21.  
  22. clear_button = tkinter.Button(buttons_frame, text='Clear', relief='raised', command=self.clear)
  23. clear_button.grid(row=1, column=0, sticky=('N', 'S', 'E', 'W'))
  24.  
  25. def runHash(self):
  26. """
  27. Contains functionality to run the hash function.
  28. """
  29. logging.info("Hash button pressed.")
  30. path = self.filePath
  31. hash_func = self.radio_var.get()
  32. logging.info("File path: {}".format(path))
  33. logging.info("Hash func: {}".format(hash_func))
  34.  
  35. def clear(self):
  36. """
  37. Clears all input and output fields.
  38. """
  39. logging.info("Clear button pressed.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement