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

Method xhdr

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

Process an XHDR command (optional server extension). Arguments: - hdr: the header type (e.g. 'subject') - str: an article nr, a message id, or a range nr1-nr2 - file: Filename string or file object to store the result in Returns: - resp: server response

(self, hdr, str, *, file=None)

Source from the content-addressed store, hash-verified

808 return self._shortcmd('SLAVE')
809
810 def xhdr(self, hdr, str, *, file=None):
811 """Process an XHDR command (optional server extension). Arguments:
812 - hdr: the header type (e.g. 'subject')
813 - str: an article nr, a message id, or a range nr1-nr2
814 - file: Filename string or file object to store the result in
815 Returns:
816 - resp: server response if successful
817 - list: list of (nr, value) strings
818 """
819 pat = re.compile('^([0-9]+) ?(.*)\n?')
820 resp, lines = self._longcmdstring('XHDR {0} {1}'.format(hdr, str), file)
821 def remove_number(line):
822 m = pat.match(line)
823 return m.group(1, 2) if m else line
824 return resp, [remove_number(line) for line in lines]
825
826 def xover(self, start, end, *, file=None):
827 """Process an XOVER command (optional server extension) Arguments:

Callers

nothing calls this directly

Calls 3

_longcmdstringMethod · 0.95
compileMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected