Get the server capabilities, as read by __init__(). If the CAPABILITIES command is not supported, an empty dict is returned.
(self)
| 411 | return self.welcome |
| 412 | |
| 413 | def getcapabilities(self): |
| 414 | """Get the server capabilities, as read by __init__(). |
| 415 | If the CAPABILITIES command is not supported, an empty dict is |
| 416 | returned.""" |
| 417 | if self._caps is None: |
| 418 | self.nntp_version = 1 |
| 419 | self.nntp_implementation = None |
| 420 | try: |
| 421 | resp, caps = self.capabilities() |
| 422 | except (NNTPPermanentError, NNTPTemporaryError): |
| 423 | # Server doesn't support capabilities |
| 424 | self._caps = {} |
| 425 | else: |
| 426 | self._caps = caps |
| 427 | if 'VERSION' in caps: |
| 428 | # The server can advertise several supported versions, |
| 429 | # choose the highest. |
| 430 | self.nntp_version = max(map(int, caps['VERSION'])) |
| 431 | if 'IMPLEMENTATION' in caps: |
| 432 | self.nntp_implementation = ' '.join(caps['IMPLEMENTATION']) |
| 433 | return self._caps |
| 434 | |
| 435 | def set_debuglevel(self, level): |
| 436 | """Set the debugging level. Argument 'level' means: |
no test coverage detected