[Python-checkins] python/dist/src/Objects fileobject.c,2.167,2.168

jhylton@users.sourceforge.net jhylton@users.sourceforge.net
2002年8月14日 14:01:44 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv23684
Modified Files:
	fileobject.c 
Log Message:
Reflow long lines.
Index: fileobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v
retrieving revision 2.167
retrieving revision 2.168
diff -C2 -d -r2.167 -r2.168
*** fileobject.c	6 Aug 2002 21:50:54 -0000	2.167
--- fileobject.c	14 Aug 2002 21:01:41 -0000	2.168
***************
*** 91,95 ****
 		char *msg = "Is a directory";
 #endif
! 		PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(is)", EISDIR, msg);
 		PyErr_SetObject(PyExc_IOError, exc);
 		return NULL;
--- 91,96 ----
 		char *msg = "Is a directory";
 #endif
! 		PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(is)", 
! 						 EISDIR, msg);
 		PyErr_SetObject(PyExc_IOError, exc);
 		return NULL;
***************
*** 144,148 ****
 	if (PyEval_GetRestricted()) {
 		PyErr_SetString(PyExc_IOError,
! 			"file() constructor not accessible in restricted mode");
 		return NULL;
 	}
--- 145,149 ----
 	if (PyEval_GetRestricted()) {
 		PyErr_SetString(PyExc_IOError,
! 		"file() constructor not accessible in restricted mode");
 		return NULL;
 	}
***************
*** 706,710 ****
 	if (buffersize > INT_MAX) {
 		PyErr_SetString(PyExc_OverflowError,
! 			"requested number of bytes is more than a Python string can hold");
 		return NULL;
 	}
--- 707,711 ----
 	if (buffersize > INT_MAX) {
 		PyErr_SetString(PyExc_OverflowError,
! 	"requested number of bytes is more than a Python string can hold");
 		return NULL;
 	}
***************
*** 717,721 ****
 		errno = 0;
 		chunksize = Py_UniversalNewlineFread(BUF(v) + bytesread,
! 				 buffersize - bytesread, f->f_fp, (PyObject *)f);
 		Py_END_ALLOW_THREADS
 		if (chunksize == 0) {
--- 718,722 ----
 		errno = 0;
 		chunksize = Py_UniversalNewlineFread(BUF(v) + bytesread,
! 			 buffersize - bytesread, f->f_fp, (PyObject *)f);
 		Py_END_ALLOW_THREADS
 		if (chunksize == 0) {
***************
*** 756,760 ****
 		Py_BEGIN_ALLOW_THREADS
 		errno = 0;
! 		nnow = Py_UniversalNewlineFread(ptr+ndone, ntodo, f->f_fp, (PyObject *)f);
 		Py_END_ALLOW_THREADS
 		if (nnow == 0) {
--- 757,762 ----
 		Py_BEGIN_ALLOW_THREADS
 		errno = 0;
! 		nnow = Py_UniversalNewlineFread(ptr+ndone, ntodo, f->f_fp, 
! 						(PyObject *)f);
 		Py_END_ALLOW_THREADS
 		if (nnow == 0) {
***************
*** 1026,1032 ****
 					skipnextlf = 0;
 					if (c == '\n') {
! 						/* Seeing a \n here with skipnextlf true
! 						** means we saw a \r before.
! 						*/
 						newlinetypes |= NEWLINE_CRLF;
 						c = GETC(fp);
--- 1028,1035 ----
 					skipnextlf = 0;
 					if (c == '\n') {
! 						/* Seeing a \n here with 
! 						 * skipnextlf true means we 
! 						 * saw a \r before.
! 						 */
 						newlinetypes |= NEWLINE_CRLF;
 						c = GETC(fp);
***************
*** 1401,1405 ****
 							 &len))) {
 					PyErr_SetString(PyExc_TypeError,
! 				"writelines() argument must be a sequence of strings");
 					goto error;
 				}
--- 1404,1408 ----
 							 &len))) {
 					PyErr_SetString(PyExc_TypeError,
! 			"writelines() argument must be a sequence of strings");
 					goto error;
 				}
***************
*** 1535,1555 ****
 
 static PyMethodDef file_methods[] = {
! 	{"readline",	(PyCFunction)file_readline, METH_VARARGS, readline_doc},
! 	{"read",	(PyCFunction)file_read, METH_VARARGS, read_doc},
! 	{"write",	(PyCFunction)file_write, METH_VARARGS, write_doc},
! 	{"fileno",	(PyCFunction)file_fileno, METH_NOARGS, fileno_doc},
! 	{"seek",	(PyCFunction)file_seek, METH_VARARGS, seek_doc},
 #ifdef HAVE_FTRUNCATE
! 	{"truncate",	(PyCFunction)file_truncate, METH_VARARGS, truncate_doc},
 #endif
! 	{"tell",	(PyCFunction)file_tell, METH_NOARGS, tell_doc},
! 	{"readinto",	(PyCFunction)file_readinto, METH_VARARGS, readinto_doc},
! 	{"readlines",	(PyCFunction)file_readlines, METH_VARARGS, readlines_doc},
! 	{"xreadlines",	(PyCFunction)file_getiter, METH_NOARGS, xreadlines_doc},
! 	{"writelines",	(PyCFunction)file_writelines, METH_O,	 writelines_doc},
! 	{"flush",	(PyCFunction)file_flush, METH_NOARGS, flush_doc},
! 	{"close",	(PyCFunction)file_close, METH_NOARGS, close_doc},
! 	{"isatty",	(PyCFunction)file_isatty, METH_NOARGS, isatty_doc},
! 	{NULL,		NULL}		/* sentinel */
 };
 
--- 1538,1558 ----
 
 static PyMethodDef file_methods[] = {
! 	{"readline", (PyCFunction)file_readline, METH_VARARGS, readline_doc},
! 	{"read", (PyCFunction)file_read, METH_VARARGS, read_doc},
! 	{"write", (PyCFunction)file_write, METH_VARARGS, write_doc},
! 	{"fileno", (PyCFunction)file_fileno, METH_NOARGS, fileno_doc},
! 	{"seek", (PyCFunction)file_seek, METH_VARARGS, seek_doc},
 #ifdef HAVE_FTRUNCATE
! 	{"truncate", (PyCFunction)file_truncate, METH_VARARGS, truncate_doc},
 #endif
! 	{"tell", (PyCFunction)file_tell, METH_NOARGS, tell_doc},
! 	{"readinto", (PyCFunction)file_readinto, METH_VARARGS, readinto_doc},
! 	{"readlines", (PyCFunction)file_readlines,METH_VARARGS, readlines_doc},
! 	{"xreadlines",(PyCFunction)file_getiter, METH_NOARGS, xreadlines_doc},
! 	{"writelines",(PyCFunction)file_writelines, METH_O, writelines_doc},
! 	{"flush", (PyCFunction)file_flush, METH_NOARGS, flush_doc},
! 	{"close", (PyCFunction)file_close, METH_NOARGS, close_doc},
! 	{"isatty", (PyCFunction)file_isatty, METH_NOARGS, isatty_doc},
! 	{NULL,	 NULL}		/* sentinel */
 };
 
***************
*** 1595,1599 ****
 		return Py_BuildValue("(sss)", "\r", "\n", "\r\n");
 	default:
! 		PyErr_Format(PyExc_SystemError, "Unknown newlines value 0x%x\n", f->f_newlinetypes);
 		return NULL;
 	}
--- 1598,1604 ----
 		return Py_BuildValue("(sss)", "\r", "\n", "\r\n");
 	default:
! 		PyErr_Format(PyExc_SystemError, 
! 			 "Unknown newlines value 0x%x\n", 
! 			 f->f_newlinetypes);
 		return NULL;
 	}
***************
*** 1604,1608 ****
 	{"closed", (getter)get_closed, NULL, "True if the file is closed"},
 #ifdef WITH_UNIVERSAL_NEWLINES
! 	{"newlines", (getter)get_newlines, NULL, "end-of-line convention used in this file"},
 #endif
 	{0},
--- 1609,1614 ----
 	{"closed", (getter)get_closed, NULL, "True if the file is closed"},
 #ifdef WITH_UNIVERSAL_NEWLINES
! 	{"newlines", (getter)get_newlines, NULL, 
! 	 "end-of-line convention used in this file"},
 #endif
 	{0},

AltStyle によって変換されたページ (->オリジナル) /