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 /Mac/Tools | |
parent | 6dba6bc0a226c2dd384d9311b9ad842be653c2b5 (diff) | |
download | cpython-5a6fdcd3718927109592c6df692fe24a8fdaee31.zip cpython-5a6fdcd3718927109592c6df692fe24a8fdaee31.tar.gz cpython-5a6fdcd3718927109592c6df692fe24a8fdaee31.tar.bz2 |
Import the MacOS toolbox modules from the Carbon package.
Diffstat (limited to 'Mac/Tools')
27 files changed, 95 insertions, 90 deletions
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): |