]> granicus.if.org Git - python/commitdiff
Added code to make fsspecs work for gusi-python
authorJack Jansen <jack.jansen@cwi.nl>
Tue, 5 Mar 1996 16:56:24 +0000 (16:56 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Tue, 5 Mar 1996 16:56:24 +0000 (16:56 +0000)
Mac/Python/macglue.c

index 23415eb8b5cb2802c3e8b51d2fe93ef26b7fdd09..dd4499e32f0639eadbaf3439ff91cc0964fb29e0 100644 (file)
@@ -49,6 +49,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #ifdef __MWERKS__
 #include <SIOUX.h>
 #endif
+#ifdef USE_GUSI
+#include <TFileSpec.h> /* For Path2FSSpec */
+#endif
 
 #ifndef HAVE_UNIVERSAL_HEADERS
 #define GetResourceSizeOnDisk(x) SizeResource(x)
@@ -654,8 +657,21 @@ PyMac_GetFSSpec(PyObject *v, FSSpec *fs)
                /* It's a pathname */
                if( !PyArg_Parse(v, "O&", PyMac_GetStr255, &path) )
                        return 0;
+#ifdef USE_GUSI
+               {
+                       FSSpec curdirfss;
+                       
+                       if ( Path2FSSpec(":x", &curdirfss) == 0 ) {
+                               refnum = curdirfss.vRefNum;
+                               parid = curdirfss.parID;
+                       } else {
+                               return 0;
+                       }
+               }
+#else
                refnum = 0; /* XXXX Should get CurWD here... */
                parid = 0;
+#endif
        } else {
                if( !PyArg_Parse(v, "(hlO&); FSSpec should be fullpath or (vrefnum,dirid,path)",
                                                        &refnum, &parid, PyMac_GetStr255, &path)) {