Encode the string and show the cipher-text in the output.
(self, string)
| 201 | # Encrypt a string for display in the interface's output area. |
| 202 | |
| 203 | def encode(self, string): |
| 204 | "Encode the string and show the cipher-text in the output." |
| 205 | try: |
| 206 | cipher = self.build_cipher(string) |
| 207 | except ValueError: |
| 208 | self.output = '' |
| 209 | except: |
| 210 | self.output = traceback.format_exc() |
| 211 | else: |
| 212 | self.output = self.build_header() + '\n\n' + cipher |
| 213 | |
| 214 | def build_cipher(self, string): |
| 215 | "Build cipher-text based on plain-text and return answer." |
no test coverage detected