[Python-checkins] python/nondist/sandbox/datetime obj_timetz.c,1.29,1.30

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
2002年12月15日 15:25:35 -0800


Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory sc8-pr-cvs1:/tmp/cvs-serv24307
Modified Files:
	obj_timetz.c 
Log Message:
Change C timetz to inherit strftime from datetime.time. This is in
preparation for making the C implementation of strftime "work".
Index: obj_timetz.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/obj_timetz.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** obj_timetz.c	15 Dec 2002 03:58:28 -0000	1.29
--- obj_timetz.c	15 Dec 2002 23:25:32 -0000	1.30
***************
*** 130,151 ****
 }
 
! /* XXX This one's going to be a PITA. */
! static PyObject *
! timetz_strftime(PyDateTime_TimeTZ *self, PyObject *format)
! {
! 	PyObject *result;
! 	PyObject *tuple = Py_BuildValue("iiiiiiiii",
! 				 0, 0, 0, /* year, month, day */
! 				 TIME_GET_HOUR(self),
! 				 TIME_GET_MINUTE(self),
! 				 TIME_GET_SECOND(self),
! 				 0, 0, -1); /* weekday, daynum, dst */
! 	if (tuple == NULL)
! 		return NULL;
! 	assert(PyTuple_Size(tuple) == 9);
! 	result = format_strftime(format, tuple);
! 	Py_DECREF(tuple);
! 	return result;
! }
 
 /*
--- 130,134 ----
 }
 
! /* Note: strftime() is inherited from time. */
 
 /*
***************
*** 271,277 ****
 	 PyDoc_STR("Return string in ISO 8601 format, HH:MM:SS[.mmmmmm]"
 	 	 "[+HH:MM].")},
- 
- 	{"strftime", 	(PyCFunction)timetz_strftime,	METH_O,
- 	 PyDoc_STR("format -> strftime() style string.")},
 
 	{"utcoffset",	(PyCFunction)timetz_utcoffset,	METH_NOARGS,
--- 254,257 ----

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