Lines Matching +full:command +full:- +full:line
10 >>> resp, subs = s.xhdr('subject', first + '-' + last)
14 Here 'resp' is the server response line.
40 # maximal line length when calling readline(). This is to prevent
41 # reading arbitrary length lines. RFC 3977 limits NNTP line length to
70 """Response does not begin with [1-5]"""
94 # Line terminators (we always output CRLF, but accept any of CRLF, CR, LF)
104 - host: hostname to connect to
105 - port: port to connect to (default the standard NNTP port)
106 - user: username to authenticate with
107 - password: password to use with username
108 - readermode: if true, send 'mode reader' command after
113 reader-specific commands, such as `group'. If you get
196 def putline(self, line): argument
197 """Internal: send one line to the server, appending CRLF."""
198 line = line + CRLF
199 if self.debugging > 1: print '*put*', repr(line)
200 self.sock.sendall(line)
202 def putcmd(self, line): argument
203 """Internal: send one command to the server (through putline())."""
204 if self.debugging: print '*cmd*', repr(line)
205 self.putline(line)
208 """Internal: return one line from the server, stripping CRLF.
210 line = self.file.readline(_MAXLINE + 1)
211 if len(line) > _MAXLINE:
212 raise NNTPDataError('line too long')
214 print '*get*', repr(line)
215 if not line: raise EOFError
216 if line[-2:] == CRLF: line = line[:-2]
217 elif line[-1:] in CRLF: line = line[:-1]
218 return line
249 line = self.getline()
250 if line == '.':
252 if line[:2] == '..':
253 line = line[1:]
255 file.write(line + "\n")
257 list.append(line)
265 def shortcmd(self, line): argument
266 """Internal: send a command and get the response."""
267 self.putcmd(line)
270 def longcmd(self, line, file=None): argument
271 """Internal: send a command and get the response plus following text."""
272 self.putcmd(line)
276 """Process a NEWGROUPS command. Arguments:
277 - date: string 'yymmdd' indicating the date
278 - time: string 'hhmmss' indicating the time
280 - resp: server response if successful
281 - list: list of newsgroup names"""
286 """Process a NEWNEWS command. Arguments:
287 - group: group name or '*'
288 - date: string 'yymmdd' indicating the date
289 - time: string 'hhmmss' indicating the time
291 - resp: server response if successful
292 - list: list of message ids"""
298 """Process a LIST command. Return:
299 - resp: server response if successful
300 - list: list of (group, last, first, flag) (strings)"""
345 """Process a GROUP command. Argument:
346 - group: the group name
348 - resp: server response if successful
349 - count: number of articles (string)
350 - first: first article number (string)
351 - last: last article number (string)
352 - name: the group name"""
371 """Process a HELP command. Returns:
372 - resp: server response if successful
373 - list: list of strings"""
378 """Internal: parse the response of a STAT, NEXT or LAST command."""
391 def statcmd(self, line): argument
392 """Internal: process a STAT, NEXT or LAST command."""
393 resp = self.shortcmd(line)
397 """Process a STAT command. Argument:
398 - id: article number or message id
400 - resp: server response if successful
401 - nr: the article number
402 - id: the message id"""
407 """Process a NEXT command. No arguments. Return as for STAT."""
411 """Process a LAST command. No arguments. Return as for STAT."""
414 def artcmd(self, line, file=None): argument
415 """Internal: process a HEAD, BODY or ARTICLE command."""
416 resp, list = self.longcmd(line, file)
421 """Process a HEAD command. Argument:
422 - id: article number or message id
424 - resp: server response if successful
425 - nr: article number
426 - id: message id
427 - list: the lines of the article's header"""
432 """Process a BODY command. Argument:
433 - id: article number or message id
434 - file: Filename string or file object to store the article in
436 - resp: server response if successful
437 - nr: article number
438 - id: message id
439 - list: the lines of the article's body or an empty list
445 """Process an ARTICLE command. Argument:
446 - id: article number or message id
448 - resp: server response if successful
449 - nr: article number
450 - id: message id
451 - list: the lines of the article"""
456 """Process a SLAVE command. Returns:
457 - resp: server response if successful"""
462 """Process an XHDR command (optional server extension). Arguments:
463 - hdr: the header type (e.g. 'subject')
464 - str: an article nr, a message id, or a range nr1-nr2
466 - resp: server response if successful
467 - list: list of (nr, value) strings"""
469 pat = re.compile('^([0-9]+) ?(.*)\n?')
472 line = lines[i]
473 m = pat.match(line)
479 """Process an XOVER command (optional server extension) Arguments:
480 - start: start of range
481 - end: end of range
483 - resp: server response if successful
484 - list: list of (art-nr, subject, poster, date,
487 resp, lines = self.longcmd('XOVER ' + start + '-' + end, file)
489 for line in lines:
490 elem = line.split("\t")
501 raise NNTPDataError(line)
505 """Process an XGTITLE command (optional server extension) Arguments:
506 - group: group name wildcard (i.e. news.*)
508 - resp: server response if successful
509 - list: list of (name,title) strings"""
521 """Process an XPATH command (optional server extension) Arguments:
522 - id: Message id of article
538 """Process the DATE command. Arguments:
552 time = elem[1][-6:]
559 """Process a POST command. Arguments:
560 - f: file containing the article
562 - resp: server response if successful"""
569 line = f.readline()
570 if not line:
572 if line[-1] == '\n':
573 line = line[:-1]
574 if line[:1] == '.':
575 line = '.' + line
576 self.putline(line)
581 """Process an IHAVE command. Arguments:
582 - id: message-id of the article
583 - f: file containing the article
585 - resp: server response if successful
593 line = f.readline()
594 if not line:
596 if line[-1] == '\n':
597 line = line[:-1]
598 if line[:1] == '.':
599 line = '.' + line
600 self.putline(line)
605 """Process a QUIT command and close the socket. Returns:
606 - resp: server response if successful"""
623 if newshost.find('.') == -1:
631 resp, subs = s.xhdr('subject', first + '-' + last)