[Python-checkins] python/dist/src/Mac/Modules Nav.c,1.22,1.23

jackjansen@users.sourceforge.net jackjansen@users.sourceforge.net
Fri, 17 Jan 2003 15:13:06 -0800


Update of /cvsroot/python/python/dist/src/Mac/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv4402/Mac/Modules

Modified Files:
	Nav.c 
Log Message:
Fixed the first two bugs in the new file dialogs (found by Just):
- AskFileForSave didn't work for string return values
- filterProc didn't work.


Index: Nav.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/Nav.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** Nav.c	17 Jan 2003 16:14:31 -0000	1.22
--- Nav.c	17 Jan 2003 23:13:03 -0000	1.23
***************
*** 57,61 ****
  	if (!dict) return;
  	if ( (pyfunc = PyDict_GetItemString(dict, "eventProc")) == NULL ) {
! 		PyErr_Clear();
  		return;
  	}
--- 57,61 ----
  	if (!dict) return;
  	if ( (pyfunc = PyDict_GetItemString(dict, "eventProc")) == NULL ) {
! 		PyErr_Print();
  		return;
  	}
***************
*** 75,80 ****
  		Py_DECREF(rv);
  	else {
! 		fprintf(stderr, "Nav: exception in eventProc callback\n");
! 		PyErr_Clear();
  	}
  }
--- 75,80 ----
  		Py_DECREF(rv);
  	else {
! 		PySys_WriteStderr("Nav: exception in eventProc callback\n");
! 		PyErr_Print();
  	}
  }
***************
*** 91,95 ****
  	if (!dict) return false;
  	if ( (pyfunc = PyDict_GetItemString(dict, "previewProc")) == NULL ) {
! 		PyErr_Clear();
  		return false;
  	}
--- 91,95 ----
  	if (!dict) return false;
  	if ( (pyfunc = PyDict_GetItemString(dict, "previewProc")) == NULL ) {
! 		PyErr_Print();
  		return false;
  	}
***************
*** 99,104 ****
  		Py_DECREF(rv);
  	} else {
! 		fprintf(stderr, "Nav: exception in previewProc callback\n");
! 		PyErr_Clear();
  	}
  	return c_rv;
--- 99,104 ----
  		Py_DECREF(rv);
  	} else {
! 		PySys_WriteStderr("Nav: exception in previewProc callback\n");
! 		PyErr_Print();
  	}
  	return c_rv;
***************
*** 114,131 ****
  	PyObject *rv;
  	Boolean c_rv = false;
  	
  	if (!dict) return false;
  	if ( (pyfunc = PyDict_GetItemString(dict, "filterProc")) == NULL ) {
! 		PyErr_Clear();
  		return false;
  	}
  	rv = PyObject_CallFunction(pyfunc, "O&s#h",
! 		AEDesc_New, theItem, info, sizeof(NavFileOrFolderInfo), (short)filterMode);
  	if ( rv ) {
  		c_rv = PyObject_IsTrue(rv);
  		Py_DECREF(rv);
  	} else {
! 		fprintf(stderr, "Nav: exception in filterProc callback\n");
! 		PyErr_Clear();
  	}
  	return c_rv;
--- 114,132 ----
  	PyObject *rv;
  	Boolean c_rv = false;
+ 	PyObject theItemCopy;
  	
  	if (!dict) return false;
  	if ( (pyfunc = PyDict_GetItemString(dict, "filterProc")) == NULL ) {
! 		PyErr_Print();
  		return false;
  	}
  	rv = PyObject_CallFunction(pyfunc, "O&s#h",
! 		AEDesc_NewBorrowed, theItem, info, sizeof(NavFileOrFolderInfo), (short)filterMode);
  	if ( rv ) {
  		c_rv = PyObject_IsTrue(rv);
  		Py_DECREF(rv);
  	} else {
! 		PySys_WriteStderr("Nav: exception in filterProc callback\n");
! 		PyErr_Print();
  	}
  	return c_rv;