From 0c4d947eacfb360515a5ba58f1a6b96dddc6d265 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 17 Apr 1998 14:07:56 +0000 Subject: [PATCH] Replaced addpack by handcrafted code to find the bgen stuff. --- Mac/Modules/ae/aescan.py | 7 ++++--- Mac/Modules/ae/aesupport.py | 2 -- Mac/Modules/ae/nsremote.py | 5 ----- Mac/Modules/cm/cmscan.py | 6 ++++-- Mac/Modules/ctl/ctlscan.py | 6 ++++-- Mac/Modules/ctl/ctlsupport.py | 3 --- Mac/Modules/dlg/dlgscan.py | 6 ++++-- Mac/Modules/dlg/dlgsupport.py | 3 --- Mac/Modules/evt/evtscan.py | 6 ++++-- Mac/Modules/fm/fmscan.py | 6 ++++-- Mac/Modules/help/helpscan.py | 6 ++++-- Mac/Modules/list/listscan.py | 6 ++++-- Mac/Modules/menu/menuscan.py | 6 ++++-- Mac/Modules/menu/menusupport.py | 3 --- Mac/Modules/qd/qdscan.py | 6 ++++-- Mac/Modules/qd/qdsupport.py | 3 --- Mac/Modules/qt/qtscan.py | 6 ++++-- Mac/Modules/res/resscan.py | 5 +++-- Mac/Modules/res/ressupport.py | 3 --- Mac/Modules/scrap/scrapscan.py | 6 ++++-- Mac/Modules/snd/sndscan.py | 6 ++++-- Mac/Modules/snd/sndsupport.py | 3 --- Mac/Modules/te/TEmodule.c | 2 +- Mac/Modules/te/tescan.py | 6 ++++-- Mac/Modules/waste/wastescan.py | 6 ++++-- Mac/Modules/win/winscan.py | 6 ++++-- Mac/Modules/win/winsupport.py | 3 --- 27 files changed, 68 insertions(+), 64 deletions(-) diff --git a/Mac/Modules/ae/aescan.py b/Mac/Modules/ae/aescan.py index 620a91c8a74..c1f4251a470 100644 --- a/Mac/Modules/ae/aescan.py +++ b/Mac/Modules/ae/aescan.py @@ -1,15 +1,16 @@ # Scan AppleEvents.h header file, generate aegen.py and AppleEvents.py files. # Then run aesupport to generate AEmodule.c. -0# (Should learn how to tell the compiler to compile it as well.) +# (Should learn how to tell the compiler to compile it as well.) -import addpack -addpack.addpack(':Tools:bgen:bgen') import sys import os import string import regex import regsub import MacOS + +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from bgenlocations import TOOLBOXDIR from scantools import Scanner diff --git a/Mac/Modules/ae/aesupport.py b/Mac/Modules/ae/aesupport.py index f2c947fcb83..58af2df9be3 100644 --- a/Mac/Modules/ae/aesupport.py +++ b/Mac/Modules/ae/aesupport.py @@ -3,8 +3,6 @@ # It execs the file aegen.py which contain the function definitions # (aegen.py was generated by aescan.py, scanning the header file). -import addpack -addpack.addpack(':Tools:bgen:bgen') from macsupport import * diff --git a/Mac/Modules/ae/nsremote.py b/Mac/Modules/ae/nsremote.py index cace37450ea..d823216bcb6 100644 --- a/Mac/Modules/ae/nsremote.py +++ b/Mac/Modules/ae/nsremote.py @@ -11,13 +11,8 @@ Jack Jansen, CWI, January 1996. # be nicer to use the more "object oriented" standard OSA stuff, when it # is implemented in Netscape. # -import addpack import sys -addpack.addpack('Tools') -addpack.addpack('bgen') -addpack.addpack('ae') - import aetools import Standard_Suite import WWW_Suite diff --git a/Mac/Modules/cm/cmscan.py b/Mac/Modules/cm/cmscan.py index 3e091a6dd86..e1db4b4d4be 100644 --- a/Mac/Modules/cm/cmscan.py +++ b/Mac/Modules/cm/cmscan.py @@ -1,7 +1,9 @@ # Scan an Apple header file, generating a Python file of generator calls. -import addpack -addpack.addpack(':tools:bgen:bgen') +import sys +import os +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from scantools import Scanner from bgenlocations import TOOLBOXDIR diff --git a/Mac/Modules/ctl/ctlscan.py b/Mac/Modules/ctl/ctlscan.py index 311295bdec3..4c4dbd1711a 100644 --- a/Mac/Modules/ctl/ctlscan.py +++ b/Mac/Modules/ctl/ctlscan.py @@ -1,6 +1,8 @@ # Scan , generating ctlgen.py. -import addpack -addpack.addpack(':Tools:bgen:bgen') +import sys +import os +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from scantools import Scanner from bgenlocations import TOOLBOXDIR diff --git a/Mac/Modules/ctl/ctlsupport.py b/Mac/Modules/ctl/ctlsupport.py index a905970b8fe..cee9a4c39e9 100644 --- a/Mac/Modules/ctl/ctlsupport.py +++ b/Mac/Modules/ctl/ctlsupport.py @@ -5,9 +5,6 @@ import string -import addpack -addpack.addpack(':Tools:bgen:bgen') - # Declarations that change for each manager MACHEADERFILE = 'Controls.h' # The Apple header file MODNAME = 'Ctl' # The name of the module diff --git a/Mac/Modules/dlg/dlgscan.py b/Mac/Modules/dlg/dlgscan.py index d51a2d1e26b..7ae13410fef 100644 --- a/Mac/Modules/dlg/dlgscan.py +++ b/Mac/Modules/dlg/dlgscan.py @@ -1,7 +1,9 @@ # Scan an Apple header file, generating a Python file of generator calls. -import addpack -addpack.addpack(':Tools:bgen:bgen') +import sys +import os +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from scantools import Scanner from bgenlocations import TOOLBOXDIR diff --git a/Mac/Modules/dlg/dlgsupport.py b/Mac/Modules/dlg/dlgsupport.py index b8531ca9e7c..cbec13032bf 100644 --- a/Mac/Modules/dlg/dlgsupport.py +++ b/Mac/Modules/dlg/dlgsupport.py @@ -3,9 +3,6 @@ # It execs the file dlggen.py which contain the function definitions # (dlggen.py was generated by dlgscan.py, scanning the header file). -import addpack -addpack.addpack(':Tools:bgen:bgen') - from macsupport import * # Create the type objects diff --git a/Mac/Modules/evt/evtscan.py b/Mac/Modules/evt/evtscan.py index 676c839f58e..3b3765fc34b 100644 --- a/Mac/Modules/evt/evtscan.py +++ b/Mac/Modules/evt/evtscan.py @@ -1,7 +1,9 @@ # Scan an Apple header file, generating a Python file of generator calls. -import addpack -addpack.addpack(':tools:bgen:bgen') +import sys +import os +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from scantools import Scanner from bgenlocations import TOOLBOXDIR diff --git a/Mac/Modules/fm/fmscan.py b/Mac/Modules/fm/fmscan.py index 3f0e51b9712..d111964b5c9 100644 --- a/Mac/Modules/fm/fmscan.py +++ b/Mac/Modules/fm/fmscan.py @@ -1,7 +1,9 @@ # Scan an Apple header file, generating a Python file of generator calls. -import addpack -addpack.addpack(':tools:bgen:bgen') +import sys +import os +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from scantools import Scanner from bgenlocations import TOOLBOXDIR diff --git a/Mac/Modules/help/helpscan.py b/Mac/Modules/help/helpscan.py index 3b1db65df10..da95e857072 100644 --- a/Mac/Modules/help/helpscan.py +++ b/Mac/Modules/help/helpscan.py @@ -1,7 +1,9 @@ # Scan an Apple header file, generating a Python file of generator calls. -import addpack -addpack.addpack(':tools:bgen:bgen') +import sys +import os +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from scantools import Scanner from bgenlocations import TOOLBOXDIR diff --git a/Mac/Modules/list/listscan.py b/Mac/Modules/list/listscan.py index dbaed68eaf3..d713c39ec56 100644 --- a/Mac/Modules/list/listscan.py +++ b/Mac/Modules/list/listscan.py @@ -1,7 +1,9 @@ # Scan an Apple header file, generating a Python file of generator calls. -import addpack -addpack.addpack(':tools:bgen:bgen') +import sys +import os +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from scantools import Scanner from bgenlocations import TOOLBOXDIR diff --git a/Mac/Modules/menu/menuscan.py b/Mac/Modules/menu/menuscan.py index cf00dcc1d29..37ced2ff99b 100644 --- a/Mac/Modules/menu/menuscan.py +++ b/Mac/Modules/menu/menuscan.py @@ -1,6 +1,8 @@ # Scan , generating menugen.py. -import addpack -addpack.addpack(':Tools:bgen:bgen') +import sys +import os +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from scantools import Scanner from bgenlocations import TOOLBOXDIR diff --git a/Mac/Modules/menu/menusupport.py b/Mac/Modules/menu/menusupport.py index 80b08b1ee0d..cbd57bf52a7 100644 --- a/Mac/Modules/menu/menusupport.py +++ b/Mac/Modules/menu/menusupport.py @@ -5,9 +5,6 @@ import string -import addpack -addpack.addpack(':Tools:bgen:bgen') - # Declarations that change for each manager MACHEADERFILE = 'Menus.h' # The Apple header file MODNAME = 'Menu' # The name of the module diff --git a/Mac/Modules/qd/qdscan.py b/Mac/Modules/qd/qdscan.py index 46adaaa585a..2619d363e6e 100644 --- a/Mac/Modules/qd/qdscan.py +++ b/Mac/Modules/qd/qdscan.py @@ -1,7 +1,9 @@ # Scan an Apple header file, generating a Python file of generator calls. -import addpack -addpack.addpack(':Tools:bgen:bgen') +import sys +import os +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from scantools import Scanner from bgenlocations import TOOLBOXDIR diff --git a/Mac/Modules/qd/qdsupport.py b/Mac/Modules/qd/qdsupport.py index 461d27f0ff4..9b1151b88b3 100644 --- a/Mac/Modules/qd/qdsupport.py +++ b/Mac/Modules/qd/qdsupport.py @@ -5,9 +5,6 @@ import string -import addpack -addpack.addpack(':Tools:bgen:bgen') - # Declarations that change for each manager MACHEADERFILE = 'QuickDraw.h' # The Apple header file MODNAME = 'Qd' # The name of the module diff --git a/Mac/Modules/qt/qtscan.py b/Mac/Modules/qt/qtscan.py index ebef23bbb2b..9f326a68451 100644 --- a/Mac/Modules/qt/qtscan.py +++ b/Mac/Modules/qt/qtscan.py @@ -1,7 +1,9 @@ # Scan an Apple header file, generating a Python file of generator calls. -import addpack -addpack.addpack(':tools:bgen:bgen') +import sys +import os +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from scantools import Scanner from bgenlocations import TOOLBOXDIR diff --git a/Mac/Modules/res/resscan.py b/Mac/Modules/res/resscan.py index eff0005a8cc..efb538c791c 100644 --- a/Mac/Modules/res/resscan.py +++ b/Mac/Modules/res/resscan.py @@ -8,8 +8,9 @@ import string import regex import regsub import MacOS -import addpack -addpack.addpack(':Tools:bgen:bgen') + +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from bgenlocations import TOOLBOXDIR from scantools import Scanner diff --git a/Mac/Modules/res/ressupport.py b/Mac/Modules/res/ressupport.py index 4b4bd2f90d7..5d45f2ebd00 100644 --- a/Mac/Modules/res/ressupport.py +++ b/Mac/Modules/res/ressupport.py @@ -3,9 +3,6 @@ # It execs the file resgen.py which contain the function definitions # (resgen.py was generated by resscan.py, scanning the header file). -import addpack -addpack.addpack(':Tools:bgen:bgen') - from macsupport import * diff --git a/Mac/Modules/scrap/scrapscan.py b/Mac/Modules/scrap/scrapscan.py index 0bad7c264b4..95bf1bb1143 100644 --- a/Mac/Modules/scrap/scrapscan.py +++ b/Mac/Modules/scrap/scrapscan.py @@ -3,8 +3,10 @@ # Note that the scrap-manager include file is so weird that this # generates a boilerplate to be edited by hand. -import addpack -addpack.addpack(':tools:bgen:bgen') +import sys +import os +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from scantools import Scanner from bgenlocations import TOOLBOXDIR diff --git a/Mac/Modules/snd/sndscan.py b/Mac/Modules/snd/sndscan.py index c7ca36bcc3d..f2f19ecf48f 100644 --- a/Mac/Modules/snd/sndscan.py +++ b/Mac/Modules/snd/sndscan.py @@ -2,8 +2,10 @@ # Then import sndsupport (which execs sndgen.py) to generate Sndmodule.c. # (Should learn how to tell the compiler to compile it as well.) -import addpack -addpack.addpack(':Tools:bgen:bgen') +import sys +import os +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from bgenlocations import TOOLBOXDIR from scantools import Scanner diff --git a/Mac/Modules/snd/sndsupport.py b/Mac/Modules/snd/sndsupport.py index 279f22a4812..9856e79a1e8 100644 --- a/Mac/Modules/snd/sndsupport.py +++ b/Mac/Modules/snd/sndsupport.py @@ -3,9 +3,6 @@ # It execs the file sndgen.py which contain the function definitions # (sndgen.py was generated by sndscan.py, scanning the header file). -import addpack -addpack.addpack(':Tools:bgen:bgen') - from macsupport import * diff --git a/Mac/Modules/te/TEmodule.c b/Mac/Modules/te/TEmodule.c index 70891fffcc7..1c7e4f45485 100644 --- a/Mac/Modules/te/TEmodule.c +++ b/Mac/Modules/te/TEmodule.c @@ -217,7 +217,7 @@ static PyObject *TEObj_TEKey(_self, _args) { PyObject *_res = NULL; CharParameter key; - if (!PyArg_ParseTuple(_args, "c", + if (!PyArg_ParseTuple(_args, "h", &key)) return NULL; TEKey(key, diff --git a/Mac/Modules/te/tescan.py b/Mac/Modules/te/tescan.py index 8d919e86658..0e537abef99 100644 --- a/Mac/Modules/te/tescan.py +++ b/Mac/Modules/te/tescan.py @@ -1,7 +1,9 @@ # Scan an Apple header file, generating a Python file of generator calls. -import addpack -addpack.addpack(':tools:bgen:bgen') +import sys +import os +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from scantools import Scanner from bgenlocations import TOOLBOXDIR diff --git a/Mac/Modules/waste/wastescan.py b/Mac/Modules/waste/wastescan.py index ee9fa41eb44..25f8d5d3816 100644 --- a/Mac/Modules/waste/wastescan.py +++ b/Mac/Modules/waste/wastescan.py @@ -1,7 +1,9 @@ # Scan an Apple header file, generating a Python file of generator calls. -import addpack -addpack.addpack(':tools:bgen:bgen') +import sys +import os +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from scantools import Scanner_PreUH3 from bgenlocations import MWERKSDIR, TOOLBOXDIR diff --git a/Mac/Modules/win/winscan.py b/Mac/Modules/win/winscan.py index ae0462f821e..f15fb168cc0 100644 --- a/Mac/Modules/win/winscan.py +++ b/Mac/Modules/win/winscan.py @@ -1,6 +1,8 @@ # Scan an Apple header file, generating a Python file of generator calls. -import addpack -addpack.addpack(':Tools:bgen:bgen') +import sys +import os +BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') +sys.path.append(BGENDIR) from bgenlocations import TOOLBOXDIR from scantools import Scanner diff --git a/Mac/Modules/win/winsupport.py b/Mac/Modules/win/winsupport.py index 001a4a46339..c7e1f7ac721 100644 --- a/Mac/Modules/win/winsupport.py +++ b/Mac/Modules/win/winsupport.py @@ -5,9 +5,6 @@ import string -import addpack -addpack.addpack(':Tools:bgen:bgen') - # Declarations that change for each manager MACHEADERFILE = 'Windows.h' # The Apple header file MODNAME = 'Win' # The name of the module