[Python-checkins] python/nondist/sandbox/csv _csv.c,1.13,1.14

montanaro@users.sourceforge.net montanaro@users.sourceforge.net
Tue, 04 Feb 2003 17:49:58 -0800


Update of /cvsroot/python/python/nondist/sandbox/csv
In directory sc8-pr-cvs1:/tmp/cvs-serv28414

Modified Files:
	_csv.c 
Log Message:
export QUOTE_* constants for use by csv.py


Index: _csv.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/csv/_csv.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** _csv.c	4 Feb 2003 14:54:54 -0000	1.13
--- _csv.c	5 Feb 2003 01:49:54 -0000	1.14
***************
*** 143,146 ****
--- 143,147 ----
  }
  
+ #if 0
  static void
  parse_prepend_char(ParserObj *self, char c)
***************
*** 152,155 ****
--- 153,157 ----
  	self->field_len++;
  }
+ #endif
  
  static void
***************
*** 940,943 ****
--- 942,947 ----
  	PyObject *dict;
  	PyObject *rev;
+ 	PyObject *v;
+ 	int res;
  
  	if (PyType_Ready(&Parser_Type) < 0)
***************
*** 957,960 ****
--- 961,996 ----
  		return;
  	if (PyDict_SetItemString(dict, "__version__", rev) < 0)
+ 		return;
+ 
+ 	v = PyInt_FromLong(QUOTE_MINIMAL);
+ 	if (v == NULL)
+ 		return;
+ 	res = PyDict_SetItemString(dict, "QUOTE_MINIMAL", v);
+ 	Py_DECREF(v);
+ 	if (res < 0)
+ 		return;
+ 
+ 	v = PyInt_FromLong(QUOTE_ALL);
+ 	if (v == NULL)
+ 		return;
+ 	res = PyDict_SetItemString(dict, "QUOTE_ALL", v);
+ 	Py_DECREF(v);
+ 	if (res < 0)
+ 		return;
+ 
+ 	v = PyInt_FromLong(QUOTE_NONNUMERIC);
+ 	if (v == NULL)
+ 		return;
+ 	res = PyDict_SetItemString(dict, "QUOTE_NONNUMERIC", v);
+ 	Py_DECREF(v);
+ 	if (res < 0)
+ 		return;
+ 
+ 	v = PyInt_FromLong(QUOTE_NONE);
+ 	if (v == NULL)
+ 		return;
+ 	res = PyDict_SetItemString(dict, "QUOTE_NONE", v);
+ 	Py_DECREF(v);
+ 	if (res < 0)
  		return;