diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-05-12 21:42:13 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-05-12 21:42:13 +0000 |
commit | 236819310db3fe6f2fb22d48b780fa6ec253b6c7 (patch) | |
tree | ce5ca9792381d9ced99e8e871324891ddbeb0e28 /Lib | |
parent | f9b54c24114b15ff920249244fe361aee276c248 (diff) | |
download | cpython-git-236819310db3fe6f2fb22d48b780fa6ec253b6c7.tar.gz |
Add warnings to and deprecated all those Mac modules
Diffstat (limited to 'Lib')
37 files changed, 139 insertions, 7 deletions
diff --git a/Lib/plat-mac/Audio_mac.py b/Lib/plat-mac/Audio_mac.py index fd96095ad6..3c8a74c20c 100644 --- a/Lib/plat-mac/Audio_mac.py +++ b/Lib/plat-mac/Audio_mac.py @@ -1,6 +1,9 @@ QSIZE = 100000 error='Audio_mac.error' +from warnings import warnpy3k +warnpy3k("In 3.x, the Play_Audio_mac module is removed.") + class Play_Audio_mac: def __init__(self, qsize=QSIZE): diff --git a/Lib/plat-mac/Carbon/__init__.py b/Lib/plat-mac/Carbon/__init__.py index 8018c18244..664dceccea 100644 --- a/Lib/plat-mac/Carbon/__init__.py +++ b/Lib/plat-mac/Carbon/__init__.py @@ -2,3 +2,6 @@ import warnings warnings.filterwarnings("ignore", "", FutureWarning, ".*Controls") warnings.filterwarnings("ignore", "", FutureWarning, ".*MacTextEditor") + +from warnings import warnpy3k +warnpy3k("In 3.x, Carbon is removed.") diff --git a/Lib/plat-mac/EasyDialogs.py b/Lib/plat-mac/EasyDialogs.py index 3cafbb7bf0..f3d7e78cd4 100644 --- a/Lib/plat-mac/EasyDialogs.py +++ b/Lib/plat-mac/EasyDialogs.py @@ -18,6 +18,9 @@ This module uses DLOG resources 260 and on. Based upon STDWIN dialogs with the same names and functions. """ +from warnings import warnpy3k +warnpy3k("In 3.x, the EasyDialogs module is removed.") + from Carbon.Dlg import GetNewDialog, SetDialogItemText, GetDialogItemText, ModalDialog from Carbon import Qd from Carbon import QuickDraw diff --git a/Lib/plat-mac/FrameWork.py b/Lib/plat-mac/FrameWork.py index 4437cf871a..75588a6c4f 100644 --- a/Lib/plat-mac/FrameWork.py +++ b/Lib/plat-mac/FrameWork.py @@ -2,6 +2,9 @@ DEBUG=0 +from warnings import warnpy3k +warnpy3k("In 3.x, the FrameWork module is removed.") + import MacOS import traceback diff --git a/Lib/plat-mac/MiniAEFrame.py b/Lib/plat-mac/MiniAEFrame.py index 506c5cb1a8..7d2d5f598c 100644 --- a/Lib/plat-mac/MiniAEFrame.py +++ b/Lib/plat-mac/MiniAEFrame.py @@ -6,6 +6,9 @@ There are two classes: only suitable for the simplest of AppleEvent servers. """ +from warnings import warnpy3k +warnpy3k("In 3.x, the MiniAEFrame module is removed.") + import traceback import MacOS from Carbon import AE diff --git a/Lib/plat-mac/PixMapWrapper.py b/Lib/plat-mac/PixMapWrapper.py index 62297b34c7..45cb5f964a 100644 --- a/Lib/plat-mac/PixMapWrapper.py +++ b/Lib/plat-mac/PixMapWrapper.py @@ -5,6 +5,10 @@ Python Imaging Library Image object. J. Strout <joe@strout.net> February 1999""" + +from warnings import warnpy3k +warnpy3k("In 3.x, the PixMapWrapper module is removed.") + from Carbon import Qd from Carbon import QuickDraw import struct diff --git a/Lib/plat-mac/aepack.py b/Lib/plat-mac/aepack.py index d69534f4a2..b849c9da73 100644 --- a/Lib/plat-mac/aepack.py +++ b/Lib/plat-mac/aepack.py @@ -12,6 +12,9 @@ coerce(x, wanted_sample) coerces a python object to another python object # Apple Event Registry, chapter 9. # +from warnings import warnpy3k +warnpy3k("In 3.x, the aepack module is removed.") + import struct import types from types import * diff --git a/Lib/plat-mac/aetools.py b/Lib/plat-mac/aetools.py index c277b52d1d..9618b81d5f 100644 --- a/Lib/plat-mac/aetools.py +++ b/Lib/plat-mac/aetools.py @@ -21,6 +21,9 @@ files: the pack stuff from aepack, the objects from aetypes. """ +from warnings import warnpy3k +warnpy3k("In 3.x, the aetools module is removed.") + from types import * from Carbon import AE from Carbon import Evt diff --git a/Lib/plat-mac/aetypes.py b/Lib/plat-mac/aetypes.py index 65b59ad0ca..c6c9026cf8 100644 --- a/Lib/plat-mac/aetypes.py +++ b/Lib/plat-mac/aetypes.py @@ -1,5 +1,8 @@ """aetypes - Python objects representing various AE types.""" +from warnings import warnpy3k +warnpy3k("In 3.x, the aetypes module is removed.") + from Carbon.AppleEvents import * import struct from types import * diff --git a/Lib/plat-mac/applesingle.py b/Lib/plat-mac/applesingle.py index 76bdb0691c..0e2cf912ef 100644 --- a/Lib/plat-mac/applesingle.py +++ b/Lib/plat-mac/applesingle.py @@ -1,5 +1,9 @@ r"""Routines to decode AppleSingle files """ + +from warnings import warnpy3k +warnpy3k("In 3.x, the applesingle module is removed.") + import struct import sys try: diff --git a/Lib/plat-mac/appletrawmain.py b/Lib/plat-mac/appletrawmain.py index 1be9187907..7fc51d8fda 100644 --- a/Lib/plat-mac/appletrawmain.py +++ b/Lib/plat-mac/appletrawmain.py @@ -4,6 +4,10 @@ # This script is put into __rawmain__.pyc for applets that need argv # emulation, by BuildApplet and friends. # + +from warnings import warnpy3k +warnpy3k("In 3.x, the appletrawmain module is removed.") + import argvemulator import os import sys diff --git a/Lib/plat-mac/appletrunner.py b/Lib/plat-mac/appletrunner.py index 8d46c2ad27..b47fa424ec 100755 --- a/Lib/plat-mac/appletrunner.py +++ b/Lib/plat-mac/appletrunner.py @@ -3,6 +3,9 @@ # BuildApplet will use it as the main executable in the .app bundle if # we are not running in a framework build. +from warnings import warnpy3k +warnpy3k("In 3.x, appletrunner is removed.") + import os import sys for name in ["__rawmain__.py", "__rawmain__.pyc", "__main__.py", "__main__.pyc"]: diff --git a/Lib/plat-mac/argvemulator.py b/Lib/plat-mac/argvemulator.py index 2d66f1c748..1bc5da6d14 100644 --- a/Lib/plat-mac/argvemulator.py +++ b/Lib/plat-mac/argvemulator.py @@ -2,6 +2,9 @@ want unix-style arguments. """ +from warnings import warnpy3k +warnpy3k("In 3.x, the argvemulator module is removed.") + import sys import traceback from Carbon import AE diff --git a/Lib/plat-mac/bgenlocations.py b/Lib/plat-mac/bgenlocations.py index 271eb3e10a..7643e4bae8 100644 --- a/Lib/plat-mac/bgenlocations.py +++ b/Lib/plat-mac/bgenlocations.py @@ -7,6 +7,9 @@ import os +from warnings import warnpy3k +warnpy3k("In 3.x, the bgenlocations module is removed.") + Error = "bgenlocations.Error" # # Where bgen is. For unix-Python bgen isn't installed, so you have to refer to diff --git a/Lib/plat-mac/buildtools.py b/Lib/plat-mac/buildtools.py index 7462d9556c..0081e65a8f 100644 --- a/Lib/plat-mac/buildtools.py +++ b/Lib/plat-mac/buildtools.py @@ -1,5 +1,9 @@ """tools for BuildApplet and BuildApplication""" +import warnings +warnings.warn("the buildtools module is deprecated and is removed in 3.0", + DeprecationWarning, 2) + import sys import os import string @@ -14,9 +18,6 @@ import macresource import EasyDialogs import shutil -import warnings -warnings.warn("the buildtools module is deprecated", DeprecationWarning, 2) - BuildError = "BuildError" diff --git a/Lib/plat-mac/bundlebuilder.py b/Lib/plat-mac/bundlebuilder.py index 266b8455a0..46c17df6c8 100755 --- a/Lib/plat-mac/bundlebuilder.py +++ b/Lib/plat-mac/bundlebuilder.py @@ -28,6 +28,9 @@ this model: __all__ = ["BundleBuilder", "BundleBuilderError", "AppBuilder", "buildapp"] +from warnings import warnpy3k +warnpy3k("In 3.x, the bundlebuilder module is removed.") + import sys import os, errno, shutil import imp, marshal diff --git a/Lib/plat-mac/cfmfile.py b/Lib/plat-mac/cfmfile.py index 91ab0a61c8..309af8754a 100644 --- a/Lib/plat-mac/cfmfile.py +++ b/Lib/plat-mac/cfmfile.py @@ -5,15 +5,16 @@ __version__ = "0.8b3" __author__ = "jvr" +import warnings +warnings.warn("the cfmfile module is deprecated and is removed in 3,0", + DeprecationWarning, 2) + import Carbon.File import struct from Carbon import Res import os import sys -import warnings -warnings.warn("the cfmfile module is deprecated", DeprecationWarning, 2) - DEBUG = 0 error = "cfm.error" diff --git a/Lib/plat-mac/findertools.py b/Lib/plat-mac/findertools.py index 34dde9a9cf..038ee09b78 100644 --- a/Lib/plat-mac/findertools.py +++ b/Lib/plat-mac/findertools.py @@ -14,6 +14,10 @@ So bottom line: the processes() stuff does not work on < MacOS9 Mostly written by erik@letterror.com """ + +from warnings import warnpy3k +warnpy3k("In 3.x, the findertools module is removed.") + import Finder from Carbon import AppleEvents import aetools diff --git a/Lib/plat-mac/gensuitemodule.py b/Lib/plat-mac/gensuitemodule.py index 033bf9e69b..c92d1ebe9d 100644 --- a/Lib/plat-mac/gensuitemodule.py +++ b/Lib/plat-mac/gensuitemodule.py @@ -6,6 +6,9 @@ Based on aete.py. Reading and understanding this code is left as an exercise to the reader. """ +from warnings import warnpy3k +warnpy3k("In 3.x, the gensuitemodule module is removed.") + import MacOS import EasyDialogs import os diff --git a/Lib/plat-mac/ic.py b/Lib/plat-mac/ic.py index 46788c9262..beb8226026 100644 --- a/Lib/plat-mac/ic.py +++ b/Lib/plat-mac/ic.py @@ -1,5 +1,8 @@ """IC wrapper module, based on Internet Config 1.3""" +from warnings import warnpy3k +warnpy3k("In 3.x, the ic module is removed.") + import icglue import string import sys diff --git a/Lib/plat-mac/icopen.py b/Lib/plat-mac/icopen.py index eea6083797..7b8e8f372e 100644 --- a/Lib/plat-mac/icopen.py +++ b/Lib/plat-mac/icopen.py @@ -37,6 +37,9 @@ The next time you launch PythonInterpreter or Python IDE, the patch will take effect. """ +from warnings import warnpy3k +warnpy3k("In 3.x, the icopen module is removed.") + import __builtin__ _builtin_open = globals().get('_builtin_open', __builtin__.open) diff --git a/Lib/plat-mac/lib-scriptpackages/CodeWarrior/__init__.py b/Lib/plat-mac/lib-scriptpackages/CodeWarrior/__init__.py index 5ef7ca964c..89583d3c17 100644 --- a/Lib/plat-mac/lib-scriptpackages/CodeWarrior/__init__.py +++ b/Lib/plat-mac/lib-scriptpackages/CodeWarrior/__init__.py @@ -1,6 +1,10 @@ """ Package generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5 """ + +from warnings import warnpy3k +warnpy3k("In 3.x, the CodeWarrior package is removed.") + import aetools Error = aetools.Error import CodeWarrior_suite diff --git a/Lib/plat-mac/lib-scriptpackages/Explorer/__init__.py b/Lib/plat-mac/lib-scriptpackages/Explorer/__init__.py index a9b09b041d..8e9438a45b 100644 --- a/Lib/plat-mac/lib-scriptpackages/Explorer/__init__.py +++ b/Lib/plat-mac/lib-scriptpackages/Explorer/__init__.py @@ -1,6 +1,10 @@ """ Package generated from /Applications/Internet Explorer.app """ + +from warnings import warnpy3k +warnpy3k("In 3.x, the Explorer module is removed.") + import aetools Error = aetools.Error import Standard_Suite diff --git a/Lib/plat-mac/lib-scriptpackages/Finder/__init__.py b/Lib/plat-mac/lib-scriptpackages/Finder/__init__.py index 8782a4f81b..8c9b02691c 100644 --- a/Lib/plat-mac/lib-scriptpackages/Finder/__init__.py +++ b/Lib/plat-mac/lib-scriptpackages/Finder/__init__.py @@ -1,6 +1,10 @@ """ Package generated from /System/Library/CoreServices/Finder.app """ + +from warnings import warnpy3k +warnpy3k("In 3.x, the Finder package is removed.") + import aetools Error = aetools.Error import Standard_Suite diff --git a/Lib/plat-mac/lib-scriptpackages/Netscape/__init__.py b/Lib/plat-mac/lib-scriptpackages/Netscape/__init__.py index 0dc5398a06..7f0dfe24ce 100644 --- a/Lib/plat-mac/lib-scriptpackages/Netscape/__init__.py +++ b/Lib/plat-mac/lib-scriptpackages/Netscape/__init__.py @@ -1,6 +1,10 @@ """ Package generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2 """ + +from warnings import warnpy3k +warnpy3k("In 3.x, the Netscape package is removed.") + import aetools Error = aetools.Error import Standard_Suite diff --git a/Lib/plat-mac/lib-scriptpackages/StdSuites/__init__.py b/Lib/plat-mac/lib-scriptpackages/StdSuites/__init__.py index b80e3bacc2..15e03ec5d5 100644 --- a/Lib/plat-mac/lib-scriptpackages/StdSuites/__init__.py +++ b/Lib/plat-mac/lib-scriptpackages/StdSuites/__init__.py @@ -2,6 +2,10 @@ Package generated from /Volumes/Sap/System Folder/Extensions/AppleScript Resource aeut resid 0 Standard Event Suites for English """ + +from warnings import warnpy3k +warnpy3k("In 3.x, the StdSuites package is removed.") + import aetools Error = aetools.Error import Text_Suite diff --git a/Lib/plat-mac/lib-scriptpackages/SystemEvents/__init__.py b/Lib/plat-mac/lib-scriptpackages/SystemEvents/__init__.py index 95f985cccc..8029224fdc 100644 --- a/Lib/plat-mac/lib-scriptpackages/SystemEvents/__init__.py +++ b/Lib/plat-mac/lib-scriptpackages/SystemEvents/__init__.py @@ -1,6 +1,10 @@ """ Package generated from /System/Library/CoreServices/System Events.app """ + +from warnings import warnpy3k +warnpy3k("In 3.x, the SystemEvents package is removed.") + import aetools Error = aetools.Error import Standard_Suite diff --git a/Lib/plat-mac/lib-scriptpackages/Terminal/__init__.py b/Lib/plat-mac/lib-scriptpackages/Terminal/__init__.py index 47b75f2aeb..5aa8a1e788 100644 --- a/Lib/plat-mac/lib-scriptpackages/Terminal/__init__.py +++ b/Lib/plat-mac/lib-scriptpackages/Terminal/__init__.py @@ -1,6 +1,10 @@ """ Package generated from /Applications/Utilities/Terminal.app """ + +from warnings import warnpy3k +warnpy3k("In 3.x, the Terminal module is removed.") + import aetools Error = aetools.Error import Standard_Suite diff --git a/Lib/plat-mac/lib-scriptpackages/_builtinSuites/__init__.py b/Lib/plat-mac/lib-scriptpackages/_builtinSuites/__init__.py index 2c722d9f54..5061204103 100644 --- a/Lib/plat-mac/lib-scriptpackages/_builtinSuites/__init__.py +++ b/Lib/plat-mac/lib-scriptpackages/_builtinSuites/__init__.py @@ -4,6 +4,10 @@ suites. This is needed because the events and enums in this suite belong in the Required suite according to the Apple docs, but they often seem to be in the Standard suite. """ + +from warnings import warnpy3k +warnpy3k("In 3.x, the _builtinSuites module is removed.") + import aetools import builtin_Suite diff --git a/Lib/plat-mac/macerrors.py b/Lib/plat-mac/macerrors.py index a7b3feea10..9629a0f05c 100644 --- a/Lib/plat-mac/macerrors.py +++ b/Lib/plat-mac/macerrors.py @@ -1,4 +1,8 @@ # -coding=latin1- + +from warnings import warnpy3k +warnpy3k("In 3.x, the macerrors module is removed.") + svTempDisable = -32768 #svTempDisable svDisabled = -32640 #Reserve range -32640 to -32768 for Apple temp disables. fontNotOutlineErr = -32615 #bitmap font passed to routine that does outlines only diff --git a/Lib/plat-mac/macostools.py b/Lib/plat-mac/macostools.py index 67bb497182..643ba67c08 100644 --- a/Lib/plat-mac/macostools.py +++ b/Lib/plat-mac/macostools.py @@ -4,6 +4,9 @@ mkalias(src, dst) - Create a finder alias 'dst' pointing to 'src' copy(src, dst) - Full copy of 'src' to 'dst' """ +from warnings import warnpy3k +warnpy3k("In 3.x, the macostools module is removed.") + from Carbon import Res from Carbon import File, Files import os diff --git a/Lib/plat-mac/macresource.py b/Lib/plat-mac/macresource.py index f68ecdc8a8..0a66d76ae7 100644 --- a/Lib/plat-mac/macresource.py +++ b/Lib/plat-mac/macresource.py @@ -1,5 +1,8 @@ """macresource - Locate and open the resources needed for a script.""" +from warnings import warnpy3k +warnpy3k("In 3.x, the macresource module is removed.") + from Carbon import Res import os import sys diff --git a/Lib/plat-mac/pimp.py b/Lib/plat-mac/pimp.py index e58f36d4ad..b3138bd278 100644 --- a/Lib/plat-mac/pimp.py +++ b/Lib/plat-mac/pimp.py @@ -12,6 +12,10 @@ dependencies and installing packages. There is a minimal main program that works as a command line tool, but the intention is that the end user will use this through a GUI. """ + +from warnings import warnpy3k +warnpy3k("In 3.x, the pimp module is removed.") + import sys import os import subprocess diff --git a/Lib/plat-mac/terminalcommand.py b/Lib/plat-mac/terminalcommand.py index 480797b42a..238781a247 100644 --- a/Lib/plat-mac/terminalcommand.py +++ b/Lib/plat-mac/terminalcommand.py @@ -14,6 +14,9 @@ with a decent input/output window. # Mac/OSX/PythonLauncher/doscript.m. # +from warnings import warnpy3k +warnpy3k("In 3.x, the terminalcommand module is removed.") + import time import os from Carbon import AE diff --git a/Lib/plat-mac/videoreader.py b/Lib/plat-mac/videoreader.py index 952b919c33..43027d4cc3 100644 --- a/Lib/plat-mac/videoreader.py +++ b/Lib/plat-mac/videoreader.py @@ -5,6 +5,11 @@ # # Jack Jansen, August 2000 # + +from warnings import warnpy3k +warnpy3k("In 3.x, the videoreader module is removed.") + + import sys from Carbon import Qt from Carbon import QuickTime diff --git a/Lib/plistlib.py b/Lib/plistlib.py index 0ce5333334..31d1e75fdf 100644 --- a/Lib/plistlib.py +++ b/Lib/plistlib.py @@ -62,6 +62,7 @@ import binascii import datetime from cStringIO import StringIO import re +import warnings def readPlist(pathOrFile): @@ -113,6 +114,7 @@ def writePlistToString(rootObject): def readPlistFromResource(path, restype='plst', resid=0): """Read plst resource from the resource fork of path. """ + warnings.warnpy3k("In 3.x, readPlistFromResource is removed.") from Carbon.File import FSRef, FSGetResourceForkName from Carbon.Files import fsRdPerm from Carbon import Res @@ -127,6 +129,7 @@ def readPlistFromResource(path, restype='plst', resid=0): def writePlistToResource(rootObject, path, restype='plst', resid=0): """Write 'rootObject' as a plst resource to the resource fork of path. """ + warnings.warnpy3k("In 3.x, writePlistToResource is removed.") from Carbon.File import FSRef, FSGetResourceForkName from Carbon.Files import fsRdWrPerm from Carbon import Res diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py index 3fa16db6c1..39086e9cd9 100644 --- a/Lib/test/test_py3kwarn.py +++ b/Lib/test/test_py3kwarn.py @@ -131,7 +131,19 @@ class TestStdlibRemovals(unittest.TestCase): all_platforms = ('audiodev', 'imputil', 'mutex', 'user', 'new', 'rexec', 'Bastion', 'compiler', 'dircache', 'fpformat', 'ihooks', 'mhlib') - inclusive_platforms = {'irix':('pure',)} + inclusive_platforms = {'irix' : ('pure',), + 'darwin' : ('autoGIL', 'Carbon', 'OSATerminology', + 'icglue', 'Nav', 'MacOS', 'aepack', 'aetools' + 'aetypes', 'applesingle', 'appletrawmain', + 'appletrunner', 'argvemulator', 'bgenlocations', + 'EasyDialogs', 'macerrors', 'macostools', + 'findertools', 'FrameWork', 'ic', + 'gensuitemodule', 'icopen', 'macresource', + 'MiniAEFrame', 'pimp', 'PixMapWrapper', + 'terminalcommand', 'videoreader', '_builtinSuites', + 'CodeWarrior', 'Explorer', 'Finder', 'Netscape', + 'StdSuites', 'SystemEvents', 'Terminal', 'cfmfile', + 'bundlebuilder', 'buildtools', 'ColorPicker')} optional_modules = ('bsddb185', 'Canvas', 'dl', 'linuxaudiodev', 'imageop', 'sv') |