/Lib/ctypes/

-- Lib/asyncore.py | 21 +++++++++++++++++++++ Lib/binhex.py | 2 +- Lib/copy.py | 4 +--- Lib/dircache.py | 8 +++++--- Lib/dospath.py | 2 +- Lib/formatter.py | 20 ++++++++++++++++++++ Lib/ftplib.py | 5 +++-- Lib/getopt.py | 2 +- Lib/gzip.py | 3 ++- Lib/locale.py | 3 ++- Lib/macurl2path.py | 5 +++-- Lib/mimify.py | 4 ++-- Lib/os.py | 11 ++++++----- Lib/pdb.py | 2 +- Lib/pyclbr.py | 4 ++-- Lib/sched.py | 2 +- Lib/smtplib.py | 4 ++-- Lib/statcache.py | 3 ++- Lib/xmllib.py | 3 ++- 20 files changed, 99 insertions(+), 48 deletions(-) diff --git a/Lib/asynchat.py b/Lib/asynchat.py index e725a2b..8b2f59f 100644 --- a/Lib/asynchat.py +++ b/Lib/asynchat.py @@ -25,28 +25,31 @@ # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # ====================================================================== +"""A class supporting chat-style (command/response) protocols. + +This class adds support for 'chat' style protocols - where one side +sends a 'command', and the other sends a response (examples would be +the common internet protocols - smtp, nntp, ftp, etc..). + +The handle_read() method looks at the input stream for the current +'terminator' (usually '\r\n' for single-line responses, '\r\n.\r\n' +for multi-line output), calling self.found_terminator() on its +receipt. + +for example: +Say you build an async nntp client using this class. At the start +of the connection, you'll have self.terminator set to '\r\n', in +order to process the single-line greeting. Just before issuing a +'LIST' command you'll set it to '\r\n.\r\n'. The output of the LIST +command will be accumulated (using your own 'collect_incoming_data' +method) up to the terminator, and then control will be returned to +you - by calling your self.found_terminator() method. +""" + import socket import asyncore import string -# This class adds support for 'chat' style protocols - where one side -# sends a 'command', and the other sends a response (examples would be -# the common internet protocols - smtp, nntp, ftp, etc..). - -# The handle_read() method looks at the input stream for the current -# 'terminator' (usually '\r\n' for single-line responses, '\r\n.\r\n' -# for multi-line output), calling self.found_terminator() on its -# receipt. - -# for example: -# Say you build an async nntp client using this class. At the start -# of the connection, you'll have self.terminator set to '\r\n', in -# order to process the single-line greeting. Just before issuing a -# 'LIST' command you'll set it to '\r\n.\r\n'. The output of the LIST -# command will be accumulated (using your own 'collect_incoming_data' -# method) up to the terminator, and then control will be returned to -# you - by calling your self.found_terminator() method - class async_chat (asyncore.dispatcher): """This is an abstract class. You must derive from this class, and add the two methods collect_incoming_data() and found_terminator()""" diff --git a/Lib/asyncore.py b/Lib/asyncore.py index 07b9fc3..8e11d76 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -25,6 +25,27 @@ # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # ====================================================================== +"""Basic infrastructure for asynchronous socket service clients and servers. + +There are only two ways to have a program on a single processor do "more +than one thing at a time". Multi-threaded programming is the simplest and +most popular way to do it, but there is another very different technique, +that lets you have nearly all the advantages of multi-threading, without +actually using multiple threads. it's really only practical if your program +is largely I/O bound. If your program is CPU bound, then pre-emptive +scheduled threads are probably what you really need. Network servers are +rarely CPU-bound, however. + +If your operating system supports the select() system call in its I/O +library (and nearly all do), then you can use it to juggle multiple +communication channels at once; doing other work while your I/O is taking +place in the "background." Although this strategy can seem strange and +complex, especially at first, it is in many ways easier to understand and +control than multi-threaded programming. The module documented here solves +many of the difficult problems for you, making the task of building +sophisticated high-performance network servers and clients a snap. +""" + import select import socket import string diff --git a/Lib/binhex.py b/Lib/binhex.py index 3fc7234..db6a7ef 100644 --- a/Lib/binhex.py +++ b/Lib/binhex.py @@ -1,4 +1,4 @@ -"""binhex - Macintosh binhex compression/decompression +"""Macintosh binhex compression/decompression. easy interface: binhex(inputfilename, outputfilename) diff --git a/Lib/copy.py b/Lib/copy.py index 2d9de3c..e4679de 100644 --- a/Lib/copy.py +++ b/Lib/copy.py @@ -1,6 +1,4 @@ -"""\ -Generic (shallow and deep) copying operations -============================================= +"""Generic (shallow and deep) copying operations. Interface summary: diff --git a/Lib/dircache.py b/Lib/dircache.py index b0a3665..a35e16d 100644 --- a/Lib/dircache.py +++ b/Lib/dircache.py @@ -1,6 +1,8 @@ -"""Return a sorted list of the files in a directory, using a cache -to avoid reading the directory more often than necessary. -Also contains a subroutine to append slashes to directories.""" +"""Read and cache directory listings. + +The listdir() routine returns a sorted list of the files in a directory, +using a cache to avoid reading the directory more often than necessary. +The annotate() routine appends slashes to directories.""" import os diff --git a/Lib/dospath.py b/Lib/dospath.py index 2ad21f0..4e4be56 100644 --- a/Lib/dospath.py +++ b/Lib/dospath.py @@ -1,4 +1,4 @@ -"""Module 'dospath' -- common operations on DOS pathnames""" +"""Common operations on DOS pathnames.""" import os import stat diff --git a/Lib/formatter.py b/Lib/formatter.py index 4b340d5..4d6a129 100644 --- a/Lib/formatter.py +++ b/Lib/formatter.py @@ -1,3 +1,23 @@ +"""Generic output formatting. + +Formatter objects transform an abstract flow of formatting events into +specific output events on writer objects. Formatters manage several stack +structures to allow various properties of a writer object to be changed and +restored; writers need not be able to handle relative changes nor any sort +of ``change back'' operation. Specific writer properties which may be +controlled via formatter objects are horizontal alignment, font, and left +margin indentations. A mechanism is provided which supports providing +arbitrary, non-exclusive style settings to a writer as well. Additional +interfaces facilitate formatting events which are not reversible, such as +paragraph separation. + +Writer objects encapsulate device interfaces. Abstract devices, such as +file formats, are supported as well as physical devices. The provided +implementations all work with abstract devices. The interface makes +available mechanisms for setting the properties which formatter objects +manage and inserting data into the output. +""" + import string import sys from types import StringType diff --git a/Lib/ftplib.py b/Lib/ftplib.py index eee8e5a..94ae880 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -1,4 +1,5 @@ -'''An FTP client class, and some helper functions. +"""An FTP client class and some helper functions. + Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Re