docstrings into comments.
Notes:
- Using a real file is often faster (but less convenient).
+- There's also a much faster implementation in C, called cStringIO, but
+ it's not subclassable.
- fileno() is left unimplemented so that code which uses it triggers
an exception early.
- Seeking far beyond EOF and then writing will insert real null
- Don't try to give a CGI script a set-uid mode. This doesn't work on
most systems, and is a security liability as well.
-
-History
--------
-
-Michael McLay started this module. Steve Majewski changed the
-interface to SvFormContentDict and FormContentDict. The multipart
-parsing was inspired by code submitted by Andreas Paepcke. Guido van
-Rossum rewrote, reformatted and documented the module and is currently
-responsible for its maintenance.
-
-
-XXX The module is getting pretty heavy with all those docstrings.
-Perhaps there should be a slimmed version that doesn't contain all those
-backwards compatible and debugging classes and functions?
-
"""
+# XXX The module is getting pretty heavy with all those docstrings.
+# Perhaps there should be a slimmed version that doesn't contain all those
+# backwards compatible and debugging classes and functions?
+
+# History
+# -------
+#
+# Michael McLay started this module. Steve Majewski changed the
+# interface to SvFormContentDict and FormContentDict. The multipart
+# parsing was inspired by code submitted by Andreas Paepcke. Guido van
+# Rossum rewrote, reformatted and documented the module and is currently
+# responsible for its maintenance.
+#
+
__version__ = "2.2"
"""Utilities needed to emulate Python's interactive interpreter.
-Inspired by similar code by Jeff Epler and Fredrik Lundh.
"""
+# Inspired by similar code by Jeff Epler and Fredrik Lundh.
+
import sys
import string
Based on RFC 959: File Transfer Protocol
(FTP), by J. Postel and J. Reynolds
-Changes and improvements suggested by Steve Majewski.
-Modified by Jack to work on the mac.
-Modified by Siebren to support docstrings and PASV.
-
-
Example:
>>> from ftplib import FTP
python ftplib.py -d localhost -l -p -l
"""
+#
+# Changes and improvements suggested by Steve Majewski.
+# Modified by Jack to work on the mac.
+# Modified by Siebren to support docstrings and PASV.
+#
import os
import sys
On Windows, the msvcrt module will be used.
On the Mac EasyDialogs.AskPassword is used, if available.
-Authors: Piers Lauder (original)
- Guido van Rossum (Windows support and cleanup)
"""
+# Authors: Piers Lauder (original)
+# Guido van Rossum (Windows support and cleanup)
+
import sys
def unix_getpass(prompt='Password: '):
Based on RFC 2060.
-Author: Piers Lauder <piers@cs.su.oz.au> December 1997.
-
-Authentication code contributed by Donn Cave <donn@u.washington.edu> June 1998.
-
Public class: IMAP4
Public variable: Debug
Public functions: Internaldate2tuple
Time2Internaldate
"""
+# Author: Piers Lauder <piers@cs.su.oz.au> December 1997.
+#
+# Authentication code contributed by Donn Cave <donn@u.washington.edu> June 1998.
+
__version__ = "2.32"
import binascii, re, socket, string, time, random, sys
"""A POP3 client class.
Based on the J. Myers POP3 draft, Jan. 96
-
-Author: David Ascher <david_ascher@brown.edu>
- [heavily stealing from nntplib.py]
-Updated: Piers Lauder <piers@cs.su.oz.au> [Jul '97]
"""
+# Author: David Ascher <david_ascher@brown.edu>
+# [heavily stealing from nntplib.py]
+# Updated: Piers Lauder <piers@cs.su.oz.au> [Jul '97]
+
# Example (see the test function at the end of this file)
TESTSERVER = "localhost"
"""SMTP/ESMTP client class.
-Author: The Dragon De Monsyne <dragondm@integral.org>
-ESMTP support, test code and doc fixes added by
- Eric S. Raymond <esr@thyrsus.com>
-Better RFC 821 compliance (MAIL and RCPT, and CRLF in data)
- by Carey Evans <c.evans@clear.net.nz>, for picky mail servers.
-
-This was modified from the Python 1.5 library HTTP lib.
-
This should follow RFC 821 (SMTP) and RFC 1869 (ESMTP).
Notes:
>>> s.quit()
"""
+# Author: The Dragon De Monsyne <dragondm@integral.org>
+# ESMTP support, test code and doc fixes added by
+# Eric S. Raymond <esr@thyrsus.com>
+# Better RFC 821 compliance (MAIL and RCPT, and CRLF in data)
+# by Carey Evans <c.evans@clear.net.nz>, for picky mail servers.
+#
+# This was modified from the Python 1.5 library HTTP lib.
+
import socket
import string
import re
random generators, and to choose from other ranges.
-Translated by Guido van Rossum from C source provided by
-Adrian Baddeley.
-
-
Multi-threading note: the random number generator used here is not
thread-safe; it is possible that nearly simultaneous calls in
down in the serial case by using a lock here.)
"""
+# Translated by Guido van Rossum from C source provided by
+# Adrian Baddeley.
+
+
class whrandom:
def __init__(self, x = 0, y = 0, z = 0):
"""Initialize an instance.