diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2003-01-21 22:58:39 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2003-01-21 22:58:39 (GMT) |
commit | 374c43574afd1c76a6b0b0aa8d1b1444ee3c7f4b (patch) | |
tree | 1da9167f4b4e69e0e21890aa2ba7a032c26ab777 /Lib | |
parent | e1c4f0b2006c06e5400ede67f2f77b9f1598c580 (diff) | |
download | cpython-374c43574afd1c76a6b0b0aa8d1b1444ee3c7f4b.zip cpython-374c43574afd1c76a6b0b0aa8d1b1444ee3c7f4b.tar.gz cpython-374c43574afd1c76a6b0b0aa8d1b1444ee3c7f4b.tar.bz2 |
Added DepracationWarnings to the old Standard File calls.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/plat-mac/macfs.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/plat-mac/macfs.py b/Lib/plat-mac/macfs.py index b960ed4..5866732 100644 --- a/Lib/plat-mac/macfs.py +++ b/Lib/plat-mac/macfs.py @@ -6,6 +6,7 @@ import struct import Carbon.Res import Carbon.File import Nav +import warnings # First step: ensure we also emulate the MACFS module, which contained # all the constants @@ -143,6 +144,8 @@ def PromptGetFile(prompt, *typelist): """Ask for an input file giving the user a prompt message. Optionally you can specifying 4-char file types that are allowable""" import EasyDialogs + warnings.warn("macfs.StandardGetFile and friends are deprecated, use EasyDialogs.AskFileForOpen", + DeprecationWarning, stacklevel=2) if not typelist: typelist = None fss = EasyDialogs.AskFileForOpen(message=prompt, wanted=FSSpec, @@ -153,12 +156,16 @@ def StandardPutFile(prompt, default=None): """Ask the user for an output file, with a prompt. Optionally you cn supply a default output filename""" import EasyDialogs + warnings.warn("macfs.StandardGetFile and friends are deprecated, use EasyDialogs.AskFileForOpen", + DeprecationWarning, stacklevel=2) fss = EasyDialogs.AskFileForSave(wanted=FSSpec, message=prompt, savedFileName=default, defaultLocation=_handleSetFolder()) return fss, not fss is None def SetFolder(folder): global _curfolder + warnings.warn("macfs.StandardGetFile and friends are deprecated, use EasyDialogs.AskFileForOpen", + DeprecationWarning, stacklevel=2) if _curfolder: rv = FSSpec(_curfolder) else: @@ -175,6 +182,8 @@ def _handleSetFolder(): def GetDirectory(prompt=None): """Ask the user to select a folder. Optionally you can give a prompt.""" import EasyDialogs + warnings.warn("macfs.StandardGetFile and friends are deprecated, use EasyDialogs.AskFileForOpen", + DeprecationWarning, stacklevel=2) fss = EasyDialogs.AskFolder(message=prompt, wanted=FSSpec, defaultLocation=_handleSetFolder()) return fss, not fss is None |