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