]> granicus.if.org Git - python/commitdiff
bunch more __all__ lists
authorSkip Montanaro <skip@pobox.com>
Thu, 15 Feb 2001 22:15:14 +0000 (22:15 +0000)
committerSkip Montanaro <skip@pobox.com>
Thu, 15 Feb 2001 22:15:14 +0000 (22:15 +0000)
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)

28 files changed:
Lib/pre.py
Lib/random.py
Lib/re.py
Lib/reconvert.py
Lib/regex_syntax.py
Lib/regsub.py
Lib/repr.py
Lib/rexec.py
Lib/rfc822.py
Lib/rlcompleter.py
Lib/sched.py
Lib/sgmllib.py
Lib/shelve.py
Lib/shlex.py
Lib/shutil.py
Lib/smtpd.py
Lib/smtplib.py
Lib/sndhdr.py
Lib/socket.py
Lib/sre.py
Lib/sre_compile.py
Lib/sre_constants.py
Lib/sre_parse.py
Lib/stat.py
Lib/statcache.py
Lib/statvfs.py
Lib/string.py
Lib/test/test___all__.py

index 30f049193d83512a3d466f412a99fe52e0c17f41..a3188fec9d6e8be5f08ce15b49ec0d26cf180ecb 100644 (file)
@@ -87,7 +87,9 @@ This module also defines an exception 'error'.
 import sys
 from pcre import *
 
-__all__ = ["match","search","sub","subn","split","findall","escape","compile"]
+__all__ = ["match","search","sub","subn","split","findall","escape","compile",
+           "I","L","M","S","X","IGNORECASE","LOCALE","MULTILINE","DOTALL",
+           "VERBOSE","error"]
 
 #
 # First, the public part of the interface:
index f470402c71b2ffc2ca01dce860b2c68ec0515681..efaf7d6898102e9b68f43d16cd7746e5c1a6dba2 100644 (file)
@@ -76,6 +76,12 @@ used to "move backward in time":
 from math import log as _log, exp as _exp, pi as _pi, e as _e
 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)
     if abs(computed - expected) > 1e-7:
index 6d75bb9c43783935930936146ee2bfd3cec7cb59..b125b2035421addf667fa7d2f1a5e134b2da6a56 100644 (file)
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -26,7 +26,9 @@ engine = "sre"
 if engine == "sre":
     # 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 840c5d96bdbd4bc60e54798916f6cdbab3491fea..59708dac9f04a9d7eb9bfef5411a776706b40baf 100755 (executable)
@@ -63,6 +63,8 @@ XXX To be done...
 import regex
 from regex_syntax import * # RE_*
 
+__all__ = ["convert","quote"]
+
 # Default translation table
 mastertable = {
     r'\<': r'\b',
index b0a0dbf20c45f0dc2f8014d97430ebb4c9756471..421ffd9b9f339c2814762f4da39a2dfd84894423 100644 (file)
@@ -51,3 +51,9 @@ RE_SYNTAX_GREP = (RE_BK_PLUS_QM | RE_NEWLINE_OR)
 RE_SYNTAX_EMACS = 0
 
 # (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 de833d510743e8cd22efe932353c02588b823bdc..a86819f58fa25e0893fce8fbdd246e06d9745fdc 100644 (file)
@@ -19,6 +19,7 @@ warnings.filterwarnings("ignore", "", DeprecationWarning, __name__)
 
 import regex
 
+__all__ = ["sub","gsub","split","splitx","capwords"]
 
 # Replace first occurrence of pattern pat in string str by replacement
 # repl.  If the pattern isn't found, the string is returned unchanged.
index 9f7ed86b738070f093380dc5764143dd0eab192e..c2d3ed59f4e311cd8a6e94e2d176332818b7029a 100644 (file)
@@ -1,5 +1,7 @@
 """Redo the `...` (representation) but with limits on most sizes."""
 
+__all__ = ["Repr","repr"]
+
 class Repr:
     def __init__(self):
         self.maxlevel = 6
index 57ea599cf34bd66e8b226f24c5d64e240c9fad7f..6a7c2071a016d787b9ac98e86ebc6b0d56085f61 100644 (file)
@@ -23,6 +23,7 @@ import __builtin__
 import os
 import ihooks
 
+__all__ = ["RExec"]
 
 class FileBase:
 
index 89de69a528d5e95f46a2a9a1baa6fe4a91613b62..101013dfb04cbfde91556d1f0f639fff9c322a4c 100644 (file)
@@ -59,6 +59,7 @@ There are also some utility functions here.
 
 import time
 
+__all__ = ["Message","AddressList","parsedate","parsedate_tz","mktime_tz"]
 
 _blanklines = ('\r\n', '\n')            # Optimization for islast()
 
index 8cd21ed18a621d877b865c6525a57e2c818f0aaa..4f05ba30d77236282c2ce7a1f388ee935de32c0b 100644 (file)
@@ -43,6 +43,8 @@ import readline
 import __builtin__
 import __main__
 
+__all__ = ["Completer"]
+
 class Completer:
 
     def complete(self, text, state):
index fc5bd562ff7140e2dbac312b0be44f382ea5a3d9..ba5f33a6ae1e0bacc4ba3cdc0fddc21bcc68c8f3 100644 (file)
@@ -30,6 +30,8 @@ Parameterless functions or methods cannot be used, however.
 
 import bisect
 
+__all__ = ["scheduler"]
+
 class scheduler:
     def __init__(self, timefunc, delayfunc):
         """Initialize a new instance, passing the time and delay
index 501fe36d79d2968e08471df84b615df002b4d840..30acafd55b868a64e54dea1647487ae31c04a6ba 100644 (file)
@@ -11,6 +11,7 @@
 import re
 import string
 
+__all__ = ["SGMLParser"]
 
 # Regular expressions used for parsing
 
index 952df16f6e9cfb83b2f9c7be012ff874be880169..fa2a136dcb4e12418596212a08b7dba53035b501 100644 (file)
@@ -40,6 +40,7 @@ try:
 except ImportError:
     from StringIO import StringIO
 
+__all__ = ["Shelf","BsdDbShelf","DbfilenameShelf","open"]
 
 class Shelf:
     """Base class for shelf implementations.
index d90a0b9dc47db34ad8ff483cb11e138924fa908e..97b8f2e5c041a678829bc1440b4eb1c55d7e1b62 100644 (file)
@@ -7,6 +7,8 @@
 import os.path
 import sys
 
+__all__ = ["shlex"]
+
 class shlex:
     "A lexical analyzer class for simple shell-like syntaxes."
     def __init__(self, instream=None, infile=None):
index e0539179454474813965ea03c4d688bc868c4e44..6e3a27639e5adeefdfdd4e8c4c43b4dcade5f65e 100644 (file)
@@ -8,6 +8,8 @@ import os
 import sys
 import stat
 
+__all__ = ["copyfileobj","copyfile","copymode","copystat","copy","copy2",
+           "copytree","rmtree"]
 
 def copyfileobj(fsrc, fdst, length=16*1024):
     """copy data from file-like object fsrc to file-like object fdst"""
index 3d94b97aaa50f0d1e8d62184ceec87d85866af4b..c04c4990cfcad6f6fe08fc061dc2e01e1c8c117a 100755 (executable)
@@ -75,6 +75,7 @@ import socket
 import asyncore
 import asynchat
 
+__all__ = ["SMTPServer","DebuggingServer","PureProxy","MailmanProxy"]
 
 program = sys.argv[0]
 __version__ = 'Python SMTP proxy version 0.2'
index 1af406883a5c51e8d67a457048507f2e87143025..f1e4a27ff3bfd7b7aca47ca6e9925efb03ab8077 100755 (executable)
@@ -44,6 +44,11 @@ import re
 import rfc822
 import types
 
+__all__ = ["SMTPException","SMTPServerDisconnected","SMTPResponseException",
+           "SMTPSenderRefused","SMTPRecipientsRefused","SMTPDataError",
+           "SMTPConnectError","SMTPHeloError","quoteaddr","quotedata",
+           "SMTP"]
+
 SMTP_PORT = 25
 CRLF="\r\n"
 
index 61cd5b3710e502ccd9274afe80e3516180911bc0..29f0760c9e412775e2bb44fe6369f6b12cfaf043 100644 (file)
@@ -30,6 +30,7 @@ explicitly given directories.
 # The file structure is top-down except that the test program and its
 # subroutine come last.
 
+__all__ = ["what","whathdr"]
 
 def what(filename):
     """Guess the type of a sound file"""
index bff5514238498bff5cb54156f0c8a2e495a7f8cf..c928700c4d3ac55a0452fbbae70b1c1d7f13ccdd 100644 (file)
@@ -42,6 +42,11 @@ from _socket import *
 
 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 45333543fb656c606224a68be76d47c5102f232d..061d8e8e3e686836d0184dc486a206035881f69b 100644 (file)
 import sre_compile
 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
 L = LOCALE = sre_compile.SRE_FLAG_LOCALE # assume current 8-bit locale
index ab2a2cc9ad265e6042858ecef03ce78b9ce61d1f..18dee886011c45c8531f9313960f499dd4c909f4 100644 (file)
@@ -12,6 +12,8 @@ import _sre
 
 from sre_constants import *
 
+__all__ = ["compile"]
+
 assert _sre.MAGIC == MAGIC, "SRE module mismatch"
 
 MAXCODE = 65535
index 7aedab15724de0186c018a718920344b06d00f95..e14fa172f6c9aafa47f173e53346767795d0167c 100644 (file)
@@ -194,6 +194,12 @@ SRE_INFO_PREFIX = 1 # has prefix
 SRE_INFO_LITERAL = 2 # entire pattern is literal (given by prefix)
 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):
         items = d.items()
index 635605de676146b18bae9d8e488793ff9216bd8d..fc3c4928bce772f19e00131ec4180614c3cd57bd 100644 (file)
@@ -14,6 +14,9 @@ import sys
 
 from sre_constants import *
 
+__all__ = ["Pattern","SubPattern","Tokenizer","parse","parse_template",
+           "expand_template"]
+
 SPECIAL_CHARS = ".\\[{()*+?^$|"
 REPEAT_CHARS = "*+?{"
 
index 70750d8b1ae909039c1e95d37ccab60b2f0096b0..f0ffabed431ae8ffbc4bf6e4e3bc1c68b40e2e4e 100644 (file)
@@ -84,3 +84,9 @@ S_IRWXO = 00007
 S_IROTH = 00004
 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 056ec4039dcaa5c59ba04da02f5ca070441a5beb..3123418ca4f62439c337bf742498b76d2b6c8b31 100644 (file)
@@ -6,6 +6,9 @@ There are functions to reset the cache or to selectively remove items.
 import os as _os
 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
 # cache.has_key(path) returns 1 doesn't mean the cache will still contain
index 06a323fa63c81b74c8db65221fa12c698e4c2818..b3d8e971b657f2e5d1a6ce90c7548acd8ec3d085 100644 (file)
@@ -13,3 +13,9 @@ F_FFREE   = 6           # Total number of free file nodes
 F_FAVAIL  = 7           # Free nodes available to non-superuser
 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 913d980bae6df9425f1c1cda80fd5de6dfbeb18f..45fe97740902eebcd4986c5b1126402ee5718131 100644 (file)
@@ -379,3 +379,9 @@ try:
     letters = lowercase + uppercase
 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
index 875d99d7444f9fcfb01d461d73479c72c647d5f3..b2ea498eb4cab4a23b7b9e84e9eb4a34e43af691 100644 (file)
@@ -2,6 +2,9 @@ from test_support import verify, verbose
 import sys
 
 def check_all(modname):
+    import warnings
+    warnings.filterwarnings("ignore", "", DeprecationWarning, modname)
+
     names = {}
     try:
         exec "import %s" % modname in names
@@ -124,4 +127,30 @@ check_all("pty")
 check_all("py_compile")
 check_all("pyclbr")
 check_all("quopri")
+check_all("random")
+check_all("re")
+check_all("reconvert")
+check_all("regex_syntax")
+check_all("regsub")
+check_all("repr")
+check_all("rexec")
+check_all("rfc822")
+check_all("rlcompleter")
 check_all("robotparser")
+check_all("sched")
+check_all("sgmllib")
+check_all("shelve")
+check_all("shlex")
+check_all("shutil")
+check_all("smtpd")
+check_all("smtplib")
+check_all("sndhdr")
+check_all("socket")
+check_all("sre")
+check_all("sre_compile")
+check_all("sre_constants")
+check_all("sre_parse")
+check_all("stat")
+check_all("stat_cache")
+check_all("statvfs")
+check_all("string")