diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index 034828b62d7..c7ebce81d19 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -336,16 +336,16 @@ def parseOptions(args=None): options, args = getopt.getopt(args, '?hb', [ 'build-dir=', 'third-party=', 'sdk-path=' , 'src-dir=']) except getopt.error as msg: - print msg + print(msg) sys.exit(1) if args: - print "Additional arguments" + print("Additional arguments") sys.exit(1) for k, v in options: if k in ('-h', '-?'): - print USAGE + print(USAGE) sys.exit(0) elif k in ('-d', '--build-dir'): @@ -368,12 +368,12 @@ def parseOptions(args=None): SDKPATH=os.path.abspath(SDKPATH) DEPSRC=os.path.abspath(DEPSRC) - print "Settings:" - print " * Source directory:", SRCDIR - print " * Build directory: ", WORKDIR - print " * SDK location: ", SDKPATH - print " * third-party source:", DEPSRC - print "" + print("Settings:") + print(" * Source directory:", SRCDIR) + print(" * Build directory: ", WORKDIR) + print(" * SDK location: ", SDKPATH) + print(" * third-party source:", DEPSRC) + print("") @@ -440,7 +440,7 @@ def downloadURL(url, fname): pass else: if KNOWNSIZES.get(url) == size: - print "Using existing file for", url + print("Using existing file for", url) return fpIn = urllib2.urlopen(url) fpOut = open(fname, 'wb') @@ -479,14 +479,14 @@ def buildRecipe(recipe, basedir, archList): if os.path.exists(sourceArchive): - print "Using local copy of %s"%(name,) + print("Using local copy of %s"%(name,)) else: - print "Downloading %s"%(name,) + print("Downloading %s"%(name,)) downloadURL(url, sourceArchive) - print "Archive for %s stored as %s"%(name, sourceArchive) + print("Archive for %s stored as %s"%(name, sourceArchive)) - print "Extracting archive for %s"%(name,) + print("Extracting archive for %s"%(name,)) buildDir=os.path.join(WORKDIR, '_bld') if not os.path.exists(buildDir): os.mkdir(buildDir) @@ -549,14 +549,14 @@ def buildRecipe(recipe, basedir, archList): configure_args.insert(0, configure) configure_args = [ shellQuote(a) for a in configure_args ] - print "Running configure for %s"%(name,) + print("Running configure for %s"%(name,)) runCommand(' '.join(configure_args) + ' 2>&1') - print "Running install for %s"%(name,) + print("Running install for %s"%(name,)) runCommand('{ ' + install + ' ;} 2>&1') - print "Done %s"%(name,) - print "" + print("Done %s"%(name,)) + print("") os.chdir(curdir) @@ -564,9 +564,9 @@ def buildLibraries(): """ Build our dependencies into $WORKDIR/libraries/usr/local """ - print "" - print "Building required libraries" - print "" + print("") + print("Building required libraries") + print("") universal = os.path.join(WORKDIR, 'libraries') os.mkdir(universal) os.makedirs(os.path.join(universal, 'usr', 'local', 'lib')) @@ -580,7 +580,7 @@ def buildLibraries(): def buildPythonDocs(): # This stores the documentation as Resources/English.lproj/Docuentation # inside the framwork. pydoc and IDLE will pick it up there. - print "Install python documentation" + print("Install python documentation") rootDir = os.path.join(WORKDIR, '_root') version = getVersion() docdir = os.path.join(rootDir, 'pydocs') @@ -588,13 +588,13 @@ def buildPythonDocs(): name = 'html-%s.tar.bz2'%(getFullVersion(),) sourceArchive = os.path.join(DEPSRC, name) if os.path.exists(sourceArchive): - print "Using local copy of %s"%(name,) + print("Using local copy of %s"%(name,)) else: - print "Downloading %s"%(name,) + print("Downloading %s"%(name,)) downloadURL('http://www.python.org/ftp/python/doc/%s/%s'%( getFullVersion(), name), sourceArchive) - print "Archive for %s stored as %s"%(name, sourceArchive) + print("Archive for %s stored as %s"%(name, sourceArchive)) extractArchive(os.path.dirname(docdir), sourceArchive) os.rename( @@ -604,7 +604,7 @@ def buildPythonDocs(): def buildPython(): - print "Building a universal python" + print("Building a universal python") buildDir = os.path.join(WORKDIR, '_bld', 'python') rootDir = os.path.join(WORKDIR, '_root') @@ -627,24 +627,24 @@ def buildPython(): # several paths. version = getVersion() - print "Running configure..." + print("Running configure...") runCommand("%s -C --enable-framework --enable-universalsdk=%s LDFLAGS='-g -L%s/libraries/usr/local/lib' OPT='-g -O3 -I%s/libraries/usr/local/include' 2>&1"%( shellQuote(os.path.join(SRCDIR, 'configure')), shellQuote(SDKPATH), shellQuote(WORKDIR)[1:-1], shellQuote(WORKDIR)[1:-1])) - print "Running make" + print("Running make") runCommand("make") - print "Running make frameworkinstall" + print("Running make frameworkinstall") runCommand("make frameworkinstall DESTDIR=%s"%( shellQuote(rootDir))) - print "Running make frameworkinstallextras" + print("Running make frameworkinstallextras") runCommand("make frameworkinstallextras DESTDIR=%s"%( shellQuote(rootDir))) - print "Copying required shared libraries" + print("Copying required shared libraries") if os.path.exists(os.path.join(WORKDIR, 'libraries', 'Library')): runCommand("mv %s/* %s"%( shellQuote(os.path.join( @@ -655,7 +655,7 @@ def buildPython(): 'Python.framework', 'Versions', getVersion(), 'lib')))) - print "Fix file modes" + print("Fix file modes") frmDir = os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework') gid = grp.getgrnam('admin').gr_gid @@ -744,7 +744,7 @@ def packageFromRecipe(targetDir, recipe): readme = textwrap.dedent(recipe['readme']) isRequired = recipe.get('required', True) - print "- building package %s"%(pkgname,) + print("- building package %s"%(pkgname,)) # Substitute some variables textvars = dict( @@ -1047,9 +1047,9 @@ def main(): shutil.copy('../../LICENSE', os.path.join(WORKDIR, 'installer', 'License.txt')) fp = open(os.path.join(WORKDIR, 'installer', 'Build.txt'), 'w') - print >> fp, "# BUILD INFO" - print >> fp, "# Date:", time.ctime() - print >> fp, "# By:", pwd.getpwuid(os.getuid()).pw_gecos + print("# BUILD INFO", file=fp) + print("# Date:", time.ctime(), file=fp) + print("# By:", pwd.getpwuid(os.getuid()).pw_gecos, file=fp) fp.close() # Custom icon for the DMG, shown when the DMG is mounted. diff --git a/Mac/Demo/PICTbrowse/PICTbrowse.py b/Mac/Demo/PICTbrowse/PICTbrowse.py index 0adfc837831..83f431ecc5e 100644 --- a/Mac/Demo/PICTbrowse/PICTbrowse.py +++ b/Mac/Demo/PICTbrowse/PICTbrowse.py @@ -69,9 +69,9 @@ class PICTwindow(FrameWork.Window): self.resid = resid picture = Qd.GetPicture(self.resid) # Get rect for picture - print repr(picture.data[:16]) + print(repr(picture.data[:16])) sz, t, l, b, r = struct.unpack('hhhhh', picture.data[:10]) - print 'pict:', t, l, b, r + print('pict:', t, l, b, r) width = r-l height = b-t if width < 64: width = 64 @@ -79,7 +79,7 @@ class PICTwindow(FrameWork.Window): if height < 64: height = 64 elif height > 320: height = 320 bounds = (LEFT, TOP, LEFT+width, TOP+height) - print 'bounds:', bounds + print('bounds:', bounds) self.wid = Win.NewWindow(bounds, resname, 1, 0, -1, 1, 0) self.wid.SetWindowPic(picture) diff --git a/Mac/Demo/PICTbrowse/oldPICTbrowse.py b/Mac/Demo/PICTbrowse/oldPICTbrowse.py index 8600bb2a1e1..2c6f08b5864 100644 --- a/Mac/Demo/PICTbrowse/oldPICTbrowse.py +++ b/Mac/Demo/PICTbrowse/oldPICTbrowse.py @@ -68,9 +68,9 @@ class PICTwindow(FrameWork.Window): self.resid = resid picture = Qd.GetPicture(self.resid) # Get rect for picture - print repr(picture.data[:16]) + print(repr(picture.data[:16])) sz, t, l, b, r = struct.unpack('hhhhh', picture.data[:10]) - print 'pict:', t, l, b, r + print('pict:', t, l, b, r) width = r-l height = b-t if width < 64: width = 64 @@ -78,7 +78,7 @@ class PICTwindow(FrameWork.Window): if height < 64: height = 64 elif height > 320: height = 320 bounds = (LEFT, TOP, LEFT+width, TOP+height) - print 'bounds:', bounds + print('bounds:', bounds) self.wid = Win.NewWindow(bounds, resname, 1, 0, -1, 1, 0) self.wid.SetWindowPic(picture) @@ -115,7 +115,7 @@ class MyDialog(FrameWork.DialogWindow): (what, message, when, where, modifiers) = event Qd.SetPort(self.wid) where = Qd.GlobalToLocal(where) - print 'LISTHIT', where + print('LISTHIT', where) if self.list.LClick(where, modifiers): self.do_show() diff --git a/Mac/Demo/applescript/makedisk.py b/Mac/Demo/applescript/makedisk.py index 013331cac60..981a5ef2869 100644 --- a/Mac/Demo/applescript/makedisk.py +++ b/Mac/Demo/applescript/makedisk.py @@ -8,8 +8,8 @@ filespec = macfs.FSSpec('my disk image.img') try: objref = talker.create('my disk image', saving_as=filespec, leave_image_mounted=1) except Disk_Copy.Error as arg: - print "ERROR: my disk image:", arg + print("ERROR: my disk image:", arg) else: - print 'objref=', objref -print 'Type return to exit-' + print('objref=', objref) +print('Type return to exit-') sys.stdin.readline() diff --git a/Mac/Demo/imgbrowse/imgbrowse.py b/Mac/Demo/imgbrowse/imgbrowse.py index 57cddd3eb47..fddfc999a05 100644 --- a/Mac/Demo/imgbrowse/imgbrowse.py +++ b/Mac/Demo/imgbrowse/imgbrowse.py @@ -25,7 +25,7 @@ MAXHEIGHT=320 def main(): - print 'hello world' + print('hello world') imgbrowse() class imgbrowse(FrameWork.Application): @@ -84,10 +84,10 @@ class imgwindow(FrameWork.Window): def do_update(self, *args): pass currect = self.fitrect() - print 'PICT:', self.pictrect - print 'WIND:', currect - print 'ARGS:', (self.pixmap, self.wid.GetWindowPort().GetPortBitMapForCopyBits(), self.pictrect, - currect, QuickDraw.srcCopy, None) + print('PICT:', self.pictrect) + print('WIND:', currect) + print('ARGS:', (self.pixmap, self.wid.GetWindowPort().GetPortBitMapForCopyBits(), self.pictrect, + currect, QuickDraw.srcCopy, None)) self.info() Qd.CopyBits(self.pixmap, self.wid.GetWindowPort().GetPortBitMapForCopyBits(), self.pictrect, currect, QuickDraw.srcCopy, None) diff --git a/Mac/Demo/imgbrowse/mac_image.py b/Mac/Demo/imgbrowse/mac_image.py index 9c9eeb72fc7..75baff438e4 100644 --- a/Mac/Demo/imgbrowse/mac_image.py +++ b/Mac/Demo/imgbrowse/mac_image.py @@ -38,19 +38,19 @@ def dumppixmap(data): cmpCount, cmpSize, \ planeBytes, pmTable, pmReserved \ = struct.unpack("lhhhhhhhlllhhhhlll", data) - print 'Base: 0x%x'%baseAddr - print 'rowBytes: %d (0x%x)'%(rowBytes&0x3fff, rowBytes) - print 'rect: %d, %d, %d, %d'%(t, l, b, r) - print 'pmVersion: 0x%x'%pmVersion - print 'packing: %d %d'%(packType, packSize) - print 'resolution: %f x %f'%(float(hRes)/0x10000, float(vRes)/0x10000) - print 'pixeltype: %d, size %d'%(pixelType, pixelSize) - print 'components: %d, size %d'%(cmpCount, cmpSize) - print 'planeBytes: %d (0x%x)'%(planeBytes, planeBytes) - print 'pmTable: 0x%x'%pmTable - print 'pmReserved: 0x%x'%pmReserved + print('Base: 0x%x'%baseAddr) + print('rowBytes: %d (0x%x)'%(rowBytes&0x3fff, rowBytes)) + print('rect: %d, %d, %d, %d'%(t, l, b, r)) + print('pmVersion: 0x%x'%pmVersion) + print('packing: %d %d'%(packType, packSize)) + print('resolution: %f x %f'%(float(hRes)/0x10000, float(vRes)/0x10000)) + print('pixeltype: %d, size %d'%(pixelType, pixelSize)) + print('components: %d, size %d'%(cmpCount, cmpSize)) + print('planeBytes: %d (0x%x)'%(planeBytes, planeBytes)) + print('pmTable: 0x%x'%pmTable) + print('pmReserved: 0x%x'%pmReserved) for i in range(0, len(data), 16): for j in range(16): if i + j < len(data): - print '%02.2x'%ord(data[i+j]), - print + print('%02.2x'%ord(data[i+j]), end=' ') + print() diff --git a/Mac/Demo/quicktime/VerySimplePlayer.py b/Mac/Demo/quicktime/VerySimplePlayer.py index 2930eac7782..7c0fef019e9 100644 --- a/Mac/Demo/quicktime/VerySimplePlayer.py +++ b/Mac/Demo/quicktime/VerySimplePlayer.py @@ -18,7 +18,7 @@ import sys # XXXX maxbounds = (40, 40, 1000, 1000) def main(): - print 'hello world' # XXXX + print('hello world') # XXXX # skip the toolbox initializations, already done # XXXX Should use gestalt here to check for quicktime version Qt.EnterMovies() @@ -75,7 +75,7 @@ def main(): whichWindow = Win.WhichWindow(message) if not whichWindow: # Probably the console window. Print something, hope it helps. - print 'update' + print('update') else: Qd.SetPort(whichWindow) whichWindow.BeginUpdate() diff --git a/Mac/Demo/resources/copyres.py b/Mac/Demo/resources/copyres.py index da55b0648f2..6c8a3c03b9d 100644 --- a/Mac/Demo/resources/copyres.py +++ b/Mac/Demo/resources/copyres.py @@ -34,7 +34,7 @@ def copyres(src, dst): id, type, name = res.GetResInfo() size = res.SizeResource() attrs = res.GetResAttrs() - print id, type, name, size, hex(attrs) + print(id, type, name, size, hex(attrs)) res.DetachResource() UseResFile(output) try: @@ -42,15 +42,15 @@ def copyres(src, dst): except (RuntimeError, Res.Error) as msg: res2 = None if res2: - print "Duplicate type+id, not copied" + print("Duplicate type+id, not copied") print (res2.size, res2.data) - print res2.GetResInfo() + print(res2.GetResInfo()) if res2.HomeResFile() == output: 'OK' elif res2.HomeResFile() == input: 'BAD!' else: - print 'Home:', res2.HomeResFile() + print('Home:', res2.HomeResFile()) else: res.AddResource(type, id, name) #res.SetResAttrs(attrs) diff --git a/Mac/Demo/resources/listres.py b/Mac/Demo/resources/listres.py index 6ce57792164..8f391ebfeba 100644 --- a/Mac/Demo/resources/listres.py +++ b/Mac/Demo/resources/listres.py @@ -7,7 +7,7 @@ def list1resources(): ntypes = Res.Count1Types() for itype in range(1, 1+ntypes): type = Res.Get1IndType(itype) - print "Type:", repr(type) + print("Type:", repr(type)) nresources = Res.Count1Resources(type) for i in range(1, 1 + nresources): Res.SetResLoad(0) @@ -19,7 +19,7 @@ def listresources(): ntypes = Res.CountTypes() for itype in range(1, 1+ntypes): type = Res.GetIndType(itype) - print "Type:", repr(type) + print("Type:", repr(type)) nresources = Res.CountResources(type) for i in range(1, 1 + nresources): Res.SetResLoad(0) @@ -28,7 +28,7 @@ def listresources(): info(res) def info(res): - print res.GetResInfo(), res.SizeResource(), decodeattrs(res.GetResAttrs()) + print(res.GetResInfo(), res.SizeResource(), decodeattrs(res.GetResAttrs())) attrnames = { resChanged: 'Changed', @@ -51,9 +51,9 @@ def decodeattrs(attrs): return names def test(): - print "=== Local resourcess ===" + print("=== Local resourcess ===") list1resources() - print "=== All resources ===" + print("=== All resources ===") listresources() if __name__ == '__main__': diff --git a/Mac/Demo/sound/playaiff.py b/Mac/Demo/sound/playaiff.py index 8237895250b..087f7c9c9f2 100644 --- a/Mac/Demo/sound/playaiff.py +++ b/Mac/Demo/sound/playaiff.py @@ -5,16 +5,16 @@ import aifc, audioop fn = 'f:just samples:2ndbeat.aif' af = aifc.open(fn, 'r') -print af.getparams() -print 'nframes =', af.getnframes() -print 'nchannels =', af.getnchannels() -print 'framerate =', af.getframerate() +print(af.getparams()) +print('nframes =', af.getnframes()) +print('nchannels =', af.getnchannels()) +print('framerate =', af.getframerate()) nframes = min(af.getnframes(), 100000) frames = af.readframes(nframes) -print 'len(frames) =', len(frames) -print repr(frames[:100]) +print('len(frames) =', len(frames)) +print(repr(frames[:100])) frames = audioop.add(frames, '\x80'*len(frames), 1) -print repr(frames[:100]) +print(repr(frames[:100])) import struct @@ -27,7 +27,7 @@ header1 = struct.pack('llhhllbbl', 0xFF, 60, nframes) -print repr(header1) +print(repr(header1)) header2 = struct.pack('llhlll', 0, 0, 0, 0, 0, 0) header3 = struct.pack('hhlll', af.getsampwidth()*8, @@ -35,7 +35,7 @@ header3 = struct.pack('hhlll', 0, 0, 0) -print repr(header3) +print(repr(header3)) header = header1 + header2 + header3 buffer = header + frames diff --git a/Mac/Demo/textedit/ped.py b/Mac/Demo/textedit/ped.py index 8cd4713469d..f28ae3cd59d 100644 --- a/Mac/Demo/textedit/ped.py +++ b/Mac/Demo/textedit/ped.py @@ -50,7 +50,7 @@ class TEWindow(ScrolledWindow): height = self.ted.nLines * self.ted.lineHeight vx = self.scalebarvalue(dr[0], dr[2]-dr[0], vr[0], vr[2]) vy = self.scalebarvalue(dr[1], dr[1]+height, vr[1], vr[3]) - print dr, vr, height, vx, vy + print(dr, vr, height, vx, vy) return None, vy def scrollbar_callback(self, which, what, value): @@ -72,12 +72,12 @@ class TEWindow(ScrolledWindow): if delta >= 0: delta = -self.ted.lineHeight self.ted.TEPinScroll(0, delta) - print 'SCROLL Y', delta + print('SCROLL Y', delta) else: pass # No horizontal scrolling def do_activate(self, onoff, evt): - print "ACTIVATE", onoff + print("ACTIVATE", onoff) ScrolledWindow.do_activate(self, onoff, evt) if onoff: self.ted.TEActivate() @@ -121,7 +121,7 @@ class TEWindow(ScrolledWindow): if not self.path: self.menu_save_as() return # Will call us recursively - print 'Saving to ', self.path + print('Saving to ', self.path) dhandle = self.ted.TEGetText() data = dhandle.data fp = open(self.path, 'wb') # NOTE: wb, because data has CR for end-of-line diff --git a/Mac/Extras.install.py b/Mac/Extras.install.py index ce00af38216..ab1af71dfd8 100644 --- a/Mac/Extras.install.py +++ b/Mac/Extras.install.py @@ -25,23 +25,23 @@ def copycleandir(src, dst): assert cursrc.startswith(src) curdst = dst + cursrc[len(src):] if verbose: - print "mkdir", curdst + print("mkdir", curdst) if not debug: if not os.path.exists(curdst): os.makedirs(curdst) for fn in files: if isclean(fn): if verbose: - print "copy", os.path.join(cursrc, fn), os.path.join(curdst, fn) + print("copy", os.path.join(cursrc, fn), os.path.join(curdst, fn)) if not debug: shutil.copy2(os.path.join(cursrc, fn), os.path.join(curdst, fn)) else: if verbose: - print "skipfile", os.path.join(cursrc, fn) + print("skipfile", os.path.join(cursrc, fn)) for i in range(len(dirs)-1, -1, -1): if not isclean(dirs[i]): if verbose: - print "skipdir", os.path.join(cursrc, dirs[i]) + print("skipdir", os.path.join(cursrc, dirs[i])) del dirs[i] def main(): diff --git a/Mac/Modules/ae/aescan.py b/Mac/Modules/ae/aescan.py index 0ea367c82fe..c23d18f8756 100644 --- a/Mac/Modules/ae/aescan.py +++ b/Mac/Modules/ae/aescan.py @@ -13,18 +13,18 @@ sys.path.append(BGENDIR) from scantools import Scanner def main(): - print "=== Scanning AEDataModel.h, AppleEvents.h, AERegistry.h, AEObjects.h ===" + print("=== Scanning AEDataModel.h, AppleEvents.h, AERegistry.h, AEObjects.h ===") input = ["AEDataModel.h", "AEInteraction.h", "AppleEvents.h", "AERegistry.h", "AEObjects.h"] output = "aegen.py" defsoutput = TOOLBOXDIR + "AppleEvents.py" scanner = AppleEventsScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done Scanning and Generating, now doing 'import aesupport' ===" + print("=== Done Scanning and Generating, now doing 'import aesupport' ===") import aesupport - print "=== Done 'import aesupport'. It's up to you to compile AEmodule.c ===" + print("=== Done 'import aesupport'. It's up to you to compile AEmodule.c ===") class AppleEventsScanner(Scanner): diff --git a/Mac/Modules/ah/ahscan.py b/Mac/Modules/ah/ahscan.py index 8768b60b315..f52b7716b0d 100644 --- a/Mac/Modules/ah/ahscan.py +++ b/Mac/Modules/ah/ahscan.py @@ -17,11 +17,11 @@ def main(): scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner_OSX): diff --git a/Mac/Modules/app/appscan.py b/Mac/Modules/app/appscan.py index 246d61ee2b2..fa154ca234f 100644 --- a/Mac/Modules/app/appscan.py +++ b/Mac/Modules/app/appscan.py @@ -17,11 +17,11 @@ def main(): scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner): diff --git a/Mac/Modules/carbonevt/CarbonEvtscan.py b/Mac/Modules/carbonevt/CarbonEvtscan.py index 7307327fa85..e29456f67e8 100644 --- a/Mac/Modules/carbonevt/CarbonEvtscan.py +++ b/Mac/Modules/carbonevt/CarbonEvtscan.py @@ -12,18 +12,18 @@ sys.path.append(BGENDIR) from scantools import Scanner, Scanner_OSX def main(): - print "---Scanning CarbonEvents.h---" + print("---Scanning CarbonEvents.h---") input = ["CarbonEvents.h"] output = "CarbonEventsgen.py" defsoutput = TOOLBOXDIR + "CarbonEvents.py" scanner = CarbonEvents_Scanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "--done scanning, importing--" + print("--done scanning, importing--") import CarbonEvtsupport - print "done" + print("done") RefObjectTypes = ["EventRef", "EventQueueRef", diff --git a/Mac/Modules/cf/cfscan.py b/Mac/Modules/cf/cfscan.py index 5ff9534bde4..20751aeda89 100644 --- a/Mac/Modules/cf/cfscan.py +++ b/Mac/Modules/cf/cfscan.py @@ -44,11 +44,11 @@ def main(): scanner.scan() scanner.gentypetest(SHORT+"typetest.py") scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner_OSX): diff --git a/Mac/Modules/cg/cgscan.py b/Mac/Modules/cg/cgscan.py index 82f49191583..ba0ff2a1ef2 100755 --- a/Mac/Modules/cg/cgscan.py +++ b/Mac/Modules/cg/cgscan.py @@ -22,11 +22,11 @@ def main(): scanner.scan() scanner.gentypetest(SHORT+"typetest.py") scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner_OSX): diff --git a/Mac/Modules/cm/cmscan.py b/Mac/Modules/cm/cmscan.py index 1a1e46d6f23..bbe02105128 100644 --- a/Mac/Modules/cm/cmscan.py +++ b/Mac/Modules/cm/cmscan.py @@ -16,11 +16,11 @@ def main(): scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner): diff --git a/Mac/Modules/ctl/ctlscan.py b/Mac/Modules/ctl/ctlscan.py index dd74d238f83..323ff9a1e37 100644 --- a/Mac/Modules/ctl/ctlscan.py +++ b/Mac/Modules/ctl/ctlscan.py @@ -14,11 +14,11 @@ def main(): scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now doing 'import ctlsupport' ===" + print("=== Done scanning and generating, now doing 'import ctlsupport' ===") import ctlsupport - print "=== Done. It's up to you to compile Ctlmodule.c ===" + print("=== Done. It's up to you to compile Ctlmodule.c ===") class MyScanner(Scanner): diff --git a/Mac/Modules/dlg/dlgscan.py b/Mac/Modules/dlg/dlgscan.py index bf37129b9e9..fbdbc506127 100644 --- a/Mac/Modules/dlg/dlgscan.py +++ b/Mac/Modules/dlg/dlgscan.py @@ -18,11 +18,11 @@ def main(): scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner): diff --git a/Mac/Modules/drag/dragscan.py b/Mac/Modules/drag/dragscan.py index e89897a5624..b1aa6d58446 100644 --- a/Mac/Modules/drag/dragscan.py +++ b/Mac/Modules/drag/dragscan.py @@ -25,11 +25,11 @@ def main(): scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now doing 'import dragsupport' ===" + print("=== Done scanning and generating, now doing 'import dragsupport' ===") import dragsupport - print "=== Done. It's up to you to compile Dragmodule.c ===" + print("=== Done. It's up to you to compile Dragmodule.c ===") class MyScanner(Scanner): diff --git a/Mac/Modules/evt/evtscan.py b/Mac/Modules/evt/evtscan.py index 0adce8b1551..8501f013943 100644 --- a/Mac/Modules/evt/evtscan.py +++ b/Mac/Modules/evt/evtscan.py @@ -17,11 +17,11 @@ def main(): scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner): diff --git a/Mac/Modules/file/filescan.py b/Mac/Modules/file/filescan.py index b7c5d121e4c..574a9d6e5ab 100644 --- a/Mac/Modules/file/filescan.py +++ b/Mac/Modules/file/filescan.py @@ -17,11 +17,11 @@ def main(): scanner.scan() scanner.close() scanner.gentypetest(SHORT+"typetest.py") - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner_OSX): diff --git a/Mac/Modules/fm/fmscan.py b/Mac/Modules/fm/fmscan.py index 38abcacf98b..ec6c597c4f0 100644 --- a/Mac/Modules/fm/fmscan.py +++ b/Mac/Modules/fm/fmscan.py @@ -16,11 +16,11 @@ def main(): scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner): diff --git a/Mac/Modules/folder/folderscan.py b/Mac/Modules/folder/folderscan.py index cccb720adb8..26306420fd8 100644 --- a/Mac/Modules/folder/folderscan.py +++ b/Mac/Modules/folder/folderscan.py @@ -18,11 +18,11 @@ def main(): scanner.scan() scanner.close() scanner.gentypetest(SHORT+"typetest.py") - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner_OSX): diff --git a/Mac/Modules/help/helpscan.py b/Mac/Modules/help/helpscan.py index fa8dbde986b..7ad82e512be 100644 --- a/Mac/Modules/help/helpscan.py +++ b/Mac/Modules/help/helpscan.py @@ -17,11 +17,11 @@ def main(): scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner): diff --git a/Mac/Modules/ibcarbon/IBCarbonscan.py b/Mac/Modules/ibcarbon/IBCarbonscan.py index eb7267de150..9470dacba02 100644 --- a/Mac/Modules/ibcarbon/IBCarbonscan.py +++ b/Mac/Modules/ibcarbon/IBCarbonscan.py @@ -10,18 +10,18 @@ sys.path.append(BGENDIR) from scantools import Scanner_OSX def main(): - print "---Scanning IBCarbonRuntime.h---" + print("---Scanning IBCarbonRuntime.h---") input = ["IBCarbonRuntime.h"] output = "IBCarbongen.py" defsoutput = TOOLBOXDIR + "IBCarbonRuntime.py" scanner = IBCarbon_Scanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "--done scanning, importing--" + print("--done scanning, importing--") import IBCarbonsupport - print "done" + print("done") class IBCarbon_Scanner(Scanner_OSX): diff --git a/Mac/Modules/icn/icnscan.py b/Mac/Modules/icn/icnscan.py index 2d20062bf2f..3ee357c09e6 100644 --- a/Mac/Modules/icn/icnscan.py +++ b/Mac/Modules/icn/icnscan.py @@ -17,11 +17,11 @@ def main(): scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner): diff --git a/Mac/Modules/launch/launchscan.py b/Mac/Modules/launch/launchscan.py index dd43e375526..8d535fb1574 100644 --- a/Mac/Modules/launch/launchscan.py +++ b/Mac/Modules/launch/launchscan.py @@ -18,11 +18,11 @@ def main(): scanner.scan() scanner.close() scanner.gentypetest(SHORT+"typetest.py") - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner): diff --git a/Mac/Modules/list/listscan.py b/Mac/Modules/list/listscan.py index 14e7dcac28b..233ad5fe8d4 100644 --- a/Mac/Modules/list/listscan.py +++ b/Mac/Modules/list/listscan.py @@ -17,11 +17,11 @@ def main(): scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner): diff --git a/Mac/Modules/menu/menuscan.py b/Mac/Modules/menu/menuscan.py index 46afe16532f..bcd50192e41 100644 --- a/Mac/Modules/menu/menuscan.py +++ b/Mac/Modules/menu/menuscan.py @@ -13,11 +13,11 @@ def main(): scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now doing 'import menusupport' ===" + print("=== Done scanning and generating, now doing 'import menusupport' ===") import menusupport - print "=== Done. It's up to you to compile Menumodule.c ===" + print("=== Done. It's up to you to compile Menumodule.c ===") class MyScanner(Scanner): diff --git a/Mac/Modules/mlte/mltescan.py b/Mac/Modules/mlte/mltescan.py index 9566ad7d004..ee095ecd8e2 100644 --- a/Mac/Modules/mlte/mltescan.py +++ b/Mac/Modules/mlte/mltescan.py @@ -19,11 +19,11 @@ def main(): scanner.scan() scanner.gentypetest(SHORT+"typetest.py") scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner_OSX): diff --git a/Mac/Modules/osa/osascan.py b/Mac/Modules/osa/osascan.py index 8bad4b7bd9d..085dd108320 100644 --- a/Mac/Modules/osa/osascan.py +++ b/Mac/Modules/osa/osascan.py @@ -17,11 +17,11 @@ def main(): scanner.scan() scanner.close() scanner.gentypetest(SHORT+"typetest.py") - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner): diff --git a/Mac/Modules/qd/qdscan.py b/Mac/Modules/qd/qdscan.py index c601b0e9fd3..9c52f14cbef 100644 --- a/Mac/Modules/qd/qdscan.py +++ b/Mac/Modules/qd/qdscan.py @@ -28,7 +28,7 @@ def main(): except IOError: pass if have_extra: - print "=== Copying QuickDrawText stuff into main files... ===" + print("=== Copying QuickDrawText stuff into main files... ===") ifp = open("@qdgentext.py") ofp = open("qdgen.py", "a") ofp.write(ifp.read()) @@ -40,11 +40,11 @@ def main(): ifp.close() ofp.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") import qdsupport - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner): diff --git a/Mac/Modules/qdoffs/qdoffsscan.py b/Mac/Modules/qdoffs/qdoffsscan.py index 7e8f3160537..a7bf518bdc4 100644 --- a/Mac/Modules/qdoffs/qdoffsscan.py +++ b/Mac/Modules/qdoffs/qdoffsscan.py @@ -13,11 +13,11 @@ def main(): scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") import qdoffssupport - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner): diff --git a/Mac/Modules/qt/qtscan.py b/Mac/Modules/qt/qtscan.py index ac561447597..97a776b2c80 100644 --- a/Mac/Modules/qt/qtscan.py +++ b/Mac/Modules/qt/qtscan.py @@ -34,11 +34,11 @@ def main(): scanner.scan() scanner.close() scanner.gentypetest(SHORT+"typetest.py") - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner): diff --git a/Mac/Modules/res/resscan.py b/Mac/Modules/res/resscan.py index 853fa136fdb..42f01e0f882 100644 --- a/Mac/Modules/res/resscan.py +++ b/Mac/Modules/res/resscan.py @@ -19,11 +19,11 @@ def main(): scanner = ResourcesScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now doing 'import ressupport' ===" + print("=== Done scanning and generating, now doing 'import ressupport' ===") import ressupport - print "=== Done 'import ressupport'. It's up to you to compile Resmodule.c ===" + print("=== Done 'import ressupport'. It's up to you to compile Resmodule.c ===") class ResourcesScanner(Scanner): diff --git a/Mac/Modules/scrap/scrapscan.py b/Mac/Modules/scrap/scrapscan.py index 7521fba07cf..6239e92fdce 100644 --- a/Mac/Modules/scrap/scrapscan.py +++ b/Mac/Modules/scrap/scrapscan.py @@ -21,9 +21,9 @@ def main(): scanner.close() ## print "=== Testing definitions output code ===" ## exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner): diff --git a/Mac/Modules/snd/sndscan.py b/Mac/Modules/snd/sndscan.py index bcdd0624094..4c4a2268fba 100644 --- a/Mac/Modules/snd/sndscan.py +++ b/Mac/Modules/snd/sndscan.py @@ -16,11 +16,11 @@ def main(): scanner = SoundScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now doing 'import sndsupport' ===" + print("=== Done scanning and generating, now doing 'import sndsupport' ===") import sndsupport - print "=== Done. It's up to you to compile Sndmodule.c ===" + print("=== Done. It's up to you to compile Sndmodule.c ===") class SoundScanner(Scanner): diff --git a/Mac/Modules/te/tescan.py b/Mac/Modules/te/tescan.py index c0d6e1c3105..316b7fbc2af 100644 --- a/Mac/Modules/te/tescan.py +++ b/Mac/Modules/te/tescan.py @@ -17,11 +17,11 @@ def main(): scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") exec "import " + SHORT + "support" - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner): diff --git a/Mac/Modules/win/winscan.py b/Mac/Modules/win/winscan.py index 8d2cea9a8c6..023c7374522 100644 --- a/Mac/Modules/win/winscan.py +++ b/Mac/Modules/win/winscan.py @@ -13,11 +13,11 @@ def main(): scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.close() - print "=== Testing definitions output code ===" + print("=== Testing definitions output code ===") exec(open(defsoutput).read(), {}, {}) - print "=== Done scanning and generating, now importing the generated code... ===" + print("=== Done scanning and generating, now importing the generated code... ===") import winsupport - print "=== Done. It's up to you to compile it now! ===" + print("=== Done. It's up to you to compile it now! ===") class MyScanner(Scanner): diff --git a/Mac/Tools/Doc/setup.py b/Mac/Tools/Doc/setup.py index bd86a20a838..5f60c5184d3 100644 --- a/Mac/Tools/Doc/setup.py +++ b/Mac/Tools/Doc/setup.py @@ -100,7 +100,7 @@ class DocBuild(build): if os.path.isdir(origPath): self.mkpath(outPath) elif ext == '.html': - if self.verbose: print 'hacking %s to %s' % (origPath,outPath) + if self.verbose: print('hacking %s to %s' % (origPath,outPath)) hackedFile = file(outPath, 'w') origFile = file(origPath,'r') hackedFile.write(self.r.sub('