MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / getcapabilities

Method getcapabilities

tools/python-3.11.9-amd64/Lib/nntplib.py:413–433  ·  view source on GitHub ↗

Get the server capabilities, as read by __init__(). If the CAPABILITIES command is not supported, an empty dict is returned.

(self)

Source from the content-addressed store, hash-verified

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:

Callers 4

_base_initMethod · 0.95
loginMethod · 0.95
starttlsMethod · 0.95
nntplib.pyFile · 0.80

Calls 4

capabilitiesMethod · 0.95
maxFunction · 0.85
mapFunction · 0.50
joinMethod · 0.45

Tested by

no test coverage detected