[Python-checkins] python/nondist/sandbox/datetime obj_date.c,1.39,1.40 obj_datetime.c,1.37,1.38 obj_delta.c,1.24,1.25 obj_time.c,1.3,1.4
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
Sat, 07 Dec 2002 14:29:48 -0800
Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory sc8-pr-cvs1:/tmp/cvs-serv30004
Modified Files:
obj_date.c obj_datetime.c obj_delta.c obj_time.c
Log Message:
Added PyDoc_STR() macros.
Index: obj_date.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/obj_date.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** obj_date.c 7 Dec 2002 19:51:18 -0000 1.39
--- obj_date.c 7 Dec 2002 22:29:45 -0000 1.40
***************
*** 492,540 ****
{"fromtimestamp", (PyCFunction)date_fromtimestamp, METH_VARARGS |
METH_CLASS,
! "timestamp -> local date from a POSIX timestamp (like time.time())."},
{"fromordinal", (PyCFunction)date_fromordinal, METH_VARARGS |
METH_CLASS,
! "int -> date corresponding to a proleptic Gregorian ordinal."},
{"today", (PyCFunction)date_today, METH_O | METH_CLASS,
! "Current date or datetime: same as "
! "self.__class__.fromtimestamp(time.time())."},
/* Instance methods: */
{"ctime", (PyCFunction)date_ctime, METH_NOARGS,
! "Return ctime() style string."},
{"strftime", (PyCFunction)date_strftime, METH_O,
! "format -> strftime() style string."},
{"timetuple", (PyCFunction)date_timetuple, METH_NOARGS,
! "Return time tuple, compatible with time.localtime()."},
{"isocalendar", (PyCFunction)date_isocalendar, METH_NOARGS,
! "Return a 3-tuple containing ISO year, week number, and weekday.\n\n"
! "The first ISO week of the year is the (Mon-Sun) week containing the\n"
! "year's first Thursday; everything else derives from that."},
{"isoformat", (PyCFunction)date_str, METH_NOARGS,
! "Return string in ISO 8601 format, YYYY-MM-DD."},
{"isoweekday", (PyCFunction)date_isoweekday, METH_NOARGS,
! "Return the day of the week represented by the date.\n"
! "Monday == 1 ... Sunday == 7"},
{"toordinal", (PyCFunction)date_toordinal, METH_NOARGS,
! "Return proleptic Gregorian ordinal. January 1 of year 1 is day 1."},
{"weekday", (PyCFunction)date_weekday, METH_NOARGS,
! "Return the day of the week represented by the date.\n"
! "Monday == 0 ... Sunday == 6"},
{"__setstate__", (PyCFunction)date_setstate, METH_O,
! PyDoc_STR("__setstate__(state)")},
{"__getstate__", (PyCFunction)date_getstate, METH_NOARGS,
! PyDoc_STR("__getstate__() -> state")},
{NULL, NULL}
--- 492,542 ----
{"fromtimestamp", (PyCFunction)date_fromtimestamp, METH_VARARGS |
METH_CLASS,
! PyDoc_STR("timestamp -> local date from a POSIX timestamp (like "
! "time.time()).")},
{"fromordinal", (PyCFunction)date_fromordinal, METH_VARARGS |
METH_CLASS,
! PyDoc_STR("int -> date corresponding to a proleptic Gregorian "
! "ordinal.")},
{"today", (PyCFunction)date_today, METH_O | METH_CLASS,
! PyDoc_STR("Current date or datetime: same as "
! "self.__class__.fromtimestamp(time.time()).")},
/* Instance methods: */
{"ctime", (PyCFunction)date_ctime, METH_NOARGS,
! PyDoc_STR("Return ctime() style string.")},
{"strftime", (PyCFunction)date_strftime, METH_O,
! PyDoc_STR("format -> strftime() style string.")},
{"timetuple", (PyCFunction)date_timetuple, METH_NOARGS,
! PyDoc_STR("Return time tuple, compatible with time.localtime().")},
{"isocalendar", (PyCFunction)date_isocalendar, METH_NOARGS,
! PyDoc_STR("Return a 3-tuple containing ISO year, week number, and "
! "weekday.")},
{"isoformat", (PyCFunction)date_str, METH_NOARGS,
! PyDoc_STR("Return string in ISO 8601 format, YYYY-MM-DD.")},
{"isoweekday", (PyCFunction)date_isoweekday, METH_NOARGS,
! PyDoc_STR("Return the day of the week represented by the date.\n"
! "Monday == 1 ... Sunday == 7")},
{"toordinal", (PyCFunction)date_toordinal, METH_NOARGS,
! PyDoc_STR("Return proleptic Gregorian ordinal. January 1 of year "
! "1 is day 1.")},
{"weekday", (PyCFunction)date_weekday, METH_NOARGS,
! PyDoc_STR("Return the day of the week represented by the date.\n"
! "Monday == 0 ... Sunday == 6")},
{"__setstate__", (PyCFunction)date_setstate, METH_O,
! PyDoc_STR("__setstate__(state)")},
{"__getstate__", (PyCFunction)date_getstate, METH_NOARGS,
! PyDoc_STR("__getstate__() -> state")},
{NULL, NULL}
***************
*** 542,546 ****
static char date_doc[] =
! "Basic date type.";
static PyNumberMethods date_as_number = {
--- 544,548 ----
static char date_doc[] =
! PyDoc_STR("Basic date type.");
static PyNumberMethods date_as_number = {
Index: obj_datetime.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/obj_datetime.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** obj_datetime.c 7 Dec 2002 21:18:38 -0000 1.37
--- obj_datetime.c 7 Dec 2002 22:29:45 -0000 1.38
***************
*** 614,665 ****
{"now", (PyCFunction)datetime_now,
METH_O | METH_CLASS,
! "Return a new datetime representing local day and time."},
{"utcnow", (PyCFunction)datetime_utcnow,
METH_O | METH_CLASS,
! "Return a new datetime representing UTC day and time."},
{"fromtimestamp", (PyCFunction)datetime_fromtimestamp,
METH_VARARGS | METH_CLASS,
! "timestamp -> local datetime from a POSIX timestamp "
! "(like time.time())."},
{"utcfromtimestamp", (PyCFunction)datetime_utcfromtimestamp,
METH_VARARGS | METH_CLASS,
! "timestamp -> UTC datetime from a POSIX timestamp "
! "(like time.time())."},
{"combine", (PyCFunction)datetime_combine,
METH_KEYWORDS | METH_CLASS,
! "date, time -> datetime with same date and time fields"},
/* Instance methods: */
{"timetuple", (PyCFunction)datetime_timetuple, METH_NOARGS,
! "Return time tuple, compatible with time.localtime()."},
{"date", (PyCFunction)datetime_getdate, METH_NOARGS,
! "Return date object with same year, month and day."},
{"time", (PyCFunction)datetime_gettime, METH_NOARGS,
! "Return time object with same hour, minute, second and microsecond."},
{"ctime", (PyCFunction)datetime_ctime, METH_NOARGS,
! "Return ctime() style string."},
{"isoformat", (PyCFunction)datetime_isoformat, METH_KEYWORDS,
! "[sep] -> string in ISO 8601 format, YYYY-MM-DDTHH:MM:SS.mmmmmm.\n\n"
! "sep is used to separate the year from the time, and defaults\n"
! "to 'T'."},
{"__setstate__", (PyCFunction)datetime_setstate, METH_O,
! PyDoc_STR("__setstate__(state)")},
{"__getstate__", (PyCFunction)datetime_getstate, METH_NOARGS,
! PyDoc_STR("__getstate__() -> state")},
{NULL, NULL}
};
static char datetime_doc[] =
! "Basic date/time type.";
static PyNumberMethods datetime_as_number = {
--- 614,668 ----
{"now", (PyCFunction)datetime_now,
METH_O | METH_CLASS,
! PyDoc_STR("Return a new datetime representing local day and time.")},
{"utcnow", (PyCFunction)datetime_utcnow,
METH_O | METH_CLASS,
! PyDoc_STR("Return a new datetime representing UTC day and time.")},
{"fromtimestamp", (PyCFunction)datetime_fromtimestamp,
METH_VARARGS | METH_CLASS,
! PyDoc_STR("timestamp -> local datetime from a POSIX timestamp "
! "(like time.time()).")},
{"utcfromtimestamp", (PyCFunction)datetime_utcfromtimestamp,
METH_VARARGS | METH_CLASS,
! PyDoc_STR("timestamp -> UTC datetime from a POSIX timestamp "
! "(like time.time()).")},
{"combine", (PyCFunction)datetime_combine,
METH_KEYWORDS | METH_CLASS,
! PyDoc_STR("date, time -> datetime with same date and time fields")},
/* Instance methods: */
{"timetuple", (PyCFunction)datetime_timetuple, METH_NOARGS,
! PyDoc_STR("Return time tuple, compatible with time.localtime().")},
{"date", (PyCFunction)datetime_getdate, METH_NOARGS,
! PyDoc_STR("Return date object with same year, month and day.")},
{"time", (PyCFunction)datetime_gettime, METH_NOARGS,
! PyDoc_STR("Return time object with same hour, minute, second and "
! "microsecond.")},
{"ctime", (PyCFunction)datetime_ctime, METH_NOARGS,
! PyDoc_STR("Return ctime() style string.")},
{"isoformat", (PyCFunction)datetime_isoformat, METH_KEYWORDS,
! PyDoc_STR("[sep] -> string in ISO 8601 format, "
! "YYYY-MM-DDTHH:MM:SS.mmmmmm.\n\n"
! "sep is used to separate the year from the time, and "
! "defaults\n"
! "to 'T'.")},
{"__setstate__", (PyCFunction)datetime_setstate, METH_O,
! PyDoc_STR("__setstate__(state)")},
{"__getstate__", (PyCFunction)datetime_getstate, METH_NOARGS,
! PyDoc_STR("__getstate__() -> state")},
{NULL, NULL}
};
static char datetime_doc[] =
! PyDoc_STR("Basic date/time type.");
static PyNumberMethods datetime_as_number = {
Index: obj_delta.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/obj_delta.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** obj_delta.c 7 Dec 2002 19:03:15 -0000 1.24
--- obj_delta.c 7 Dec 2002 22:29:45 -0000 1.25
***************
*** 623,628 ****
--- 623,630 ----
{"days", T_LONG, OFFSET(days), READONLY,
PyDoc_STR("Number of days.")},
+
{"seconds", T_LONG, OFFSET(seconds), READONLY,
PyDoc_STR("Number of seconds (>= 0 and less than 1 day).")},
+
{"microseconds", T_LONG, OFFSET(microseconds), READONLY,
PyDoc_STR("Number of microseconds (>= 0 and less than 1 second).")},
***************
*** 632,645 ****
static PyMethodDef delta_methods[] = {
{"__setstate__", (PyCFunction)delta_setstate, METH_O,
! PyDoc_STR("__setstate__(state)")},
{"__reduce__", (PyCFunction)delta_reduce, METH_NOARGS,
! NULL},
{"__getstate__", (PyCFunction)delta_getstate, METH_NOARGS,
! PyDoc_STR("__getstate__() -> state")},
{NULL, NULL},
};
static char delta_doc[] =
! "Difference between two datetime values.";
static PyNumberMethods delta_as_number = {
--- 634,649 ----
static PyMethodDef delta_methods[] = {
{"__setstate__", (PyCFunction)delta_setstate, METH_O,
! PyDoc_STR("__setstate__(state)")},
!
{"__reduce__", (PyCFunction)delta_reduce, METH_NOARGS,
! PyDoc_STR("__setstate__(state)")},
!
{"__getstate__", (PyCFunction)delta_getstate, METH_NOARGS,
! PyDoc_STR("__getstate__() -> state")},
{NULL, NULL},
};
static char delta_doc[] =
! PyDoc_STR("Difference between two datetime values.");
static PyNumberMethods delta_as_number = {
Index: obj_time.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/obj_time.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** obj_time.c 7 Dec 2002 19:03:15 -0000 1.3
--- obj_time.c 7 Dec 2002 22:29:45 -0000 1.4
***************
*** 260,278 ****
static PyMethodDef time_methods[] = {
{"isoformat", (PyCFunction)time_isoformat, METH_KEYWORDS,
! "Return string in ISO 8601 format, HH:MM:SS.mmmmmm."},
{"strftime", (PyCFunction)time_strftime, METH_O,
! "format -> strftime() style string."},
{"__setstate__", (PyCFunction)time_setstate, METH_O,
! PyDoc_STR("__setstate__(state)")},
{"__getstate__", (PyCFunction)time_getstate, METH_NOARGS,
! PyDoc_STR("__getstate__() -> state")},
{NULL, NULL}
};
static char time_doc[] =
! "Basic time type.";
static PyNumberMethods time_as_number = {
--- 260,278 ----
static PyMethodDef time_methods[] = {
{"isoformat", (PyCFunction)time_isoformat, METH_KEYWORDS,
! PyDoc_STR("Return string in ISO 8601 format, HH:MM:SS.mmmmmm.")},
{"strftime", (PyCFunction)time_strftime, METH_O,
! PyDoc_STR("format -> strftime() style string.")},
{"__setstate__", (PyCFunction)time_setstate, METH_O,
! PyDoc_STR("__setstate__(state)")},
{"__getstate__", (PyCFunction)time_getstate, METH_NOARGS,
! PyDoc_STR("__getstate__() -> state")},
{NULL, NULL}
};
static char time_doc[] =
! PyDoc_STR("Basic time type.");
static PyNumberMethods time_as_number = {