Gets destination file. Prompts for filename. Handles errors. Returns file.
(prompt)
| 91 | |
| 92 | |
| 93 | def get_destination(prompt): |
| 94 | '''Gets destination file. |
| 95 | |
| 96 | Prompts for filename. |
| 97 | Handles errors. |
| 98 | Returns file.''' |
| 99 | while True: |
| 100 | try: |
| 101 | key = file(raw_input(prompt + ' '), 'wb') |
| 102 | return key |
| 103 | except: |
| 104 | print 'Please enter a different filename.' |
| 105 | |
| 106 | def create_key_data(): |
| 107 | '''Creates a key. |
no outgoing calls
no test coverage detected