diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-08-25 12:15:04 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-08-25 12:15:04 (GMT) |
commit | 5a6fdcd3718927109592c6df692fe24a8fdaee31 (patch) | |
tree | 3816c4cbfcf1533dee55a48a8eec2c3557ae44cc | |
parent | 6dba6bc0a226c2dd384d9311b9ad842be653c2b5 (diff) | |
download | cpython-5a6fdcd3718927109592c6df692fe24a8fdaee31.zip cpython-5a6fdcd3718927109592c6df692fe24a8fdaee31.tar.gz cpython-5a6fdcd3718927109592c6df692fe24a8fdaee31.tar.bz2 |
Import the MacOS toolbox modules from the Carbon package.
100 files changed, 336 insertions, 331 deletions
diff --git a/Mac/Contrib/BBPy/PythonSlave.py b/Mac/Contrib/BBPy/PythonSlave.py index 3014f7a..08baf7e 100644 --- a/Mac/Contrib/BBPy/PythonSlave.py +++ b/Mac/Contrib/BBPy/PythonSlave.py @@ -14,14 +14,14 @@ import sys import traceback import aetools import string -import AE -import EasyDialogs +from Carbon import AE +from Carbon import EasyDialogs import os -import Qd +from Carbon import Qd from Types import * -from Events import charCodeMask, cmdKey +from Carbon.Events import charCodeMask, cmdKey import MacOS -import Evt +from Carbon import Evt def dummyfunc(): pass diff --git a/Mac/Contrib/ImageHelpers/ImageMac.py b/Mac/Contrib/ImageHelpers/ImageMac.py index 3e46532..44a38c5 100644 --- a/Mac/Contrib/ImageHelpers/ImageMac.py +++ b/Mac/Contrib/ImageHelpers/ImageMac.py @@ -21,7 +21,7 @@ Being one of my first experiences with Python I didn't use Exceptions to signal ''' import W -import Qd +from Carbon import Qd from ExtPixMapWrapper import * from Numeric import * import Image diff --git a/Mac/Contrib/ImageHelpers/MovieUtils.py b/Mac/Contrib/ImageHelpers/MovieUtils.py index 7c9130f..8250a82 100644 --- a/Mac/Contrib/ImageHelpers/MovieUtils.py +++ b/Mac/Contrib/ImageHelpers/MovieUtils.py @@ -1,10 +1,10 @@ -import Qt -import QuickTime +from Carbon import Qt +from Carbon import QuickTime import macfs -import Qd -from QuickDraw import srcCopy +from Carbon import Qd +from Carbon.QuickDraw import srcCopy from ExtPixMapWrapper import ExtPixMapWrapper -from Qdoffs import * +from Carbon.Qdoffs import * import ImageMac import W diff --git a/Mac/Contrib/PythonScript/PythonScript.py b/Mac/Contrib/PythonScript/PythonScript.py index b6077ae..731db98 100644 --- a/Mac/Contrib/PythonScript/PythonScript.py +++ b/Mac/Contrib/PythonScript/PythonScript.py @@ -10,7 +10,7 @@ import sys import getaete import baetools import baetypes -import AE +from Carbon import AE import AppleEvents import macfs from types import * diff --git a/Mac/Contrib/PythonScript/baepack.py b/Mac/Contrib/PythonScript/baepack.py index 26267ac..39e064b 100644 --- a/Mac/Contrib/PythonScript/baepack.py +++ b/Mac/Contrib/PythonScript/baepack.py @@ -17,8 +17,8 @@ import string import types from string import strip from types import * -import AE -from AppleEvents import * +from Carbon import AE +from Carbon.AppleEvents import * import MacOS import macfs import StringIO @@ -195,7 +195,7 @@ def unpack(desc): v = 0x100000000L + v return v if t == typeObjectSpecifier: - import Res + from Carbon import Res # print desc, type(desc) # print desc.__members__ # print desc.data, desc.type diff --git a/Mac/Contrib/PythonScript/baetools.py b/Mac/Contrib/PythonScript/baetools.py index 8f0bb04..acc00a6 100644 --- a/Mac/Contrib/PythonScript/baetools.py +++ b/Mac/Contrib/PythonScript/baetools.py @@ -21,8 +21,8 @@ files: the pack stuff from aepack, the objects from aetypes. """ from types import * -import AE -import AppleEvents +from Carbon import AE +from Carbon import AppleEvents import MacOS import sys diff --git a/Mac/Contrib/PythonScript/baetypes.py b/Mac/Contrib/PythonScript/baetypes.py index 1d8266d..9b50e78 100644 --- a/Mac/Contrib/PythonScript/baetypes.py +++ b/Mac/Contrib/PythonScript/baetypes.py @@ -1,6 +1,6 @@ """aetypes - Python objects representing various AE types.""" -from AppleEvents import * +from Carbon.AppleEvents import * import struct from types import * import string diff --git a/Mac/Contrib/PythonScript/getaete.py b/Mac/Contrib/PythonScript/getaete.py index 14beb32..ba22c9d 100644 --- a/Mac/Contrib/PythonScript/getaete.py +++ b/Mac/Contrib/PythonScript/getaete.py @@ -18,7 +18,7 @@ import types from MACFS import * import macfs import string -from Res import * +from Carbon.Res import * import struct # for testing only diff --git a/Mac/Contrib/PythonScript/printaete.py b/Mac/Contrib/PythonScript/printaete.py index a7fe8e0..b105d8a 100644 --- a/Mac/Contrib/PythonScript/printaete.py +++ b/Mac/Contrib/PythonScript/printaete.py @@ -14,7 +14,7 @@ import types import macfs import string import macpath -from Res import * +from Carbon.Res import * # for testing only app = 'MACS'#CSOm'#'nwSP'#'ezVu'# diff --git a/Mac/Demo/PICTbrowse/ICONbrowse.py b/Mac/Demo/PICTbrowse/ICONbrowse.py index 865ff9e..162fcb6 100644 --- a/Mac/Demo/PICTbrowse/ICONbrowse.py +++ b/Mac/Demo/PICTbrowse/ICONbrowse.py @@ -2,14 +2,14 @@ import FrameWork import EasyDialogs -import Res -import Qd -import Win -import Controls -import List +from Carbon import Res +from Carbon import Qd +from Carbon import Win +from Carbon import Controls +from Carbon import List import sys import struct -import Icn +from Carbon import Icn # # Resource definitions diff --git a/Mac/Demo/PICTbrowse/PICTbrowse.py b/Mac/Demo/PICTbrowse/PICTbrowse.py index da32b50..e45b18c 100644 --- a/Mac/Demo/PICTbrowse/PICTbrowse.py +++ b/Mac/Demo/PICTbrowse/PICTbrowse.py @@ -2,11 +2,11 @@ import FrameWork import EasyDialogs -import Res -import Qd -import Win -import Controls -import List +from Carbon import Res +from Carbon import Qd +from Carbon import Win +from Carbon import Controls +from Carbon import List import sys import struct diff --git a/Mac/Demo/PICTbrowse/PICTbrowse2.py b/Mac/Demo/PICTbrowse/PICTbrowse2.py index 56440f2..7e146ed 100644 --- a/Mac/Demo/PICTbrowse/PICTbrowse2.py +++ b/Mac/Demo/PICTbrowse/PICTbrowse2.py @@ -2,11 +2,11 @@ import FrameWork import EasyDialogs -import Res -import Qd -import Win -import Controls -import List +from Carbon import Res +from Carbon import Qd +from Carbon import Win +from Carbon import Controls +from Carbon import List import sys import struct diff --git a/Mac/Demo/PICTbrowse/cicnbrowse.py b/Mac/Demo/PICTbrowse/cicnbrowse.py index 47cd472..89f8218 100644 --- a/Mac/Demo/PICTbrowse/cicnbrowse.py +++ b/Mac/Demo/PICTbrowse/cicnbrowse.py @@ -2,14 +2,14 @@ import FrameWork import EasyDialogs -import Res -import Qd -import Win -import Controls -import List +from Carbon import Res +from Carbon import Qd +from Carbon import Win +from Carbon import Controls +from Carbon import List import sys import struct -import Icn +from Carbon import Icn # # Resource definitions diff --git a/Mac/Demo/PICTbrowse/oldPICTbrowse.py b/Mac/Demo/PICTbrowse/oldPICTbrowse.py index 0012958..01cf71c 100644 --- a/Mac/Demo/PICTbrowse/oldPICTbrowse.py +++ b/Mac/Demo/PICTbrowse/oldPICTbrowse.py @@ -2,10 +2,10 @@ import FrameWork import EasyDialogs -import Res -import Qd -import Win -import List +from Carbon import Res +from Carbon import Qd +from Carbon import Win +from Carbon import List import sys import struct diff --git a/Mac/Demo/calldll/testcalldll.py b/Mac/Demo/calldll/testcalldll.py index ef176d8..cdb24c3 100644 --- a/Mac/Demo/calldll/testcalldll.py +++ b/Mac/Demo/calldll/testcalldll.py @@ -2,7 +2,7 @@ import calldll import macfs import sys import MacOS -import Res +from Carbon import Res fss, ok = macfs.PromptGetFile("Show me calldll.ppc.slb") diff --git a/Mac/Demo/example1/dnslookup-1.py b/Mac/Demo/example1/dnslookup-1.py index 294faad..9a2ab28 100644 --- a/Mac/Demo/example1/dnslookup-1.py +++ b/Mac/Demo/example1/dnslookup-1.py @@ -2,8 +2,8 @@ Res and Dlg in the process""" import EasyDialogs -import Res -import Dlg +from Carbon import Res +from Carbon import Dlg import sys import socket import string diff --git a/Mac/Demo/example2/dnslookup-2.py b/Mac/Demo/example2/dnslookup-2.py index e595b8e..20e7fa5 100644 --- a/Mac/Demo/example2/dnslookup-2.py +++ b/Mac/Demo/example2/dnslookup-2.py @@ -1,7 +1,7 @@ import FrameWork import EasyDialogs -import Res -import Dlg +from Carbon import Res +from Carbon import Dlg import sys import socket import string diff --git a/Mac/Demo/imgbrowse/imgbrowse.py b/Mac/Demo/imgbrowse/imgbrowse.py index ab9b429..c67f4e8 100644 --- a/Mac/Demo/imgbrowse/imgbrowse.py +++ b/Mac/Demo/imgbrowse/imgbrowse.py @@ -2,11 +2,11 @@ import FrameWork import EasyDialogs -import Res -import Qd -import QuickDraw -import Win -#import List +from Carbon import Res +from Carbon import Qd +from Carbon import QuickDraw +from Carbon import Win +#ifrom Carbon mport List import sys import struct import img diff --git a/Mac/Demo/imgbrowse/mac_image.py b/Mac/Demo/imgbrowse/mac_image.py index 4e3881f..094c58e 100644 --- a/Mac/Demo/imgbrowse/mac_image.py +++ b/Mac/Demo/imgbrowse/mac_image.py @@ -1,6 +1,6 @@ """mac_image - Helper routines (hacks) for images""" import imgformat -import Qd +from Carbon import Qd import time import struct import MacOS diff --git a/Mac/Demo/mlte/mlted.py b/Mac/Demo/mlte/mlted.py index 10d5698..2ae77e7 100644 --- a/Mac/Demo/mlte/mlted.py +++ b/Mac/Demo/mlte/mlted.py @@ -5,15 +5,15 @@ from Menu import DrawMenuBar from FrameWork import * -import Win -import Ctl -import Qd -import Res -import Scrap +from Carbon import Win +from Carbon import Ctl +from Carbon import Qd +from Carbon import Res +from Carbon import Scrap import os import macfs -import MacTextEditor -import Mlte +from Carbon import MacTextEditor +from Carbon import Mlte UNDOLABELS = [ # Indexed by MLTECanUndo() value "Typing", "Cut", "Paste", "Clear", "Font Change", "Color Change", "Size Change", diff --git a/Mac/Demo/printing/PrintingDemo.py b/Mac/Demo/printing/PrintingDemo.py index 6f7881f..a42ac2f 100644 --- a/Mac/Demo/printing/PrintingDemo.py +++ b/Mac/Demo/printing/PrintingDemo.py @@ -1,7 +1,7 @@ import Printing -import Qd -import Fm -import Res +from Carbon import Qd +from Carbon import Fm +from Carbon import Res # some constants PostScriptBegin = 190 # Set driver state to PostScript diff --git a/Mac/Demo/quicktime/MovieInWindow.py b/Mac/Demo/quicktime/MovieInWindow.py index af9c7d7..9cd4e77 100644 --- a/Mac/Demo/quicktime/MovieInWindow.py +++ b/Mac/Demo/quicktime/MovieInWindow.py @@ -3,14 +3,14 @@ Jack Jansen, CWI, December 1995 """ -import Qt -import QuickTime -import Qd -import QuickDraw -import Evt -import Events -import Win -import Windows +from Carbon import Qt +from Carbon import QuickTime +from Carbon import Qd +from Carbon import QuickDraw +from Carbon import Evt +from Carbon import Events +from Carbon import Win +from Carbon import Windows import macfs import sys diff --git a/Mac/Demo/quicktime/VerySimplePlayer.py b/Mac/Demo/quicktime/VerySimplePlayer.py index 3053d33..4962ebb 100644 --- a/Mac/Demo/quicktime/VerySimplePlayer.py +++ b/Mac/Demo/quicktime/VerySimplePlayer.py @@ -3,14 +3,14 @@ Jack Jansen, CWI, December 1995 """ -import Qt -import QuickTime -import Qd -import QuickDraw -import Evt -import Events -import Win -import Windows +from Carbon import Qt +from Carbon import QuickTime +from Carbon import Qd +from Carbon import QuickDraw +from Carbon import Evt +from Carbon import Events +from Carbon import Win +from Carbon import Windows import macfs import sys diff --git a/Mac/Demo/resources/copyres.py b/Mac/Demo/resources/copyres.py index b401142..ae627ef 100644 --- a/Mac/Demo/resources/copyres.py +++ b/Mac/Demo/resources/copyres.py @@ -1,5 +1,5 @@ -from Res import * -from Resources import * +from Carbon.Res import * +from Carbon.Resources import * import MacOS READ = 1 diff --git a/Mac/Demo/resources/listres.py b/Mac/Demo/resources/listres.py index a0b2423..7575db8 100644 --- a/Mac/Demo/resources/listres.py +++ b/Mac/Demo/resources/listres.py @@ -1,7 +1,7 @@ # List all resources -import Res -from Resources import * +from Carbon import Res +from Carbon.Resources import * def list1resources(): ntypes = Res.Count1Types() diff --git a/Mac/Demo/sound/playaiff.py b/Mac/Demo/sound/playaiff.py index 1022fc8..8237895 100644 --- a/Mac/Demo/sound/playaiff.py +++ b/Mac/Demo/sound/playaiff.py @@ -1,5 +1,5 @@ -from Sound import * -import Snd +from Carbon.Sound import * +from Carbon import Snd import aifc, audioop diff --git a/Mac/Demo/textedit/ped.py b/Mac/Demo/textedit/ped.py index 529ac12..524b92a 100644 --- a/Mac/Demo/textedit/ped.py +++ b/Mac/Demo/textedit/ped.py @@ -5,12 +5,12 @@ # - Handle horizontal scrollbar correctly # - Functionality: find, etc. -from Menu import DrawMenuBar +from Carbon.Menu import DrawMenuBar from FrameWork import * -import Win -import Qd -import TE -import Scrap +from Carbon import Win +from Carbon import Qd +from Carbon import TE +from Carbon import Scrap import os import macfs diff --git a/Mac/Demo/waste/htmled.py b/Mac/Demo/waste/htmled.py index 4d29e1e..fc2ce5b 100644 --- a/Mac/Demo/waste/htmled.py +++ b/Mac/Demo/waste/htmled.py @@ -3,15 +3,15 @@ # To be done: # - Functionality: find, etc. -from Menu import DrawMenuBar +from Carbon.Menu import DrawMenuBar from FrameWork import * -import Win -import Qd -import Res -import Fm +from Carbon import Win +from Carbon import Qd +from Carbon import Res +from Carbon import Fm import waste import WASTEconst -import Scrap +from Carbon import Scrap import os import macfs import MACFS diff --git a/Mac/Demo/waste/swed.py b/Mac/Demo/waste/swed.py index e4622da..e2c2666 100644 --- a/Mac/Demo/waste/swed.py +++ b/Mac/Demo/waste/swed.py @@ -3,15 +3,15 @@ # To be done: # - Functionality: find, etc. -from Menu import DrawMenuBar +from Carbon.Menu import DrawMenuBar from FrameWork import * -import Win -import Qd -import Res -import Fm +from Carbon import Win +from Carbon import Qd +from Carbon import Res +from Carbon import Fm import waste import WASTEconst -import Scrap +from Carbon import Scrap import os import macfs import MACFS diff --git a/Mac/Demo/waste/wed.py b/Mac/Demo/waste/wed.py index 342d52e..00ff8d8 100644 --- a/Mac/Demo/waste/wed.py +++ b/Mac/Demo/waste/wed.py @@ -3,14 +3,14 @@ # To be done: # - Functionality: find, etc. -from Menu import DrawMenuBar +from Carbon.Menu import DrawMenuBar from FrameWork import * -import Win -import Qd -import Res +from Carbon import Win +from Carbon import Qd +from Carbon import Res import waste import WASTEconst -import Scrap +from Carbon import Scrap import os import macfs diff --git a/Mac/IDE scripts/Widget demos/ModalDialog.py b/Mac/IDE scripts/Widget demos/ModalDialog.py index 683a76a..801dfd4 100644 --- a/Mac/IDE scripts/Widget demos/ModalDialog.py +++ b/Mac/IDE scripts/Widget demos/ModalDialog.py @@ -1,5 +1,5 @@ import W -import Windows +from Carbon import Windows w = W.ModalDialog((100, 100)) diff --git a/Mac/Lib/Audio_mac.py b/Mac/Lib/Audio_mac.py index 14f825e..d8b327b 100644 --- a/Mac/Lib/Audio_mac.py +++ b/Mac/Lib/Audio_mac.py @@ -40,11 +40,11 @@ class Play_Audio_mac: def writeframes(self, data): import time - from Sound import bufferCmd, callBackCmd, extSH + from Carbon.Sound import bufferCmd, callBackCmd, extSH import struct import MacOS if not self._chan: - import Snd + from Carbon import Snd self._chan = Snd.SndNewChannel(5, 0, self._callback) nframes = len(data) / self._nchannels / self._sampwidth if len(data) != nframes * self._nchannels * self._sampwidth: diff --git a/Mac/Lib/EasyDialogs.py b/Mac/Lib/EasyDialogs.py index 1943908..68ad58e 100644 --- a/Mac/Lib/EasyDialogs.py +++ b/Mac/Lib/EasyDialogs.py @@ -14,18 +14,18 @@ This module uses DLOG resources 260 and on. Based upon STDWIN dialogs with the same names and functions. """ -from Dlg import GetNewDialog, SetDialogItemText, GetDialogItemText, ModalDialog -import Qd -import QuickDraw -import Dialogs -import Windows -import Dlg,Win,Evt,Events # sdm7g -import Ctl -import Controls -import Menu +from Carbon.Dlg import GetNewDialog, SetDialogItemText, GetDialogItemText, ModalDialog +from Carbon import Qd +from Carbon import QuickDraw +from Carbon import Dialogs +from Carbon import Windows +from Carbon import Dlg,Win,Evt,Events # sdm7g +from Carbon import Ctl +from Carbon import Controls +from Carbon import Menu import MacOS import string -from ControlAccessor import * # Also import Controls constants +from Carbon.ControlAccessor import * # Also import Controls constants import macfs def cr2lf(text): diff --git a/Mac/Lib/FrameWork.py b/Mac/Lib/FrameWork.py index 3ee118d..b2b61db 100644 --- a/Mac/Lib/FrameWork.py +++ b/Mac/Lib/FrameWork.py @@ -5,24 +5,24 @@ DEBUG=0 import MacOS import traceback -from AE import * -from AppleEvents import * -from Ctl import * -from Controls import * -from Dlg import * -from Dialogs import * -from Evt import * -from Events import * -from Menu import * -from Menus import * -from Qd import * -from QuickDraw import * -#from Res import * -#from Resources import * -#from Snd import * -#from Sound import * -from Win import * -from Windows import * +from Carbon.AE import * +from Carbon.AppleEvents import * +from Carbon.Ctl import * +from Carbon.Controls import * +from Carbon.Dlg import * +from Carbon.Dialogs import * +from Carbon.Evt import * +from Carbon.Events import * +from Carbon.Menu import * +from Carbon.Menus import * +from Carbon.Qd import * +from Carbon.QuickDraw import * +#from Carbon.Res import * +#from Carbon.Resources import * +#from Carbon.Snd import * +#from Carbon.Sound import * +from Carbon.Win import * +from Carbon.Windows import * import types import EasyDialogs diff --git a/Mac/Lib/MiniAEFrame.py b/Mac/Lib/MiniAEFrame.py index fbb6f1b..e562301 100644 --- a/Mac/Lib/MiniAEFrame.py +++ b/Mac/Lib/MiniAEFrame.py @@ -9,14 +9,14 @@ There are two classes: import sys import traceback import MacOS -import AE -from AppleEvents import * -import Evt -from Events import * -import Menu -import Win -from Windows import * -import Qd +from Carbon import AE +from Carbon.AppleEvents import * +from Carbon import Evt +from Carbon.Events import * +from Carbon import Menu +from Carbon import Win +from Carbon.Windows import * +from Carbon import Qd import aetools import EasyDialogs diff --git a/Mac/Lib/PixMapWrapper.py b/Mac/Lib/PixMapWrapper.py index 72a64ba..b167cc2 100644 --- a/Mac/Lib/PixMapWrapper.py +++ b/Mac/Lib/PixMapWrapper.py @@ -5,8 +5,8 @@ Python Imaging Library Image object. J. Strout <joe@strout.net> February 1999""" -import Qd -import QuickDraw +from Carbon import Qd +from Carbon import QuickDraw import struct import MacOS import img diff --git a/Mac/Lib/aepack.py b/Mac/Lib/aepack.py index be6e645..161f3eb 100644 --- a/Mac/Lib/aepack.py +++ b/Mac/Lib/aepack.py @@ -17,8 +17,8 @@ import string import types from string import strip from types import * -import AE -from AppleEvents import * +from Carbon import AE +from Carbon.AppleEvents import * import MacOS import macfs import StringIO diff --git a/Mac/Lib/aetools.py b/Mac/Lib/aetools.py index 1af761e..00ec18a 100644 --- a/Mac/Lib/aetools.py +++ b/Mac/Lib/aetools.py @@ -22,8 +22,8 @@ files: the pack stuff from aepack, the objects from aetypes. from types import * -import AE -import AppleEvents +from Carbon import AE +from Carbon import AppleEvents import MacOS import sys diff --git a/Mac/Lib/aetypes.py b/Mac/Lib/aetypes.py index 253d1e7..8fe8cf9 100644 --- a/Mac/Lib/aetypes.py +++ b/Mac/Lib/aetypes.py @@ -1,6 +1,6 @@ """aetypes - Python objects representing various AE types.""" -from AppleEvents import * +from Carbon.AppleEvents import * import struct from types import * import string diff --git a/Mac/Lib/buildtools.py b/Mac/Lib/buildtools.py index dd2e30e..da43d09 100644 --- a/Mac/Lib/buildtools.py +++ b/Mac/Lib/buildtools.py @@ -6,7 +6,7 @@ import string import imp import marshal import macfs -import Res +from Carbon import Res import MACFS import MacOS import macostools diff --git a/Mac/Lib/cfmfile.py b/Mac/Lib/cfmfile.py index 9c449e0..9efc409 100644 --- a/Mac/Lib/cfmfile.py +++ b/Mac/Lib/cfmfile.py @@ -7,7 +7,7 @@ __author__ = "jvr" import macfs import struct -import Res +from Carbon import Res import os import sys diff --git a/Mac/Lib/findertools.py b/Mac/Lib/findertools.py index 7e1e3fd..aeb6b93 100644 --- a/Mac/Lib/findertools.py +++ b/Mac/Lib/findertools.py @@ -15,7 +15,7 @@ So bottom line: the processes() stuff does not work on < MacOS9 Mostly written by erik@letterror.com """ import Finder -import AppleEvents +from Carbon import AppleEvents import aetools import MacOS import sys diff --git a/Mac/Lib/ic.py b/Mac/Lib/ic.py index 5756463..abe5b69 100644 --- a/Mac/Lib/ic.py +++ b/Mac/Lib/ic.py @@ -3,7 +3,7 @@ import icglue import string import sys -import Res +from Carbon import Res import macfs import macostools diff --git a/Mac/Lib/macfsn.py b/Mac/Lib/macfsn.py index 3c12646..c496903 100644 --- a/Mac/Lib/macfsn.py +++ b/Mac/Lib/macfsn.py @@ -2,7 +2,7 @@ API calls with Navigation Services""" import macfs import struct -import Res +from Carbon import Res try: import Nav except ImportError: diff --git a/Mac/Lib/macostools.py b/Mac/Lib/macostools.py index d706856..ab6ab88 100644 --- a/Mac/Lib/macostools.py +++ b/Mac/Lib/macostools.py @@ -5,7 +5,7 @@ copy(src, dst) - Full copy of 'src' to 'dst' """ import macfs -import Res +from Carbon import Res import os from MACFS import * import MacOS diff --git a/Mac/Lib/mkcwproject/__init__.py b/Mac/Lib/mkcwproject/__init__.py index fec4476..da73adb 100644 --- a/Mac/Lib/mkcwproject/__init__.py +++ b/Mac/Lib/mkcwproject/__init__.py @@ -1,7 +1,7 @@ import cwxmlgen import cwtalker import os -import AppleEvents +from Carbon import AppleEvents import macfs def mkproject(outputfile, modulename, settings, force=0, templatename=None): diff --git a/Mac/Lib/preferences.py b/Mac/Lib/preferences.py index b1e0948..8b77012 100644 --- a/Mac/Lib/preferences.py +++ b/Mac/Lib/preferences.py @@ -1,7 +1,7 @@ # # General parser/loaders for preferences files and such # -import Res +from Carbon import Res import macfs import struct import MACFS diff --git a/Mac/Lib/py_resource.py b/Mac/Lib/py_resource.py index 85d67e5..0faf1f1 100644 --- a/Mac/Lib/py_resource.py +++ b/Mac/Lib/py_resource.py @@ -1,6 +1,6 @@ """Creation of PYC resources""" import os -import Res +from Carbon import Res import __builtin__ READ = 1 diff --git a/Mac/Lib/test/AEservertest.py b/Mac/Lib/test/AEservertest.py index 631889d..d474f43 100644 --- a/Mac/Lib/test/AEservertest.py +++ b/Mac/Lib/test/AEservertest.py @@ -10,15 +10,15 @@ import sys sys.stdout = sys.stderr import traceback import MacOS -import AE -from AppleEvents import * -import Evt -from Events import * -import Menu -import Dlg -import Win -from Windows import * -import Qd +from Carbon import AE +from Carbon.AppleEvents import * +from Carbon import Evt +from Carbon.Events import * +from Carbon import Menu +from Carbon import Dlg +from Carbon import Win +from Carbon.Windows import * +from Carbon import Qd import macfs import aetools diff --git a/Mac/Lib/test/aete.py b/Mac/Lib/test/aete.py index 21fff61..3945a86 100644 --- a/Mac/Lib/test/aete.py +++ b/Mac/Lib/test/aete.py @@ -8,7 +8,7 @@ import sys import types import StringIO -from Res import * +from Carbon.Res import * def main(): filename = "" diff --git a/Mac/Lib/test/cmtest.py b/Mac/Lib/test/cmtest.py index 7170424..bdbca23 100644 --- a/Mac/Lib/test/cmtest.py +++ b/Mac/Lib/test/cmtest.py @@ -1,8 +1,8 @@ """cmtest - List all components in the system""" -import Cm -import Res -import sys +from Carbon import Cm +from Carbon import Res +from Carbon import sys def getstr255(r): """Get string from str255 resource""" diff --git a/Mac/Lib/test/ctbtest.py b/Mac/Lib/test/ctbtest.py index cb1b506..91824d3 100644 --- a/Mac/Lib/test/ctbtest.py +++ b/Mac/Lib/test/ctbtest.py @@ -3,8 +3,8 @@ # To simplify matters use the python console window for output. # import ctb -import Evt -import Events +from Carbon import Evt +from Carbon import Events import MacOS import sys diff --git a/Mac/Lib/test/dragtest.py b/Mac/Lib/test/dragtest.py index 7663af7..28eb1a9 100644 --- a/Mac/Lib/test/dragtest.py +++ b/Mac/Lib/test/dragtest.py @@ -1,4 +1,4 @@ -import Drag +from Carbon import Drag import time xxxx=1 def decode_hfs(data): diff --git a/Mac/Lib/test/echo.py b/Mac/Lib/test/echo.py index 46c84c2..f84e13b 100644 --- a/Mac/Lib/test/echo.py +++ b/Mac/Lib/test/echo.py @@ -10,15 +10,15 @@ import sys sys.stdout = sys.stderr import traceback import MacOS -import AE -from AppleEvents import * -import Evt -from Events import * -import Menu -import Dlg -import Win -from Windows import * -import Qd +from Carbon import AE +from Carbon.AppleEvents import * +from Carbon import Evt +from Carbon.Events import * +from Carbon import Menu +from Carbon import Dlg +from Carbon import Win +from Carbon.Windows import * +from Carbon import Qd import aetools import EasyDialogs diff --git a/Mac/Lib/test/icgluetest.py b/Mac/Lib/test/icgluetest.py index 97c0c74..dd34bd0 100644 --- a/Mac/Lib/test/icgluetest.py +++ b/Mac/Lib/test/icgluetest.py @@ -2,7 +2,7 @@ not the icglue module, is what you should normally use.""" import icglue -import Res +from Carbon import Res ici = icglue.ICStart('Pyth') #ici.ICFindConfigFile() diff --git a/Mac/Lib/test/tell.py b/Mac/Lib/test/tell.py index 74e0ca0..fcacb7e 100644 --- a/Mac/Lib/test/tell.py +++ b/Mac/Lib/test/tell.py @@ -1,8 +1,8 @@ # (Slightly less) primitive operations for sending Apple Events to applications. # This could be the basis of a Script Editor like application. -from AE import * -from AppleEvents import * +from Carbon.AE import * +from Carbon.AppleEvents import * import aetools import types diff --git a/Mac/Lib/test/test_setcontroldata.py b/Mac/Lib/test/test_setcontroldata.py index c46e613..8167214 100644 --- a/Mac/Lib/test/test_setcontroldata.py +++ b/Mac/Lib/test/test_setcontroldata.py @@ -1,5 +1,5 @@ import W -from Controls import * +from Carbon.Controls import * w = W.Window((200,200), "Test") diff --git a/Mac/Lib/test/tlist.py b/Mac/Lib/test/tlist.py index fdcfe6e..5b84fc5 100644 --- a/Mac/Lib/test/tlist.py +++ b/Mac/Lib/test/tlist.py @@ -8,10 +8,10 @@ # Actually, it is more a test of FrameWork by now.... from FrameWork import * -import Win -import Qd -import List -import Lists +from Carbon import Win +from Carbon import Qd +from Carbon import List +from Carbon import Lists import os class ListWindow(Window): diff --git a/Mac/Lib/test/tsnd.py b/Mac/Lib/test/tsnd.py index ac347cb..919785a 100644 --- a/Mac/Lib/test/tsnd.py +++ b/Mac/Lib/test/tsnd.py @@ -1,8 +1,8 @@ # Show off SndPlay (and some resource manager functions). # Get a list of all 'snd ' resources in the system and play them all. -from Res import * -from Snd import * +from Carbon.Res import * +from Carbon.Snd import * ch = SndNewChannel(0, 0, None) print "Channel:", ch diff --git a/Mac/Lib/test/tte.py b/Mac/Lib/test/tte.py index 9e6bee4..bde7de2 100644 --- a/Mac/Lib/test/tte.py +++ b/Mac/Lib/test/tte.py @@ -1,8 +1,8 @@ # Test TE module, simple version -from Win import * -from TE import * -import Qd +from Carbon.Win import * +from Carbon.TE import * +from Carbon import Qd r = (40, 40, 140, 140) w = NewWindow(r, "TETextBox test", 1, 0, -1, 1, 0x55555555) diff --git a/Mac/Lib/videoreader.py b/Mac/Lib/videoreader.py index 9691875..7b776f2 100644 --- a/Mac/Lib/videoreader.py +++ b/Mac/Lib/videoreader.py @@ -6,12 +6,12 @@ # Jack Jansen, August 2000 # import sys -import Qt -import QuickTime -import Qd -import Qdoffs -import QDOffscreen -import Res +from Carbon import Qt +from Carbon import QuickTime +from Carbon import Qd +from Carbon import Qdoffs +from Carbon import QDOffscreen +from Carbon import Res import MediaDescr import imgformat import os diff --git a/Mac/Tools/CGI/BuildCGIApplet.py b/Mac/Tools/CGI/BuildCGIApplet.py index c94eca9..93c3909 100644 --- a/Mac/Tools/CGI/BuildCGIApplet.py +++ b/Mac/Tools/CGI/BuildCGIApplet.py @@ -10,7 +10,7 @@ import sys import os import macfs import MacOS -import Res +from Carbon import Res import EasyDialogs import buildtools import py_resource diff --git a/Mac/Tools/CGI/PythonCGISlave.py b/Mac/Tools/CGI/PythonCGISlave.py index d2dd90f..f14a582 100644 --- a/Mac/Tools/CGI/PythonCGISlave.py +++ b/Mac/Tools/CGI/PythonCGISlave.py @@ -70,7 +70,8 @@ Content-type: text/html def get_cgi_code(): # If we're a CGI wrapper, the CGI code resides in a PYC resource. - import Res, marshal + from Carbon import Res + import marshal try: code = Res.GetNamedResource('PYC ', "CGI_MAIN") except Res.Error: diff --git a/Mac/Tools/IDE/BuildIDE.py b/Mac/Tools/IDE/BuildIDE.py index 942670a..7e65869 100644 --- a/Mac/Tools/IDE/BuildIDE.py +++ b/Mac/Tools/IDE/BuildIDE.py @@ -5,7 +5,7 @@ which reduces the startup time (especially on slower machines).""" import sys import os import buildtools -import Res +from Carbon import Res import py_resource buildtools.DEBUG=1 diff --git a/Mac/Tools/IDE/FontSettings.py b/Mac/Tools/IDE/FontSettings.py index 09886ae..a41fcbd 100644 --- a/Mac/Tools/IDE/FontSettings.py +++ b/Mac/Tools/IDE/FontSettings.py @@ -8,8 +8,8 @@ if newsettings: import W import PyEdit -import TextEdit -import Qd +from Carbon import TextEdit +from Carbon import Qd import string import types import sys @@ -104,7 +104,7 @@ class _FontDialog: def set(self, fontsettings): font, style, size, color = fontsettings if type(font) <> types.StringType: - import Res + from Carbon import Res res = Res.GetResource('FOND', font) font = res.GetResInfo()[2] self.w.fontname.set(font) diff --git a/Mac/Tools/IDE/ModuleBrowser.py b/Mac/Tools/IDE/ModuleBrowser.py index f5b2b0a..700c2b1 100644 --- a/Mac/Tools/IDE/ModuleBrowser.py +++ b/Mac/Tools/IDE/ModuleBrowser.py @@ -1,6 +1,6 @@ import W import sys -import Qd +from Carbon import Qd __version__ = "0.2" __author__ = "jvr" diff --git a/Mac/Tools/IDE/ProfileBrowser.py b/Mac/Tools/IDE/ProfileBrowser.py index f5b4a38..51ba75c 100644 --- a/Mac/Tools/IDE/ProfileBrowser.py +++ b/Mac/Tools/IDE/ProfileBrowser.py @@ -1,5 +1,5 @@ import W -import Evt +from Carbon import Evt import sys import StringIO diff --git a/Mac/Tools/IDE/PyBrowser.py b/Mac/Tools/IDE/PyBrowser.py index c8e5066..308a09d 100644 --- a/Mac/Tools/IDE/PyBrowser.py +++ b/Mac/Tools/IDE/PyBrowser.py @@ -127,7 +127,7 @@ class BrowserWidget(W.List): return abs(abscol - x) < 3 def trackcolumn(self, (x, y)): - import Qd, QuickDraw, Evt + from Carbon import Qd, QuickDraw, Evt self.SetPort() l, t, r, b = self._bounds bounds = l, t, r, b = l + 1, t + 1, r - 16, b - 1 diff --git a/Mac/Tools/IDE/PyConsole.py b/Mac/Tools/IDE/PyConsole.py index 389834a..2bb109d 100644 --- a/Mac/Tools/IDE/PyConsole.py +++ b/Mac/Tools/IDE/PyConsole.py @@ -1,15 +1,15 @@ import W import Wkeys -import Fm +from Carbon import Fm import WASTEconst from types import * -import Events +from Carbon import Events import string import sys import traceback import MacOS import MacPrefs -import Qd +from Carbon import Qd import PyInteractive if not hasattr(sys, 'ps1'): @@ -178,7 +178,7 @@ class PyConsole(W.Window): PyBrowser.Browser(self.consoletext._namespace, self.consoletext._namespace["__name__"]) def clearbuffer(self): - import Res + from Carbon import Res self.consoletext.ted.WEUseText(Res.Resource('')) self.consoletext.write(sys.ps1) self.consoletext.flush() @@ -326,7 +326,7 @@ class PyOutput: self.w.outputtext.settabsettings(tabsettings) def clearbuffer(self): - import Res + from Carbon import Res self.w.outputtext.set('') def activate(self, onoff): diff --git a/Mac/Tools/IDE/PyDebugger.py b/Mac/Tools/IDE/PyDebugger.py index 22ab7a2..56a0658 100644 --- a/Mac/Tools/IDE/PyDebugger.py +++ b/Mac/Tools/IDE/PyDebugger.py @@ -6,9 +6,9 @@ import os import W import WASTEconst import PyBrowser -import Qd -import Evt -import Lists +from Carbon import Qd +from Carbon import Evt +from Carbon import Lists import MacOS _filenames = {} @@ -65,7 +65,7 @@ class Debugger(bdb.Bdb): def start(self, bottomframe = None, running = 0): W.getapplication().DebuggerQuit = bdb.BdbQuit - import Menu + from Carbon import Menu Menu.HiliteMenu(0) if self.closed: self.setupwidgets(self.title) diff --git a/Mac/Tools/IDE/PyDocSearch.py b/Mac/Tools/IDE/PyDocSearch.py index 4b35e46..16d2e42 100644 --- a/Mac/Tools/IDE/PyDocSearch.py +++ b/Mac/Tools/IDE/PyDocSearch.py @@ -59,7 +59,7 @@ class TwoLineList(W.List): LDEF_ID = 468 def createlist(self): - import List + from Carbon import List self._calcbounds() self.SetPort() rect = self._bounds diff --git a/Mac/Tools/IDE/PyEdit.py b/Mac/Tools/IDE/PyEdit.py index d8539c1..7740dfe 100644 --- a/Mac/Tools/IDE/PyEdit.py +++ b/Mac/Tools/IDE/PyEdit.py @@ -7,9 +7,9 @@ from Wkeys import * import macfs import MACFS import MacOS -import Win -import Res -import Evt +from Carbon import Win +from Carbon import Res +from Carbon import Evt import os import imp import sys @@ -357,7 +357,7 @@ class Editor(W.Window): def close(self): if self.editgroup.editor.changed: import EasyDialogs - import Qd + from Carbon import Qd Qd.InitCursor() save = EasyDialogs.AskYesNoCancel('Save window "%s" before closing?' % self.title, default=1, no="Don\xd5t save") @@ -948,7 +948,7 @@ class SearchEngine: if counter: self.hide() import EasyDialogs - import Res + from Carbon import Res editor.changed = 1 editor.selchanged = 1 editor.ted.WEUseText(Res.Resource(Text)) diff --git a/Mac/Tools/IDE/PythonIDE.py b/Mac/Tools/IDE/PythonIDE.py index 9c0902e..bc22e79 100644 --- a/Mac/Tools/IDE/PythonIDE.py +++ b/Mac/Tools/IDE/PythonIDE.py @@ -10,10 +10,11 @@ def init(): import MacOS MacOS.EnableAppswitch(-1) - import Qd, QuickDraw + from Carbon import Qd, QuickDraw Qd.SetCursor(Qd.GetCursor(QuickDraw.watchCursor).data) - import Res, sys, os + from Carbon import Res + import sys, os try: Res.GetResource('DITL', 468) except Res.Error: diff --git a/Mac/Tools/IDE/PythonIDEMain.py b/Mac/Tools/IDE/PythonIDEMain.py index 55489e2..4dfa162 100644 --- a/Mac/Tools/IDE/PythonIDEMain.py +++ b/Mac/Tools/IDE/PythonIDEMain.py @@ -14,7 +14,8 @@ class PythonIDE(Wapplication.Application): def __init__(self): self.preffilepath = ":Python:PythonIDE preferences" Wapplication.Application.__init__(self, 'Pide') - import AE, AppleEvents + from Carbon import AE + from Carbon import AppleEvents AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEOpenApplication, self.ignoreevent) @@ -123,7 +124,7 @@ class PythonIDE(Wapplication.Application): self.makescriptsmenu() def quitevent(self, theAppleEvent, theReply): - import AE + from Carbon import AE AE.AEInteractWithUser(50000000) self._quit() diff --git a/Mac/Tools/IDE/Splash.py b/Mac/Tools/IDE/Splash.py index 5293295..31271cc 100644 --- a/Mac/Tools/IDE/Splash.py +++ b/Mac/Tools/IDE/Splash.py @@ -1,10 +1,11 @@ -import Dlg -import Res +from Carbon import Dlg +from Carbon import Res splash = Dlg.GetNewDialog(468, -1) splash.DrawDialog() -import Qd, TE, Fm, sys +from Carbon import Qd, TE, Fm +import sys _real__import__ = None @@ -32,7 +33,7 @@ def importing(module): Qd.SetPort(splash) fontID = Fm.GetFNum("Python-Sans") if not fontID: - from Fonts import geneva + from Carbon.Fonts import geneva fontID = geneva Qd.TextFont(fontID) Qd.TextSize(9) @@ -68,10 +69,10 @@ def my__import__(name, globals=None, locals=None, fromlist=None): #install_importhook() kHighLevelEvent = 23 -import Win -from Fonts import * -from QuickDraw import * -from TextEdit import * +from Carbon import Win +from Carbon.Fonts import * +from Carbon.QuickDraw import * +from Carbon.TextEdit import * import string import sys @@ -130,8 +131,8 @@ def drawtext(what = 0): UpdateSplash(1) def wait(): - import Evt - import Events + from Carbon import Evt + from Carbon import Events global splash try: splash diff --git a/Mac/Tools/IDE/Wapplication.py b/Mac/Tools/IDE/Wapplication.py index 7a9b74a..ede6a76 100644 --- a/Mac/Tools/IDE/Wapplication.py +++ b/Mac/Tools/IDE/Wapplication.py @@ -1,13 +1,13 @@ import FrameWork -import Win -import Qd -import Evt +from Carbon import Win +from Carbon import Qd +from Carbon import Evt import MacOS import Events import traceback from types import * -import Menu; MenuToolbox = Menu; del Menu +from Carbon import Menu; MenuToolbox = Menu; del Menu class Application(FrameWork.Application): diff --git a/Mac/Tools/IDE/Wbase.py b/Mac/Tools/IDE/Wbase.py index 3c5ab60..8e012de 100644 --- a/Mac/Tools/IDE/Wbase.py +++ b/Mac/Tools/IDE/Wbase.py @@ -1,7 +1,7 @@ -import Qd -import Win -import QuickDraw -import Evt +from Carbon import Qd +from Carbon import Win +from Carbon import QuickDraw +from Carbon import Evt import string from types import * import sys diff --git a/Mac/Tools/IDE/Wcontrols.py b/Mac/Tools/IDE/Wcontrols.py index 7394084..6742d9f 100644 --- a/Mac/Tools/IDE/Wcontrols.py +++ b/Mac/Tools/IDE/Wcontrols.py @@ -1,9 +1,9 @@ -import Ctl -import Controls -import Win +from Carbon import Ctl +from Carbon import Controls +from Carbon import Win import Wbase -import Qd -import Evt +from Carbon import Qd +from Carbon import Evt class ControlWidget(Wbase.ClickableWidget): diff --git a/Mac/Tools/IDE/Wlists.py b/Mac/Tools/IDE/Wlists.py index dd43a2d..04266f7 100644 --- a/Mac/Tools/IDE/Wlists.py +++ b/Mac/Tools/IDE/Wlists.py @@ -1,12 +1,12 @@ import Wbase import Wkeys -import Scrap +from Carbon import Scrap import string -import Evt -import Events -import Qd -import Win -import Lists +from Carbon import Evt +from Carbon import Events +from Carbon import Qd +from Carbon import Win +from Carbon import Lists class List(Wbase.SelectableWidget): @@ -39,7 +39,7 @@ class List(Wbase.SelectableWidget): self.setdrawingmode(1) def createlist(self): - import List + from Carbon import List self._calcbounds() self.SetPort() rect = self._bounds @@ -371,7 +371,7 @@ class TwoLineList(List): LDEF_ID = 468 def createlist(self): - import List + from Carbon import List self._calcbounds() self.SetPort() rect = self._bounds diff --git a/Mac/Tools/IDE/Wmenus.py b/Mac/Tools/IDE/Wmenus.py index a68b95e..9af50a7 100644 --- a/Mac/Tools/IDE/Wmenus.py +++ b/Mac/Tools/IDE/Wmenus.py @@ -1,6 +1,7 @@ import FrameWork -import Qd -import Wbase, Wcontrols, Ctl, Controls +from Carbon import Qd +import Wbase, Wcontrols +from Carbon import Ctl, Controls from types import * import Wapplication @@ -244,7 +245,7 @@ def _makefontmenu(): def _getfontlist(): - import Res + from Carbon import Res fontnames = [] for i in range(1, Res.CountResources('FOND') + 1): r = Res.GetIndResource('FOND', i) diff --git a/Mac/Tools/IDE/Wminiapp.py b/Mac/Tools/IDE/Wminiapp.py index 3eac613..d48a876 100644 --- a/Mac/Tools/IDE/Wminiapp.py +++ b/Mac/Tools/IDE/Wminiapp.py @@ -5,7 +5,7 @@ import Wapplication class TestApp(Wapplication.Application): def __init__(self): - import Res + from Carbon import Res Res.FSpOpenResFile("Widgets.rsrc", 1) self._menustocheck = [] self.preffilepath = ":Python:PythonIDE preferences" diff --git a/Mac/Tools/IDE/Wquicktime.py b/Mac/Tools/IDE/Wquicktime.py index 79adc110..7170cd7 100644 --- a/Mac/Tools/IDE/Wquicktime.py +++ b/Mac/Tools/IDE/Wquicktime.py @@ -1,10 +1,10 @@ import os -import Qd -import Win -import Qt, QuickTime +from Carbon import Qd +from Carbon import Win +from Carbon import Qt, QuickTime import W import macfs -import Evt, Events +from Carbon import Evt, Events _moviesinitialized = 0 diff --git a/Mac/Tools/IDE/Wtext.py b/Mac/Tools/IDE/Wtext.py index 3b8973a..6ca6015 100644 --- a/Mac/Tools/IDE/Wtext.py +++ b/Mac/Tools/IDE/Wtext.py @@ -1,12 +1,12 @@ -import Qd -import TE -import Fm +from Carbon import Qd +from Carbon import TE +from Carbon import Fm import waste import WASTEconst -import Res -import Evt -import Events -import Scrap +from Carbon import Res +from Carbon import Evt +from Carbon import Events +from Carbon import Scrap import string import Win @@ -15,8 +15,8 @@ import Wkeys import Wcontrols import PyFontify from types import * -import Fonts -import TextEdit +from Carbon import Fonts +from Carbon import TextEdit @@ -175,7 +175,7 @@ class EditText(Wbase.SelectableWidget, _ScrollWidget): self.ted.WEUpdate(port.visRgn) def getfontsettings(self): - import Res + from Carbon import Res (font, style, size, color) = self.ted.WEGetRunInfo(0)[4] font = Fm.GetFontName(font) return (font, style, size, color) diff --git a/Mac/Tools/IDE/Wtraceback.py b/Mac/Tools/IDE/Wtraceback.py index 4960ad0..51b54f3 100644 --- a/Mac/Tools/IDE/Wtraceback.py +++ b/Mac/Tools/IDE/Wtraceback.py @@ -3,7 +3,7 @@ import sys import W import os import types -import List +from Carbon import List class TraceBack: diff --git a/Mac/Tools/IDE/Wwindows.py b/Mac/Tools/IDE/Wwindows.py index 29c07e5..d4b1a88 100644 --- a/Mac/Tools/IDE/Wwindows.py +++ b/Mac/Tools/IDE/Wwindows.py @@ -1,12 +1,12 @@ -import Qd -import Win -import Evt -import Fm +from Carbon import Qd +from Carbon import Win +from Carbon import Evt +from Carbon import Fm import FrameWork -import Windows -import Events +from Carbon import Windows +from Carbon import Events import Wbase -import Dlg +from Carbon import Dlg import MacOS import Menu import struct @@ -570,7 +570,7 @@ def FrontWindowInsert(stuff): if EasyDialogs.AskYesNoCancel( "Can't find window or widget to insert text into; copy to clipboard instead?", 1) == 1: - import Scrap + from Carbon import Scrap Scrap.ZeroScrap() Scrap.PutScrap('TEXT', stuff) diff --git a/Mac/Tools/macfreeze/macfreezegui.py b/Mac/Tools/macfreeze/macfreezegui.py index c3311b7..a834138 100644 --- a/Mac/Tools/macfreeze/macfreezegui.py +++ b/Mac/Tools/macfreeze/macfreezegui.py @@ -1,11 +1,11 @@ """macfreezegui - The GUI for macfreeze""" -import Dlg +from Carbon import Dlg import macfs import EasyDialogs import sys import os import string -import Res +from Carbon import Res ID_MAINDIALOG=512 diff --git a/Mac/Tools/macfreeze/macgen_bin.py b/Mac/Tools/macfreeze/macgen_bin.py index 42aaf40..c72bb3c 100644 --- a/Mac/Tools/macfreeze/macgen_bin.py +++ b/Mac/Tools/macfreeze/macgen_bin.py @@ -7,7 +7,7 @@ import types import macfs from MACFS import * import MacOS -import Res +from Carbon import Res import py_resource import cfmfile import buildtools diff --git a/Mac/Tools/macfreeze/macgen_rsrc.py b/Mac/Tools/macfreeze/macgen_rsrc.py index cbf5e0e..03fc0af 100644 --- a/Mac/Tools/macfreeze/macgen_rsrc.py +++ b/Mac/Tools/macfreeze/macgen_rsrc.py @@ -1,7 +1,7 @@ """macgen_info - Generate PYC resource file only""" import EasyDialogs import py_resource -import Res +from Carbon import Res import sys def generate(output, module_dict, debug=0, preload=1): diff --git a/Mac/Unsupported/findmodulefiles.py b/Mac/Unsupported/findmodulefiles.py index 267e89e..6b3642e 100644 --- a/Mac/Unsupported/findmodulefiles.py +++ b/Mac/Unsupported/findmodulefiles.py @@ -59,7 +59,7 @@ def findunusedbuiltins(list): def mkpycresourcefile(list, main='', dst=None): """Copy list-of-modules to resource file dst.""" import py_resource - import Res + from Carbon import Res import sys if dst == None: diff --git a/Mac/Unsupported/mkfrozenresources.py b/Mac/Unsupported/mkfrozenresources.py index b678791..da09f76 100644 --- a/Mac/Unsupported/mkfrozenresources.py +++ b/Mac/Unsupported/mkfrozenresources.py @@ -4,7 +4,7 @@ # import macfs import py_resource -import Res +from Carbon import Res import sys def main(): diff --git a/Mac/scripts/BuildApplication.py b/Mac/scripts/BuildApplication.py index e9884a4..ee82b7a 100644 --- a/Mac/scripts/BuildApplication.py +++ b/Mac/scripts/BuildApplication.py @@ -14,8 +14,8 @@ import string import os import macfs import MacOS -import Res -import Dlg +from Carbon import Res +from Carbon import Dlg import EasyDialogs import buildtools diff --git a/Mac/scripts/ConfigurePython.py b/Mac/scripts/ConfigurePython.py index c1bfb2b..423b164 100644 --- a/Mac/scripts/ConfigurePython.py +++ b/Mac/scripts/ConfigurePython.py @@ -13,7 +13,7 @@ import macfs import MacOS import gestalt import string -import Res +from Carbon import Res SPLASH_COPYCORE=512 SPLASH_COPYCARBON=513 @@ -89,7 +89,7 @@ def ask_copy(): do_copy = 0 if macfs.FSSpec(sys.exec_prefix).as_tuple()[0] != -1: # XXXX try: - import Dlg + from Carbon import Dlg rv = Dlg.CautionAlert(ALERT_NONBOOT, None) if rv == ALERT_NONBOOT_COPY: do_copy = 1 @@ -141,7 +141,7 @@ def main(): elif oldcwd != newcwd: # Hack to make sure we get the new MACFS sys.path.insert(0, os.path.join(oldcwd, ':Mac:Lib')) - import Dlg + from Carbon import Dlg rv = Dlg.CautionAlert(ALERT_NOTPYTHONFOLDER, None) if rv == ALERT_NOTPYTHONFOLDER_REMOVE_QUIT: import pythonprefs, preferences @@ -162,7 +162,7 @@ def main(): n = n + mkcorealias('PythonCore', 'PythonCore') n = n + mkcorealias('PythonCoreCarbon', 'PythonCoreCarbon') if n == 0: - import Dlg + from Carbon import Dlg Dlg.CautionAlert(ALERT_NOCORE, None) if verbose: print "Warning: PythonCore not copied to Extensions folder" diff --git a/Mac/scripts/EditPythonPrefs.py b/Mac/scripts/EditPythonPrefs.py index a03ae78..00119e0 100644 --- a/Mac/scripts/EditPythonPrefs.py +++ b/Mac/scripts/EditPythonPrefs.py @@ -3,21 +3,21 @@ # This program is getting more and more clunky. It should really # be rewritten in a modeless way some time soon. -from Dlg import * -from Events import * -from Res import * -import Controls +from Carbon.Dlg import * +from Carbon.Events import * +from Carbon.Res import * +from Carbon import Controls import string import struct import macfs import MacOS import os import sys -import Res # For Res.Error +from Carbon import Res # For Res.Error import pythonprefs import EasyDialogs try: - import Help + from Carbon import Help except ImportError: Help = None diff --git a/Mac/scripts/MkDistr_ui.py b/Mac/scripts/MkDistr_ui.py index 15bfa42..3ea78a9 100644 --- a/Mac/scripts/MkDistr_ui.py +++ b/Mac/scripts/MkDistr_ui.py @@ -12,12 +12,12 @@ # - Box around lists (???) # - Change cursor while busy (need cursor support in Qd) # -import Res -import Dlg -import Ctl -import List -import Win -import Qd +from Carbon import Res +from Carbon import Dlg +from Carbon import Ctl +from Carbon import List +from Carbon import Win +from Carbon import Qd from FrameWork import * import EasyDialogs import macfs diff --git a/Mac/scripts/PackLibDir.py b/Mac/scripts/PackLibDir.py index 1180318..ba689e6 100644 --- a/Mac/scripts/PackLibDir.py +++ b/Mac/scripts/PackLibDir.py @@ -1,8 +1,8 @@ # # Turn a pyc file into a resource file containing it in 'PYC ' resource form -from Res import * -import Res -from Resources import * +from Carbon.Res import * +from Carbon import Res +from Carbon.Resources import * import os import macfs import sys diff --git a/Mac/scripts/RunLibScript.py b/Mac/scripts/RunLibScript.py index 362cb82..6ecf643 100644 --- a/Mac/scripts/RunLibScript.py +++ b/Mac/scripts/RunLibScript.py @@ -6,7 +6,7 @@ import imp import sys import os import string -import Dlg +from Carbon import Dlg import macfs DIALOG_ID = 512 @@ -83,7 +83,7 @@ def interact(): def main(): curdir = os.getcwd() - import Res + from Carbon import Res try: Res.FSpOpenResFile('RunLibScript.rsrc', 1) except: diff --git a/Mac/scripts/fullbuild.py b/Mac/scripts/fullbuild.py index 11340da..f5ccfc9 100644 --- a/Mac/scripts/fullbuild.py +++ b/Mac/scripts/fullbuild.py @@ -21,7 +21,7 @@ import string import genpluginprojects import aetools -import AppleEvents +from Carbon import AppleEvents OLDAESUPPORT = 0 @@ -33,8 +33,8 @@ if OLDAESUPPORT: else: import CodeWarrior -import Res -import Dlg +from Carbon import Res +from Carbon import Dlg import buildtools import cfmfile diff --git a/Mac/scripts/gensuitemodule.py b/Mac/scripts/gensuitemodule.py index 6549ed2..a1ae774 100644 --- a/Mac/scripts/gensuitemodule.py +++ b/Mac/scripts/gensuitemodule.py @@ -14,7 +14,7 @@ import types import StringIO import macfs -from Res import * +from Carbon.Res import * def main(): fss, ok = macfs.PromptGetFile('Select file with aeut/aete resource:') diff --git a/Mac/scripts/mkestrres.py b/Mac/scripts/mkestrres.py index 3ed3b34..b0580a2 100644 --- a/Mac/scripts/mkestrres.py +++ b/Mac/scripts/mkestrres.py @@ -3,7 +3,7 @@ import re import macfs import string -import Res +from Carbon import Res import os READ = 1 diff --git a/Mac/scripts/run.py b/Mac/scripts/run.py index 4fb040d..75c6129 100644 --- a/Mac/scripts/run.py +++ b/Mac/scripts/run.py @@ -27,7 +27,7 @@ def main(): #sys.exit(1) def message(str = "Hello, world!", id = 256): - import Dlg + from Carbon import Dlg d = Dlg.GetNewDialog(id, -1) if not d: print str |