annotate Mac/scripts/ConfigurePython.py @ 3519:05e85055582c legacy-trunk

Added missing setport call to mkdistr_ui, and added scrap to mkpluginaliases.
author Jack Jansen <jack.jansen@cwi.nl>
date Fri, 12 Apr 1996 16:34:58 +0000
parents e8d501c88a3e
children 60bb743b8a5c
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
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
5 # (since it creates aliases to stuff it needs itself),
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
6 # you should probably drag it onto your non-dynamic python.
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 # If you compare it to MkPluginAliases.as it also serves
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
9 # as a comparison between python and AppleScript:-)
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
10 #
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
11 # Jack Jansen, CWI, August 1995
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
12
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
13 import sys
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
14
3122
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
15 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
16 print"""
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
17 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
18 1. Remove any old "Python Preferences" files from the system folder.
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
19 2. Remove any old "PythonCore" files from the system folder.
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
20 3. Make sure this script, PythonPPC and PythonCore are all located in the
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
21 python home folder (where the Lib and PlugIns folders are)
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
22 4. Run this script again, by dropping it on PythonPPC.
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
23
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
24 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
25 """
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
26 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
27
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
28 try:
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
29 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
30 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
31 print """
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
32 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
33 """
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
34 help()
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
35
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
36 try:
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
37 import Res
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
38 except ImportError:
3122
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
39 #
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
40 # 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
41 #
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 os.chdir(':PlugIns')
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
44 except IOError:
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
45 print """
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
46 I cannot find the 'PlugIns' folder, so I am obviously not run from the Python
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
47 home folder.
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
48 """
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
49 help()
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
50 import imp
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
51 cwd = os.getcwd()
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
52 tblibname = os.path.join(cwd, "toolboxmodules.slb")
3183
61ca19a3000f Adapted to os and imp changes
Jack Jansen <jack.jansen@cwi.nl>
parents: 3122
diff changeset
53 if not os.path.exists(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
54 print """
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
55 I cannot find the 'toolboxmodules.slb' file in the PlugIns directory.
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
56 Start afresh from a clean distribution.
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
57 """
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
58 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
59 try:
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
60 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
61 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
62 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
63 print """
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
64 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
65 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
66 """
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
67 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
68
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
69
3122
2caa3e283568 Load toolbox modules "by hand" using imp, so this script should now
Jack Jansen <jack.jansen@cwi.nl>
parents: 2978
diff changeset
70 import macfs
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
71 import EasyDialogs
2978
7a67dbcb6d83 Added List.slb alias
Jack Jansen <jack.jansen@cwi.nl>
parents: 2939
diff changeset
72 import macostools
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
73
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
74 goals = [
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
75 ("mactcp.slb", "mactcpmodules.slb"),
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
76 ("macdnr.slb", "mactcpmodules.slb"),
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
77 ("AE.slb", "toolboxmodules.slb"),
3284
3a0f84c69050 Added Cm.slb, the component mgr interface
Jack Jansen <jack.jansen@cwi.nl>
parents: 3217
diff changeset
78 ("Cm.slb", "toolboxmodules.slb"),
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
79 ("Ctl.slb", "toolboxmodules.slb"),
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
80 ("Dlg.slb", "toolboxmodules.slb"),
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
81 ("Evt.slb", "toolboxmodules.slb"),
3313
68fdc40add2c Added font manager toolbox module
Jack Jansen <jack.jansen@cwi.nl>
parents: 3289
diff changeset
82 ("Fm.slb", "toolboxmodules.slb"),
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
83 ("Menu.slb", "toolboxmodules.slb"),
2978
7a67dbcb6d83 Added List.slb alias
Jack Jansen <jack.jansen@cwi.nl>
parents: 2939
diff changeset
84 ("List.slb", "toolboxmodules.slb"),
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
85 ("Qd.slb", "toolboxmodules.slb"),
3289
66f4bf94627f Added QuickTime module
Jack Jansen <jack.jansen@cwi.nl>
parents: 3284
diff changeset
86 ("Qt.slb", "toolboxmodules.slb"),
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
87 ("Res.slb", "toolboxmodules.slb"),
3519
05e85055582c Added missing setport call to mkdistr_ui, and added scrap to
Jack Jansen <jack.jansen@cwi.nl>
parents: 3504
diff changeset
88 ("Scrap.slb", "toolboxmodules.slb"),
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
89 ("Snd.slb", "toolboxmodules.slb"),
3504
e8d501c88a3e Added region arg to update calls. And binhex files rebinhexed.
Jack Jansen <jack.jansen@cwi.nl>
parents: 3313
diff changeset
90 ("TE.slb", "toolboxmodules.slb"),
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
91 ("Win.slb", "toolboxmodules.slb"),
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
92 ("imgcolormap.slb", "imgmodules.slb"),
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
93 ("imgformat.slb", "imgmodules.slb"),
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
94 ("imggif.slb", "imgmodules.slb"),
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
95 ("imgjpeg.slb", "imgmodules.slb"),
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
96 ("imgop.slb", "imgmodules.slb"),
3217
801265b86164 Added imgpbm and imgsgi
Jack Jansen <jack.jansen@cwi.nl>
parents: 3183
diff changeset
97 ("imgpbm.slb", "imgmodules.slb"),
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
98 ("imgpgm.slb", "imgmodules.slb"),
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
99 ("imgppm.slb", "imgmodules.slb"),
3217
801265b86164 Added imgpbm and imgsgi
Jack Jansen <jack.jansen@cwi.nl>
parents: 3183
diff changeset
100 ("imgtiff.slb", "imgmodules.slb"),
801265b86164 Added imgpbm and imgsgi
Jack Jansen <jack.jansen@cwi.nl>
parents: 3183
diff changeset
101 ("imgsgi.slb", "imgmodules.slb")
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
102 ]
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
103
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 def main():
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
106 # Ask the user for the plugins directory
2978
7a67dbcb6d83 Added List.slb alias
Jack Jansen <jack.jansen@cwi.nl>
parents: 2939
diff changeset
107 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
108 if not ok: sys.exit(0)
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
109 os.chdir(dir.as_pathname())
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
110
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
111 # 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
112 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
113 sys.exit(0)
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
114 LibFiles = []
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
115 allfiles = os.listdir(':')
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
116 for f in allfiles:
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
117 if f[-4:] == '.slb':
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
118 finfo = macfs.FSSpec(f).GetFInfo()
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
119 if finfo.Flags & 0x8000:
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
120 os.unlink(f)
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
121 else:
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
122 LibFiles.append(f)
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
123
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
124 print LibFiles
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
125 # Create the new aliases.
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
126 if EasyDialogs.AskYesNoCancel('Proceed with creating new ones?') <= 0:
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
127 sys.exit(0)
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
128 for dst, src in goals:
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
129 if src in LibFiles:
2978
7a67dbcb6d83 Added List.slb alias
Jack Jansen <jack.jansen@cwi.nl>
parents: 2939
diff changeset
130 macostools.mkalias(src, dst)
2939
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
131 else:
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
132 EasyDialogs.Message(dst+' not created: '+src+' not found')
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
133
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
134 EasyDialogs.Message('All done!')
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
135
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
136 if __name__ == '__main__':
4dfdf234cda8 MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
137 main()