[Zodb-checkins] CVS: Zope/lib/python/ZODB - TimeStamp.c:1.10.16.2
Guido van Rossum
guido@python.org
Wed, 13 Feb 2002 15:47:30 -0500
Update of /cvs-repository/Zope/lib/python/ZODB
In directory cvs.zope.org:/tmp/cvs-serv404
Modified Files:
Tag: Zope-2_5-branch
TimeStamp.c
Log Message:
Bugfix merged from trunk: make sure the seconds in str() of a
TimeStamp object are displayed with a leading zero if necessary.
=== Zope/lib/python/ZODB/TimeStamp.c 1.10.16.1 => 1.10.16.2 ===
if (PyArg_ParseTuple(args, "iii|iid", &y, &mo, &d, &h, &m, &sec))
{
- s=self->data;
+ s=(char *)self->data;
v=((((y-1900)*12+mo-1)*31+d-1)*24+h)*60+m;
s[0]=v/16777216;
s[1]=(v%16777216)/65536;
@@ -238,7 +238,7 @@
self=o;
- UNLESS(a=PyString_FromStringAndSize(self->data, 8)) return NULL;
+ UNLESS(a=PyString_FromStringAndSize((char *) self->data, 8)) return NULL;
s=(unsigned char *)PyString_AsString(a);
for (i=7; i > 3; i--)
@@ -324,7 +324,7 @@
static PyObject *
TimeStamp_repr(TimeStamp *self)
{
- return PyString_FromStringAndSize(self->data, 8);
+ return PyString_FromStringAndSize((char *)self->data, 8);
}
static PyObject *
@@ -334,7 +334,7 @@
int l;
TimeStamp_parts(self);
- l=sprintf(buf, "%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%f",
+ l=sprintf(buf, "%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%09.6f",
TimeStamp_y, TimeStamp_m, TimeStamp_d,
TimeStamp_mi/60, TimeStamp_mi%60, TimeStamp_sec(self));
@@ -413,7 +413,6 @@
initTimeStamp(void)
{
PyObject *m, *d, *s;
- char *rev="$Revision$";
if (TimeStamp_init_gmoff() < 0) return;
if (! ExtensionClassImported) return;
@@ -436,10 +435,6 @@
s = PyString_FromString("TimeStamp.error");
PyDict_SetItemString(d, "error", s);
- Py_XDECREF(s);
-
- s = PyString_FromStringAndSize(rev + 11, strlen(rev + 11) - 2);
- PyDict_SetItemString(d, "__version__", s);
Py_XDECREF(s);
/* Check for errors */