annotate Mac/scripts/ConfigurePython.py @ 4058:21b28dcfa865 legacy-trunk

Adapted for cfm68k, new names and split off of qt.
author Jack Jansen <jack.jansen@cwi.nl>
date Tue, 20 Aug 1996 16:35:30 +0000
parents 60bb743b8a5c
children 687899c563e3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1 # This python script creates Finder aliases for all the
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2 # dynamically-loaded modules that "live in" in a single
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3 # shared library.
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4 # It needs a fully functional non-dynamic python to work
4058
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
5 # but you can run it in a shared python as long as you can point
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
6 # it to toolboxmodules.slb
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
7 #
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
8 # Jack Jansen, CWI, August 1995
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
9
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
10 import sys
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
11
3122
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
12 def help():
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
13 print"""
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
14 Try the following:
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
15 1. Remove any old "Python Preferences" files from the system folder.
4058
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
16 2. Remove any old "PythonCore" or "PythonCoreCFM68K" files from the system folder.
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
17 3. Make sure this script, your interpreter and your PythonCore are all located in the
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
18 same folder.
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
19 4. Run this script again, by dropping it on your interpreter.
3122
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
20
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
21 If this fails try removing starting afresh from the distribution archive.
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
22 """
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
23 sys.exit(1)
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
24
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
25 try:
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
26 import os
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
27 except ImportError:
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
28 print """
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
29 I cannot import the 'os' module, so something is wrong with sys.path
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
30 """
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
31 help()
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
32
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
33 try:
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
34 import Res
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
35 except ImportError:
4058
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
36 import macfs
3122
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
37 #
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
38 # Check that we are actually in the main python directory
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
39 #
4058
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
40 fss, ok = macfs.StandardGetFile('Where are the toolbox modules?', 'shlb')
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
41 tblibname = fss.as_pathname()
3122
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
42 try:
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
43 for wtd in ["Ctl", "Dlg", "Evt", "Qd", "Res", "Win"]:
3183
61ca19a3000f Adapted to os and imp changes
Jack Jansen <jack.jansen@cwi.nl>
parents: 3122
diff changeset
44 imp.load_dynamic(wtd, tblibname)
3122
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
45 except ImportError:
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
46 print """
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
47 I cannot load the toolbox modules by hand. Are you sure you are
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
48 using a PowerPC mac?
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
49 """
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
50 sys.exit(1)
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
51
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
52
3122
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
53 import macfs
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
54 import EasyDialogs
2978
7a67dbcb6d83 Added List.slb alias
Jack Jansen <jack.jansen@cwi.nl>
parents: 2939
diff changeset
55 import macostools
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
56
4058
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
57 ppc_goals = [
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
58 ("AE.ppc.slb", "toolboxmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
59 ("Ctl.ppc.slb", "toolboxmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
60 ("Dlg.ppc.slb", "toolboxmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
61 ("Evt.ppc.slb", "toolboxmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
62 ("Fm.ppc.slb", "toolboxmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
63 ("Menu.ppc.slb", "toolboxmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
64 ("List.ppc.slb", "toolboxmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
65 ("Qd.ppc.slb", "toolboxmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
66 ("Res.ppc.slb", "toolboxmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
67 ("Scrap.ppc.slb", "toolboxmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
68 ("Snd.ppc.slb", "toolboxmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
69 ("TE.ppc.slb", "toolboxmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
70 ("Win.ppc.slb", "toolboxmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
71
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
72 ("Cm.ppc.slb", "qtmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
73 ("Qt.ppc.slb", "qtmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
74
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
75 ("imgcolormap.ppc.slb", "imgmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
76 ("imgformat.ppc.slb", "imgmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
77 ("imggif.ppc.slb", "imgmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
78 ("imgjpeg.ppc.slb", "imgmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
79 ("imgop.ppc.slb", "imgmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
80 ("imgpbm.ppc.slb", "imgmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
81 ("imgpgm.ppc.slb", "imgmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
82 ("imgppm.ppc.slb", "imgmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
83 ("imgtiff.ppc.slb", "imgmodules.ppc.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
84 ("imgsgi.ppc.slb", "imgmodules.ppc.slb")
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
85 ]
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
86
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
87 cfm68k_goals = [
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
88 ("AE.CFM68K.slb", "toolboxmodules.CFM68K.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
89 ("Ctl.CFM68K.slb", "toolboxmodules.CFM68K.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
90 ("Dlg.CFM68K.slb", "toolboxmodules.CFM68K.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
91 ("Evt.CFM68K.slb", "toolboxmodules.CFM68K.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
92 ("Fm.CFM68K.slb", "toolboxmodules.CFM68K.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
93 ("Menu.CFM68K.slb", "toolboxmodules.CFM68K.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
94 ("List.CFM68K.slb", "toolboxmodules.CFM68K.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
95 ("Qd.CFM68K.slb", "toolboxmodules.CFM68K.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
96 ("Res.CFM68K.slb", "toolboxmodules.CFM68K.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
97 ("Scrap.CFM68K.slb", "toolboxmodules.CFM68K.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
98 ("Snd.CFM68K.slb", "toolboxmodules.CFM68K.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
99 ("TE.CFM68K.slb", "toolboxmodules.CFM68K.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
100 ("Win.CFM68K.slb", "toolboxmodules.CFM68K.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
101
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
102 ("Cm.CFM68K.slb", "qtmodules.CFM68K.slb"),
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
103 ("Qt.CFM68K.slb", "qtmodules.CFM68K.slb"),
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
104 ]
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
105
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
106
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
107 def main():
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
108 # Ask the user for the plugins directory
2978
7a67dbcb6d83 Added List.slb alias
Jack Jansen <jack.jansen@cwi.nl>
parents: 2939
diff changeset
109 dir, ok = macfs.GetDirectory('Where is the PlugIns folder?')
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
110 if not ok: sys.exit(0)
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
111 os.chdir(dir.as_pathname())
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
112
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
113 # Remove old .slb aliases and collect a list of .slb files
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
114 if EasyDialogs.AskYesNoCancel('Proceed with removing old aliases?') <= 0:
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
115 sys.exit(0)
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
116 LibFiles = []
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
117 allfiles = os.listdir(':')
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
118 for f in allfiles:
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
119 if f[-4:] == '.slb':
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
120 finfo = macfs.FSSpec(f).GetFInfo()
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
121 if finfo.Flags & 0x8000:
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
122 os.unlink(f)
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
123 else:
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
124 LibFiles.append(f)
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
125
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
126 print LibFiles
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
127 # Create the new aliases.
4058
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
128 if EasyDialogs.AskYesNoCancel('Proceed with creating PPC aliases?') > 0:
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
129 for dst, src in ppc_goals:
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
130 if src in LibFiles:
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
131 macostools.mkalias(src, dst)
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
132 else:
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
133 EasyDialogs.Message(dst+' not created: '+src+' not found')
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
134 if EasyDialogs.AskYesNoCancel('Proceed with creating CFM68K aliases?') > 0:
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
135 for dst, src in cfm68k_goals:
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
136 if src in LibFiles:
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
137 macostools.mkalias(src, dst)
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
138 else:
21b28dcfa865 Adapted for cfm68k, new names and split off of qt.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3933
diff changeset
139 EasyDialogs.Message(dst+' not created: '+src+' not found')
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
140
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
141 EasyDialogs.Message('All done!')
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
142
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
143 if __name__ == '__main__':
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
144 main()