Gets a source file. Gets the file. Handles errors. Returns the file.
(prompt)
| 150 | |
| 151 | |
| 152 | def get_source(prompt): |
| 153 | '''Gets a source file. |
| 154 | |
| 155 | Gets the file. |
| 156 | Handles errors. |
| 157 | Returns the file.''' |
| 158 | while True: |
| 159 | try: |
| 160 | source = file(raw_input(prompt + ' '), 'rb') |
| 161 | return source |
| 162 | except: |
| 163 | pass |
| 164 | print 'Please enter a different filename.' |
| 165 | |
| 166 | def get_key(): |
| 167 | '''Gets key data. |
no outgoing calls
no test coverage detected