Advanced formatting for messages.
(self, formatstr)
| 204 | """Message class with more robust formatting capability.""" |
| 205 | |
| 206 | def __format__(self, formatstr): |
| 207 | """Advanced formatting for messages.""" |
| 208 | hexify = False |
| 209 | verbose = "" |
| 210 | if 'h' in formatstr: |
| 211 | hexify = True |
| 212 | if 'v' in formatstr: |
| 213 | verbose = "ContentType." |
| 214 | |
| 215 | if hexify: |
| 216 | data = b2a_hex(self.data) |
| 217 | else: |
| 218 | data = repr(self.data) |
| 219 | |
| 220 | return "Message(contentType={0}{1}, data={2})"\ |
| 221 | .format(verbose, ContentType.toStr(self.contentType), data) |
| 222 | |
| 223 | |
| 224 | class ServerKeyExchange(messages.ServerKeyExchange): |
nothing calls this directly
no outgoing calls
no test coverage detected