summaryrefslogtreecommitdiffstats
path: root/Mac/scripts
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-01-26 21:40:00 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2003-01-26 21:40:00 (GMT)
commitb340acf9fd893140efd65a56134a814a8d9bac73 (patch)
treec991a32a9d7b34262675c1cd97969c352c43f74e /Mac/scripts
parentd9db3a67138deec981184c173c290025e9760f1d (diff)
downloadcpython-b340acf9fd893140efd65a56134a814a8d9bac73.zip
cpython-b340acf9fd893140efd65a56134a814a8d9bac73.tar.gz
cpython-b340acf9fd893140efd65a56134a814a8d9bac73.tar.bz2
Use new file dialogs.
Diffstat (limited to 'Mac/scripts')
-rw-r--r--Mac/scripts/EditPythonPrefs.py3
-rw-r--r--Mac/scripts/findgremlins.py7
-rw-r--r--Mac/scripts/fixfiletypes.py7
-rw-r--r--Mac/scripts/fullbuild.py5
-rw-r--r--Mac/scripts/makeclean.py7
-rw-r--r--Mac/scripts/unshar.py12
-rw-r--r--Mac/scripts/zappycfiles.py6
7 files changed, 25 insertions, 22 deletions
diff --git a/Mac/scripts/EditPythonPrefs.py b/Mac/scripts/EditPythonPrefs.py
index d9a0c5d..9e9c370 100644
--- a/Mac/scripts/EditPythonPrefs.py
+++ b/Mac/scripts/EditPythonPrefs.py
@@ -159,7 +159,8 @@ def interact(options, title):
## if n == REVERT_ITEM:
## return [], pythondir
if n == DIR_ITEM:
- fss, ok = macfs.GetDirectory('Select python home folder:')
+ fss = EasyDialogs.AskFolder(message='Select python home folder:',
+ wanted=macfs.FSSpec)
if ok:
options['dir'] = fss
elif n == HELP_ITEM and Help:
diff --git a/Mac/scripts/findgremlins.py b/Mac/scripts/findgremlins.py
index fe40e64..595551e 100644
--- a/Mac/scripts/findgremlins.py
+++ b/Mac/scripts/findgremlins.py
@@ -4,6 +4,7 @@ the filename and a bit of context.
By Just, with a little glue by Jack"""
+import EasyDialogs
import macfs
import re
import os
@@ -43,9 +44,9 @@ def walk(top, recurse=1):
pos = j
def main():
- fss, ok = macfs.GetDirectory()
- if ok:
- walk(fss.as_pathname())
+ pathname = EasyDialogs.AskFolder()
+ if pathname:
+ walk(pathname)
if __name__ == '__main__':
main()
diff --git a/Mac/scripts/fixfiletypes.py b/Mac/scripts/fixfiletypes.py
index 284b5e1..872c891 100644
--- a/Mac/scripts/fixfiletypes.py
+++ b/Mac/scripts/fixfiletypes.py
@@ -9,6 +9,7 @@
#
import os
import macfs
+import EasyDialogs
import sys
import macostools
@@ -45,10 +46,10 @@ def walktree(name, change):
walktree(os.path.join(name, f), change)
def run(change):
- fss, ok = macfs.GetDirectory('Folder to search:')
- if not ok:
+ pathname = EasyDialogs.AskFolder(message='Folder to search:')
+ if not pathname:
sys.exit(0)
- walktree(fss.as_pathname(), change)
+ walktree(pathname, change)
if __name__ == '__main__':
run(1)
diff --git a/Mac/scripts/fullbuild.py b/Mac/scripts/fullbuild.py
index 1a8fc6d..b1cd2d8 100644
--- a/Mac/scripts/fullbuild.py
+++ b/Mac/scripts/fullbuild.py
@@ -410,10 +410,9 @@ def incbuildno(filename):
def main():
macresource.need('DLOG', DIALOG_ID, 'fullbuild.rsrc')
- dir, ok = macfs.GetDirectory('Python source folder:')
- if not ok:
+ dir = EasyDialogs.AskFolder(message='Python source folder:')
+ if not dir:
sys.exit(0)
- dir = dir.as_pathname()
# Set genpluginprojects to use this folder (slight hack)
genpluginprojects.PYTHONDIR = dir
diff --git a/Mac/scripts/makeclean.py b/Mac/scripts/makeclean.py
index 005ea02..14416ab 100644
--- a/Mac/scripts/makeclean.py
+++ b/Mac/scripts/makeclean.py
@@ -12,6 +12,7 @@
"""
import macfs
+import EasyDialogs
import os
import sys
import re
@@ -53,7 +54,7 @@ def walk(top):
remove(top)
-fss, ok = macfs.GetDirectory("Please locate the Python home directory")
-if ok:
- walk(fss.as_pathname())
+pathname = EasyDialogs.AskFolder(message="Please locate the Python home directory")
+if pathname:
+ walk(pathname)
sys.exit(1) # so we see the results
diff --git a/Mac/scripts/unshar.py b/Mac/scripts/unshar.py
index a90ee34..ec14f2e 100644
--- a/Mac/scripts/unshar.py
+++ b/Mac/scripts/unshar.py
@@ -6,6 +6,7 @@
# >>> unshar.unshar(f)
import string
+import EasyDialogs
def unshar(fp, verbose=0, overwrite=0):
ofp = None
@@ -82,15 +83,14 @@ def main():
unshar(fp)
else:
import macfs
- fss, ok = macfs.StandardGetFile('TEXT')
- if not ok:
+ fname = EasyDialogs.AskFileForOpen()
+ if not fname:
sys.exit(0)
- fname = fss.as_pathname()
fp = open(fname, 'r')
- fss, ok = macfs.GetDirectory('Folder to save files in:')
- if not ok:
+ dirname = EasyDialogs.AskFolder(message='Folder to save files in:')
+ if not dirname:
sys.exit(0)
- os.chdir(fss.as_pathname())
+ os.chdir(dirname)
unshar(fp)
if __name__ == '__main__':
diff --git a/Mac/scripts/zappycfiles.py b/Mac/scripts/zappycfiles.py
index dcd4133..4637159 100644
--- a/Mac/scripts/zappycfiles.py
+++ b/Mac/scripts/zappycfiles.py
@@ -2,6 +2,7 @@
"""Recursively zap all .pyc and .pyo files"""
import os
import sys
+import EasyDialogs
# set doit true to actually delete files
# set doit false to just print what would be deleted
@@ -11,10 +12,9 @@ def main():
if not sys.argv[1:]:
if os.name == 'mac':
import macfs
- fss, ok = macfs.GetDirectory('Directory to zap pyc files in')
- if not ok:
+ dir = EasyDialogs.AskFolder(message='Directory to zap pyc files in')
+ if not dir:
sys.exit(0)
- dir = fss.as_pathname()
zappyc(dir)
else:
print 'Usage: zappyc dir ...'