Put all prints inside "if verbose:"

This commit is contained in:
Jack Jansen 1997-08-27 14:11:15 +00:00
parent ebacc2edff
commit 09dcff793f
1 changed files with 23 additions and 20 deletions

View File

@ -10,6 +10,7 @@
import sys import sys
import os import os
import macfs import macfs
verbose=0
ppc_goals = [ ppc_goals = [
("AE.ppc.slb", "toolboxmodules.ppc.slb"), ("AE.ppc.slb", "toolboxmodules.ppc.slb"),
@ -78,7 +79,7 @@ def gotopluginfolder():
while not os.path.isdir(":Plugins"): while not os.path.isdir(":Plugins"):
os.chdir("::") os.chdir("::")
os.chdir(":Plugins") os.chdir(":Plugins")
print "current directory is", os.getcwd() if verbose: print "current directory is", os.getcwd()
def loadtoolboxmodules(): def loadtoolboxmodules():
"""Attempt to load the Res module""" """Attempt to load the Res module"""
@ -88,7 +89,7 @@ def loadtoolboxmodules():
err1 = arg err1 = arg
pass pass
else: else:
print 'imported Res the standard way.' if verbose: print 'imported Res the standard way.'
return return
# We cannot import it. First attempt to load the cfm68k version # We cannot import it. First attempt to load the cfm68k version
@ -99,7 +100,7 @@ def loadtoolboxmodules():
err2 = arg err2 = arg
pass pass
else: else:
print 'Loaded Res from toolboxmodules.CFM68K.slb.' if verbose: print 'Loaded Res from toolboxmodules.CFM68K.slb.'
return return
# Ok, try the ppc version # Ok, try the ppc version
@ -109,7 +110,7 @@ def loadtoolboxmodules():
err3 = arg err3 = arg
pass pass
else: else:
print 'Loaded Res from toolboxmodules.ppc.slb.' if verbose: print 'Loaded Res from toolboxmodules.ppc.slb.'
return return
# Tough luck.... # Tough luck....
@ -134,7 +135,7 @@ def mkcorealias(src, altsrc):
dst = getextensiondirfile(src+ ' ' + version) dst = getextensiondirfile(src+ ' ' + version)
if not os.path.exists(src): if not os.path.exists(src):
if not os.path.exists(altsrc): if not os.path.exists(altsrc):
print '*', src, 'not found' if verbose: print '*', src, 'not found'
return 0 return 0
src = altsrc src = altsrc
try: try:
@ -142,7 +143,7 @@ def mkcorealias(src, altsrc):
except os.error: except os.error:
pass pass
macostools.mkalias(src, dst) macostools.mkalias(src, dst)
print ' ', dst, '->', src if verbose: print ' ', dst, '->', src
return 1 return 1
@ -156,47 +157,49 @@ def main():
# Remove old .slb aliases and collect a list of .slb files # Remove old .slb aliases and collect a list of .slb files
LibFiles = [] LibFiles = []
allfiles = os.listdir(':') allfiles = os.listdir(':')
print 'Removing old aliases...' if verbose: print 'Removing old aliases...'
for f in allfiles: for f in allfiles:
if f[-4:] == '.slb': if f[-4:] == '.slb':
finfo = macfs.FSSpec(f).GetFInfo() finfo = macfs.FSSpec(f).GetFInfo()
if finfo.Flags & 0x8000: if finfo.Flags & 0x8000:
print ' Removing', f if verbose: print ' Removing', f
os.unlink(f) os.unlink(f)
else: else:
LibFiles.append(f) LibFiles.append(f)
print ' Found', f if verbose: print ' Found', f
print if verbose: print
# Create the new PPC aliases. # Create the new PPC aliases.
print 'Creating PPC aliases...' if verbose: print 'Creating PPC aliases...'
for dst, src in ppc_goals: for dst, src in ppc_goals:
if src in LibFiles: if src in LibFiles:
macostools.mkalias(src, dst) macostools.mkalias(src, dst)
print ' ', dst, '->', src if verbose: print ' ', dst, '->', src
else: else:
print '*', dst, 'not created:', src, 'not found' if verbose: print '*', dst, 'not created:', src, 'not found'
print if verbose: print
# Create the CFM68K aliases. # Create the CFM68K aliases.
print 'Creating CFM68K aliases...' if verbose: print 'Creating CFM68K aliases...'
for dst, src in cfm68k_goals: for dst, src in cfm68k_goals:
if src in LibFiles: if src in LibFiles:
macostools.mkalias(src, dst) macostools.mkalias(src, dst)
print ' ', dst, '->', src if verbose: print ' ', dst, '->', src
else: else:
print '*', dst, 'not created:', src, 'not found' if verbose: print '*', dst, 'not created:', src, 'not found'
print if verbose: print
# Create the PythonCore alias(es) # Create the PythonCore alias(es)
print 'Creating PythonCore aliases in Extensions folder...' if verbose: print 'Creating PythonCore aliases in Extensions folder...'
os.chdir('::') os.chdir('::')
n = 0 n = 0
n = n + mkcorealias('PythonCore', 'PythonCore') n = n + mkcorealias('PythonCore', 'PythonCore')
n = n + mkcorealias('PythonCorePPC', ':build.macppc.shared:PythonCorePPC') n = n + mkcorealias('PythonCorePPC', ':build.macppc.shared:PythonCorePPC')
n = n + mkcorealias('PythonCoreCFM68K', ':build.mac68k.shared:PythonCoreCFM68K') n = n + mkcorealias('PythonCoreCFM68K', ':build.mac68k.shared:PythonCoreCFM68K')
if n == 0: if verbose and n == 0:
sys.exit(1) sys.exit(1)
if __name__ == '__main__': if __name__ == '__main__':
if len(sys.argv) > 1 and sys.argv[1] == '-v':
verbose = 1
main() main()