mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
added __all__ lists to a number of Python modules
added test script and expected output file as well this closes patch 103297. __all__ attributes will be added to other modules without first submitting a patch, just adding the necessary line to the test script to verify more-or-less correct implementation.
This commit is contained in:
@@ -63,6 +63,7 @@ XXX To do:
|
||||
|
||||
__version__ = "0.2"
|
||||
|
||||
__all__ = ["HTTPServer", "BaseHTTPRequestHandler"]
|
||||
|
||||
import sys
|
||||
import time
|
||||
|
||||
@@ -26,6 +26,7 @@ bastion is created.
|
||||
|
||||
"""
|
||||
|
||||
__all__ = ["BastionClass", "Bastion"]
|
||||
|
||||
from types import MethodType
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ SECURITY WARNING: DON'T USE THIS CODE UNLESS YOU ARE INSIDE A FIREWALL
|
||||
|
||||
__version__ = "0.4"
|
||||
|
||||
__all__ = ["CGIHTTPRequestHandler"]
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -89,6 +89,11 @@ import sys
|
||||
import string
|
||||
import re
|
||||
|
||||
__all__ = ["NoSectionError","DuplicateSectionError","NoOptionError",
|
||||
"InterpolationError","InterpolationDepthError","ParsingError",
|
||||
"MissingSectionHeaderError","ConfigParser",
|
||||
"MAX_INTERPOLATION_DEPTH"]
|
||||
|
||||
DEFAULTSECT = "DEFAULT"
|
||||
|
||||
MAX_INTERPOLATION_DEPTH = 10
|
||||
|
||||
@@ -228,6 +228,8 @@ try:
|
||||
except ImportError:
|
||||
raise ImportError, "Cookie.py requires 're' from Python 1.5 or later"
|
||||
|
||||
__all__ = ["CookieError","BaseCookie","SimpleCookie","SerialCookie",
|
||||
"SmartCookie","Cookie"]
|
||||
|
||||
#
|
||||
# Define an exception visible to External modules
|
||||
|
||||
@@ -10,6 +10,7 @@ MimeWriter - the only thing here.
|
||||
import string
|
||||
import mimetools
|
||||
|
||||
__all__ = ["MimeWriter"]
|
||||
|
||||
class MimeWriter:
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
"""A multi-producer, multi-consumer queue."""
|
||||
|
||||
__all__ = ["Queue","Empty","Full"]
|
||||
|
||||
class Empty(Exception):
|
||||
"Exception raised by Queue.get(block=0)/get_nowait()."
|
||||
pass
|
||||
|
||||
@@ -8,6 +8,7 @@ and HEAD requests in a fairly straightforward manner.
|
||||
|
||||
__version__ = "0.6"
|
||||
|
||||
__all__ = ["SimpleHTTPRequestHandler"]
|
||||
|
||||
import os
|
||||
import string
|
||||
|
||||
@@ -127,6 +127,13 @@ import socket
|
||||
import sys
|
||||
import os
|
||||
|
||||
__all__ = ["TCPServer","UDPServer","ForkingUDPServer","ForkingTCPServer",
|
||||
"ThreadingUDPServer","ThreadingTCPServer","BaseRequestHandler",
|
||||
"StreamRequestHandler","DatagramRequestHandler"]
|
||||
if hasattr(socket, "AF_UNIX"):
|
||||
__all__.extend(["UnixStreamServer","UnixDatagramServer",
|
||||
"ThreadingUnixStreamServer",
|
||||
"ThreadingUnixDatagramServer"])
|
||||
|
||||
class BaseServer:
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ try:
|
||||
except ImportError:
|
||||
EINVAL = 22
|
||||
|
||||
__all__ = ["StringIO"]
|
||||
|
||||
EMPTYSTRING = ''
|
||||
|
||||
class StringIO:
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
"""A more or less complete user-defined wrapper around dictionary objects."""
|
||||
|
||||
__all__ = ["UserDict"]
|
||||
|
||||
class UserDict:
|
||||
def __init__(self, dict=None):
|
||||
self.data = {}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
"""A more or less complete user-defined wrapper around list objects."""
|
||||
|
||||
__all__ = ["UserList"]
|
||||
|
||||
class UserList:
|
||||
def __init__(self, initlist=None):
|
||||
self.data = []
|
||||
|
||||
@@ -8,6 +8,8 @@ This module requires Python 1.6 or later.
|
||||
from types import StringType, UnicodeType
|
||||
import sys
|
||||
|
||||
__all__ = ["UserString","MutableString"]
|
||||
|
||||
class UserString:
|
||||
def __init__(self, seq):
|
||||
if isinstance(seq, StringType) or isinstance(seq, UnicodeType):
|
||||
|
||||
@@ -137,6 +137,8 @@ writeframesraw.
|
||||
import struct
|
||||
import __builtin__
|
||||
|
||||
__all__ = ["Error","open","openfp"]
|
||||
|
||||
class Error(Exception):
|
||||
pass
|
||||
|
||||
|
||||
@@ -42,6 +42,8 @@ only if it doesn't exist; and 'n' always creates a new database.
|
||||
|
||||
"""
|
||||
|
||||
__all__ = ["error","open"]
|
||||
|
||||
try:
|
||||
class error(Exception):
|
||||
pass
|
||||
|
||||
@@ -5,6 +5,8 @@ upon normal program termination.
|
||||
One public function, register, is defined.
|
||||
"""
|
||||
|
||||
__all__ = ["register"]
|
||||
|
||||
_exithandlers = []
|
||||
def _run_exitfuncs():
|
||||
"""run any registered exit functions
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
"""Classes for manipulating audio devices (currently only for Sun and SGI)"""
|
||||
|
||||
__all__ = ["error","AudioDev"]
|
||||
|
||||
class error(Exception):
|
||||
pass
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
import binascii
|
||||
|
||||
__all__ = ["encode","decode","encodestring","decodestring"]
|
||||
|
||||
MAXLINESIZE = 76 # Excluding the CRLF
|
||||
MAXBINSIZE = (MAXLINESIZE/4)*3
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import sys
|
||||
import os
|
||||
import types
|
||||
|
||||
__all__ = ["BdbQuit","Bdb","Breakpoint"]
|
||||
|
||||
BdbQuit = 'bdb.BdbQuit' # Exception to give up completely
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +27,8 @@ import struct
|
||||
import string
|
||||
import binascii
|
||||
|
||||
__all__ = ["binhex","hexbin","Error"]
|
||||
|
||||
class Error(Exception):
|
||||
pass
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user