]> granicus.if.org Git - python/commitdiff
Use new file dialogs in GetArgv()
authorJack Jansen <jack.jansen@cwi.nl>
Tue, 21 Jan 2003 13:56:34 +0000 (13:56 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Tue, 21 Jan 2003 13:56:34 +0000 (13:56 +0000)
Lib/plat-mac/EasyDialogs.py

index 25a791a395b738e02e4499fd00e857dcb18917ae..8d33a097bd5f6885e44734fe398b5b14c45362e8 100644 (file)
@@ -28,7 +28,6 @@ import MacOS
 import string
 from Carbon.ControlAccessor import *   # Also import Controls constants
 import Carbon.File
-import macfs
 import macresource
 import os
 
@@ -494,17 +493,17 @@ def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfo
                                else:
                                        MacOS.SysBeep()
                        elif n == ARGV_ADD_OLDFILE:
-                               fss, ok = macfs.StandardGetFile()
-                               if ok:
-                                       stringstoadd = [fss.as_pathname()]
+                               pathname = AskFileForOpen()
+                               if pathname:
+                                       stringstoadd = [pathname]
                        elif n == ARGV_ADD_NEWFILE:
-                               fss, ok = macfs.StandardPutFile('')
-                               if ok:
-                                       stringstoadd = [fss.as_pathname()]
+                               pathname = AskFileForSave()
+                               if pathname:
+                                       stringstoadd = [pathname]
                        elif n == ARGV_ADD_FOLDER:
-                               fss, ok = macfs.GetDirectory()
-                               if ok:
-                                       stringstoadd = [fss.as_pathname()]
+                               pathname = AskFolder()
+                               if pathname:
+                                       stringstoadd = [pathname]
                        elif n == ARGV_CMDLINE_DATA:
                                pass # Nothing to do
                        else:
@@ -694,7 +693,7 @@ def AskFolder(**args):
        
 
 def test():
-       import time, sys
+       import time, sys, macfs
 
        Message("Testing EasyDialogs.")
        optionlist = (('v', 'Verbose'), ('verbose', 'Verbose as long option'),