Generates a key. Shows the heading. Gets a destination file. Creates a key. Saves the key in the file. Flush the buffer. Closes the file. Prints confirmation.
()
| 72 | print 'You must enter 1, 2, 3, or 4 as a selection.' |
| 73 | |
| 74 | def create_key(): |
| 75 | '''Generates a key. |
| 76 | |
| 77 | Shows the heading. |
| 78 | Gets a destination file. |
| 79 | Creates a key. |
| 80 | Saves the key in the file. |
| 81 | Flush the buffer. |
| 82 | Closes the file. |
| 83 | Prints confirmation.''' |
| 84 | show_heading('CREATE KEY') |
| 85 | key_file = get_destination('What will be the name of the key file?') |
| 86 | key_data = create_key_data() |
| 87 | Pickler(key_file).dump(key_data) |
| 88 | key_file.flush() |
| 89 | key_file.close() |
| 90 | print 'The key has been created at the location specified.' |
| 91 | |
| 92 | |
| 93 | def get_destination(prompt): |
| 94 | '''Gets destination file. |
no test coverage detected