MCPcopy Index your code
hub / github.com/python/cpython / capa

Method capa

Lib/poplib.py:379–405  ·  view source on GitHub ↗

Return server capabilities (RFC 2449) as a dictionary >>> c=poplib.POP3('localhost') >>> c.capa() {'IMPLEMENTATION': ['Cyrus', 'POP3', 'server', 'v2.2.12'], 'TOP': [], 'LOGIN-DELAY': ['0'], 'AUTH-RESP-CODE': [], 'EXPIRE': ['NEVER'], 'USER': [], 'STLS': [], '

(self)

Source from the content-addressed store, hash-verified

377
378
379 def capa(self):
380 """Return server capabilities (RFC 2449) as a dictionary
381 >>> c=poplib.POP3('localhost')
382 >>> c.capa()
383 {'IMPLEMENTATION': ['Cyrus', 'POP3', 'server', 'v2.2.12'],
384 'TOP': [], 'LOGIN-DELAY': ['0'], 'AUTH-RESP-CODE': [],
385 'EXPIRE': ['NEVER'], 'USER': [], 'STLS': [], 'PIPELINING': [],
386 'UIDL': [], 'RESP-CODES': []}
387 >>>
388
389 Really, according to RFC 2449, the cyrus folks should avoid
390 having the implementation split into multiple arguments...
391 """
392 def _parsecap(line):
393 lst = line.decode('ascii').split()
394 return lst[0], lst[1:]
395
396 caps = {}
397 try:
398 resp = self._longcmd('CAPA')
399 rawcaps = resp[1]
400 for capline in rawcaps:
401 capnm, capargs = _parsecap(capline)
402 caps[capnm] = capargs
403 except error_proto:
404 raise error_proto('-ERR CAPA not supported by server')
405 return caps
406
407
408 def stls(self, context=None):

Callers 5

stlsMethod · 0.95
test_capaMethod · 0.80
test_stls_capaMethod · 0.80
test_stls_capaMethod · 0.80
test_stls_capaMethod · 0.80

Calls 2

_longcmdMethod · 0.95
error_protoClass · 0.70

Tested by 4

test_capaMethod · 0.64
test_stls_capaMethod · 0.64
test_stls_capaMethod · 0.64
test_stls_capaMethod · 0.64