[Python-checkins] CVS: python/dist/src/Lib pre.py,1.7,1.8 random.py,1.23,1.24 re.py,1.39,1.40 reconvert.py,1.4,1.5 regex_syntax.py,1.4,1.5 regsub.py,1.12,1.13 repr.py,1.8,1.9 rexec.py,1.27,1.28 rfc822.py,1.53,1.54 rlcompleter.py,1.8,1.9 sched.py,1.12,1.13 sgmllib.py,1.25,1.26 shelve.py,1.14,1.15 shlex.py,1.14,1.15 shutil.py,1.19,1.20 smtpd.py,1.2,1.3 smtplib.py,1.35,1.36 sndhdr.py,1.5,1.6 socket.py,1.6,1.7 sre.py,1.28,1.29 sre_compile.py,1.34,1.35 sre_constants.py,1.24,1.25 sre_parse.py,1.42,1.43 stat.py,1.8,1.9 statcache.py,1.10,1.11 statvfs.py,1.5,1.6 string.py,1.57,1.58
Skip Montanaro
montanaro@users.sourceforge.net
Thu, 15 Feb 2001 14:15:16 -0800
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv17306
Modified Files:
pre.py random.py re.py reconvert.py regex_syntax.py regsub.py
repr.py rexec.py rfc822.py rlcompleter.py sched.py sgmllib.py
shelve.py shlex.py shutil.py smtpd.py smtplib.py sndhdr.py
socket.py sre.py sre_compile.py sre_constants.py sre_parse.py
stat.py statcache.py statvfs.py string.py
Log Message:
bunch more __all__ lists
also modified check_all function to suppress all warnings since they aren't
relevant to what this test is doing (allows quiet checking of regsub, for
instance)
Index: pre.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pre.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** pre.py 2001/02/12 02:00:42 1.7
--- pre.py 2001/02/15 22:15:13 1.8
***************
*** 88,92 ****
from pcre import *
! __all__ = ["match","search","sub","subn","split","findall","escape","compile"]
#
--- 88,94 ----
from pcre import *
! __all__ = ["match","search","sub","subn","split","findall","escape","compile",
! "I","L","M","S","X","IGNORECASE","LOCALE","MULTILINE","DOTALL",
! "VERBOSE","error"]
#
Index: random.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/random.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** random.py 2001/02/01 10:06:53 1.23
--- random.py 2001/02/15 22:15:13 1.24
***************
*** 77,80 ****
--- 77,86 ----
from math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin
+ __all__ = ["Random","seed","random","uniform","randint","choice",
+ "randrange","shuffle","normalvariate","lognormvariate",
+ "cunifvariate","expovariate","vonmisesvariate","gammavariate",
+ "stdgamma","gauss","betavariate","paretovariate","weibullvariate",
+ "getstate","setstate","jumpahead","whseed"]
+
def _verify(name, expected):
computed = eval(name)
Index: re.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/re.py,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** re.py 2000/08/01 21:22:16 1.39
--- re.py 2001/02/15 22:15:13 1.40
***************
*** 27,32 ****
--- 27,34 ----
# New unicode-aware engine
from sre import *
+ from sre import __all__
else:
# Old 1.5.2 engine. This one supports 8-bit strings only,
# and will be removed in 2.0 final.
from pre import *
+ from pre import __all__
Index: reconvert.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/reconvert.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** reconvert.py 2001/01/15 01:18:21 1.4
--- reconvert.py 2001/02/15 22:15:13 1.5
***************
*** 64,67 ****
--- 64,69 ----
from regex_syntax import * # RE_*
+ __all__ = ["convert","quote"]
+
# Default translation table
mastertable = {
Index: regex_syntax.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/regex_syntax.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** regex_syntax.py 2001/01/15 01:18:21 1.4
--- regex_syntax.py 2001/02/15 22:15:13 1.5
***************
*** 52,53 ****
--- 52,59 ----
# (Python's obsolete "regexp" module used a syntax similar to awk.)
+
+ __all__ = locals().keys()
+ for _i in range(len(__all__)-1,-1,-1):
+ if __all__[_i][0] == "_":
+ del __all__[_i]
+ del _i
Index: regsub.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/regsub.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** regsub.py 2001/02/09 09:21:01 1.12
--- regsub.py 2001/02/15 22:15:13 1.13
***************
*** 20,23 ****
--- 20,24 ----
import regex
+ __all__ = ["sub","gsub","split","splitx","capwords"]
# Replace first occurrence of pattern pat in string str by replacement
Index: repr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/repr.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** repr.py 2001/02/09 08:53:08 1.8
--- repr.py 2001/02/15 22:15:13 1.9
***************
*** 1,4 ****
--- 1,6 ----
"""Redo the `...` (representation) but with limits on most sizes."""
+ __all__ = ["Repr","repr"]
+
class Repr:
def __init__(self):
Index: rexec.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/rexec.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** rexec.py 2001/01/15 01:18:21 1.27
--- rexec.py 2001/02/15 22:15:13 1.28
***************
*** 24,27 ****
--- 24,28 ----
import ihooks
+ __all__ = ["RExec"]
class FileBase:
Index: rfc822.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/rfc822.py,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -r1.53 -r1.54
*** rfc822.py 2001/01/15 01:18:21 1.53
--- rfc822.py 2001/02/15 22:15:13 1.54
***************
*** 60,63 ****
--- 60,64 ----
import time
+ __all__ = ["Message","AddressList","parsedate","parsedate_tz","mktime_tz"]
_blanklines = ('\r\n', '\n') # Optimization for islast()
Index: rlcompleter.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/rlcompleter.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** rlcompleter.py 2000/07/16 12:04:30 1.8
--- rlcompleter.py 2001/02/15 22:15:13 1.9
***************
*** 44,47 ****
--- 44,49 ----
import __main__
+ __all__ = ["Completer"]
+
class Completer:
Index: sched.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sched.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** sched.py 2001/01/15 01:36:40 1.12
--- sched.py 2001/02/15 22:15:13 1.13
***************
*** 31,34 ****
--- 31,36 ----
import bisect
+ __all__ = ["scheduler"]
+
class scheduler:
def __init__(self, timefunc, delayfunc):
Index: sgmllib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sgmllib.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** sgmllib.py 2001/02/09 10:12:19 1.25
--- sgmllib.py 2001/02/15 22:15:13 1.26
***************
*** 12,15 ****
--- 12,16 ----
import string
+ __all__ = ["SGMLParser"]
# Regular expressions used for parsing
Index: shelve.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/shelve.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** shelve.py 2001/01/15 01:36:40 1.14
--- shelve.py 2001/02/15 22:15:13 1.15
***************
*** 41,44 ****
--- 41,45 ----
from StringIO import StringIO
+ __all__ = ["Shelf","BsdDbShelf","DbfilenameShelf","open"]
class Shelf:
Index: shlex.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/shlex.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** shlex.py 2001/01/17 08:48:38 1.14
--- shlex.py 2001/02/15 22:15:13 1.15
***************
*** 8,11 ****
--- 8,13 ----
import sys
+ __all__ = ["shlex"]
+
class shlex:
"A lexical analyzer class for simple shell-like syntaxes."
Index: shutil.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/shutil.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** shutil.py 2001/01/21 20:00:00 1.19
--- shutil.py 2001/02/15 22:15:13 1.20
***************
*** 9,12 ****
--- 9,14 ----
import stat
+ __all__ = ["copyfileobj","copyfile","copymode","copystat","copy","copy2",
+ "copytree","rmtree"]
def copyfileobj(fsrc, fdst, length=16*1024):
Index: smtpd.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/smtpd.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** smtpd.py 2001/02/09 20:06:00 1.2
--- smtpd.py 2001/02/15 22:15:13 1.3
***************
*** 76,79 ****
--- 76,80 ----
import asynchat
+ __all__ = ["SMTPServer","DebuggingServer","PureProxy","MailmanProxy"]
program = sys.argv[0]
Index: smtplib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/smtplib.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** smtplib.py 2001/02/09 10:14:53 1.35
--- smtplib.py 2001/02/15 22:15:13 1.36
***************
*** 45,48 ****
--- 45,53 ----
import types
+ __all__ = ["SMTPException","SMTPServerDisconnected","SMTPResponseException",
+ "SMTPSenderRefused","SMTPRecipientsRefused","SMTPDataError",
+ "SMTPConnectError","SMTPHeloError","quoteaddr","quotedata",
+ "SMTP"]
+
SMTP_PORT = 25
CRLF="\r\n"
Index: sndhdr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sndhdr.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** sndhdr.py 2001/01/15 01:36:40 1.5
--- sndhdr.py 2001/02/15 22:15:13 1.6
***************
*** 31,34 ****
--- 31,35 ----
# subroutine come last.
+ __all__ = ["what","whathdr"]
def what(filename):
Index: socket.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/socket.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** socket.py 2001/01/15 01:36:40 1.6
--- socket.py 2001/02/15 22:15:13 1.7
***************
*** 43,46 ****
--- 43,51 ----
import os, sys
+ __all__ = ["getfqdn"]
+ import _socket
+ __all__.extend(os._get_exports_list(_socket))
+ del _socket
+
if (sys.platform.lower().startswith("win")
or (hasattr(os, 'uname') and os.uname()[0] == "BeOS")):
Index: sre.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sre.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** sre.py 2001/02/09 11:05:10 1.28
--- sre.py 2001/02/15 22:15:13 1.29
***************
*** 18,21 ****
--- 18,25 ----
import sre_parse
+ __all__ = ["match","search","sub","subn","split","findall","compile",
+ "purge","template","escape","I","L","M","S","X","U","IGNORECASE",
+ "LOCALE","MULTILINE","DOTALL","VERBOSE","UNICODE","error"]
+
# flags
I = IGNORECASE = sre_compile.SRE_FLAG_IGNORECASE # ignore case
Index: sre_compile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sre_compile.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -r1.34 -r1.35
*** sre_compile.py 2001/01/15 18:28:14 1.34
--- sre_compile.py 2001/02/15 22:15:13 1.35
***************
*** 13,16 ****
--- 13,18 ----
from sre_constants import *
+ __all__ = ["compile"]
+
assert _sre.MAGIC == MAGIC, "SRE module mismatch"
Index: sre_constants.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sre_constants.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** sre_constants.py 2001/02/09 10:30:23 1.24
--- sre_constants.py 2001/02/15 22:15:13 1.25
***************
*** 195,198 ****
--- 195,204 ----
SRE_INFO_CHARSET = 4 # pattern starts with character from given set
+ __all__ = locals().keys()
+ for _i in range(len(__all__)-1,-1,-1):
+ if __all__[_i][0] == "_":
+ del __all__[_i]
+ del _i
+
if __name__ == "__main__":
def dump(f, d, prefix):
Index: sre_parse.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sre_parse.py,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -r1.42 -r1.43
*** sre_parse.py 2001/02/09 11:36:16 1.42
--- sre_parse.py 2001/02/15 22:15:13 1.43
***************
*** 15,18 ****
--- 15,21 ----
from sre_constants import *
+ __all__ = ["Pattern","SubPattern","Tokenizer","parse","parse_template",
+ "expand_template"]
+
SPECIAL_CHARS = ".\\[{()*+?^$|"
REPEAT_CHARS = "*+?{"
Index: stat.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/stat.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** stat.py 2001/01/15 01:36:40 1.8
--- stat.py 2001/02/15 22:15:13 1.9
***************
*** 85,86 ****
--- 85,92 ----
S_IWOTH = 00002
S_IXOTH = 00001
+
+ __all__ = locals().keys()
+ for _i in range(len(__all__)-1,-1,-1):
+ if __all__[_i][0] == "_":
+ del __all__[_i]
+ del _i
Index: statcache.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/statcache.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** statcache.py 2001/01/28 05:07:00 1.10
--- statcache.py 2001/02/15 22:15:13 1.11
***************
*** 7,10 ****
--- 7,13 ----
from stat import *
+ __all__ = ["stat","reset","forget","forget_prefix","forget_dir",
+ "forget_except_prefix","isdir"]
+
# The cache. Keys are pathnames, values are os.stat outcomes.
# Remember that multiple threads may be calling this! So, e.g., that
Index: statvfs.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/statvfs.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** statvfs.py 2001/01/15 01:36:40 1.5
--- statvfs.py 2001/02/15 22:15:13 1.6
***************
*** 14,15 ****
--- 14,21 ----
F_FLAG = 8 # Flags (see your local statvfs man page)
F_NAMEMAX = 9 # Maximum file name length
+
+ __all__ = locals().keys()
+ for _i in range(len(__all__)-1,-1,-1):
+ if __all__[_i][0] == "_":
+ del __all__[_i]
+ del _i
Index: string.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/string.py,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -r1.57 -r1.58
*** string.py 2001/02/09 20:18:41 1.57
--- string.py 2001/02/15 22:15:14 1.58
***************
*** 380,381 ****
--- 380,387 ----
except ImportError:
pass # Use the original versions
+
+ __all__ = locals().keys()
+ for _i in range(len(__all__)-1,-1,-1):
+ if __all__[_i][0] == "_":
+ del __all__[_i]
+ del _i