Mercurial > cpython-lru_cache-weakref
annotate Mac/scripts/ConfigurePython.py @ 3289:66f4bf94627f legacy-trunk
Added QuickTime module
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Sat, 09 Dec 1995 14:01:28 +0000 |
| parents | 3a0f84c69050 |
| children | 68fdc40add2c |
| 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 | 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"), |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
82 ("Menu.slb", "toolboxmodules.slb"), |
| 2978 | 83 ("List.slb", "toolboxmodules.slb"), |
|
2939
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
84 ("Qd.slb", "toolboxmodules.slb"), |
| 3289 | 85 ("Qt.slb", "toolboxmodules.slb"), |
|
2939
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
86 ("Res.slb", "toolboxmodules.slb"), |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
87 ("Snd.slb", "toolboxmodules.slb"), |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
88 ("Win.slb", "toolboxmodules.slb"), |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
89 ("imgcolormap.slb", "imgmodules.slb"), |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
90 ("imgformat.slb", "imgmodules.slb"), |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
91 ("imggif.slb", "imgmodules.slb"), |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
92 ("imgjpeg.slb", "imgmodules.slb"), |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
93 ("imgop.slb", "imgmodules.slb"), |
| 3217 | 94 ("imgpbm.slb", "imgmodules.slb"), |
|
2939
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
95 ("imgpgm.slb", "imgmodules.slb"), |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
96 ("imgppm.slb", "imgmodules.slb"), |
| 3217 | 97 ("imgtiff.slb", "imgmodules.slb"), |
| 98 ("imgsgi.slb", "imgmodules.slb") | |
|
2939
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
99 ] |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
100 |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
101 |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
102 def main(): |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
103 # Ask the user for the plugins directory |
| 2978 | 104 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
|
105 if not ok: sys.exit(0) |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
106 os.chdir(dir.as_pathname()) |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
107 |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
108 # 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
|
109 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
|
110 sys.exit(0) |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
111 LibFiles = [] |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
112 allfiles = os.listdir(':') |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
113 for f in allfiles: |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
114 if f[-4:] == '.slb': |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
115 finfo = macfs.FSSpec(f).GetFInfo() |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
116 if finfo.Flags & 0x8000: |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
117 os.unlink(f) |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
118 else: |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
119 LibFiles.append(f) |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
120 |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
121 print LibFiles |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
122 # Create the new aliases. |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
123 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
|
124 sys.exit(0) |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
125 for dst, src in goals: |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
126 if src in LibFiles: |
| 2978 | 127 macostools.mkalias(src, dst) |
|
2939
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
128 else: |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
129 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
|
130 |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
131 EasyDialogs.Message('All done!') |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
132 |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
133 if __name__ == '__main__': |
|
4dfdf234cda8
MkPluginAliases - Scripts (AppleScript and Python) to create aliases
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
134 main() |
