[pywin32-checkins] pywin32/com/win32comext/bits/src bits.cpp, 1.1.2.5, 1.1.2.6
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-02-08 05:41:58
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/bits/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25876 Modified Files: Tag: sidnei-bits bits.cpp Log Message: Return None if the time is zero, and add basic autoduck docs Index: bits.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/bits/src/Attic/bits.cpp,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** bits.cpp 8 Feb 2008 05:27:27 -0000 1.1.2.5 --- bits.cpp 8 Feb 2008 05:41:57 -0000 1.1.2.6 *************** *** 12,15 **** --- 12,16 ---- # include "PythonCOMRegister.h" + // @doc BOOL PyObject_AsBG_FILE_INFO_LIST(PyObject *ob, ULONG *pnum, BG_FILE_INFO **fi) *************** *** 36,39 **** --- 37,41 ---- PyObject *PyObject_FromBG_FILE_PROGRESS(BG_FILE_PROGRESS *fp) { + // @object PyObject_FromBG_FILE_PROGRESS|A tuple of 3 elements (bytesTotal, bytesTransfered, completed), (int, int, bool) return Py_BuildValue("NNO", PyLong_FromLongLong(fp->BytesTotal), *************** *** 44,47 **** --- 46,50 ---- PyObject *PyObject_FromBG_JOB_PROGRESS(BG_JOB_PROGRESS *jp) { + // @object PyObject_FromBG_JOB_PROGRESS|A tuple of 4 elements (bytesTotal, bytesTransfered, filesTotal, filesTransfered), all ints. return Py_BuildValue("NNkk", PyLong_FromLongLong(jp->BytesTotal), PyLong_FromLongLong(jp->BytesTransferred), jp->FilesTotal, jp->FilesTransferred); *************** *** 49,58 **** PyObject *PyObject_FromBG_JOB_REPLY_PROGRESS(BG_JOB_REPLY_PROGRESS *jrs) { return Py_BuildValue("NN", PyLong_FromLongLong(jrs->BytesTotal), PyLong_FromLongLong(jrs->BytesTransferred)); } PyObject *PyObject_FromBG_JOB_TIMES(BG_JOB_TIMES *jt) { ! return Py_BuildValue("NNN", PyWinObject_FromFILETIME(jt->CreationTime), PyWinObject_FromFILETIME(jt->ModificationTime), PyWinObject_FromFILETIME(jt->TransferCompletionTime)); } --- 52,77 ---- PyObject *PyObject_FromBG_JOB_REPLY_PROGRESS(BG_JOB_REPLY_PROGRESS *jrs) { + // @object BG_JOB_REPLY_PROGRESS|A tuple of 2 elements (bytesTotal, bytesTransfered), both ints. return Py_BuildValue("NN", PyLong_FromLongLong(jrs->BytesTotal), PyLong_FromLongLong(jrs->BytesTransferred)); } + PyObject *MakeTimeOrNone(const FILETIME &t) + { + if (t.dwLowDateTime==0 && t.dwHighDateTime==0) { + Py_INCREF(Py_None); + return Py_None; + } + return PyWinObject_FromFILETIME(t); + } + PyObject *PyObject_FromBG_JOB_TIMES(BG_JOB_TIMES *jt) { ! // @object BG_JOB_TIMES|A tuple of 3 elements, where each element may be ! // None or a <o PyTime> object. The elements are the CreationTime, ! // ModificationTime and TransferCompletionTime, respectively. ! return Py_BuildValue("NNN", ! MakeTimeOrNone(jt->CreationTime), ! MakeTimeOrNone(jt->ModificationTime), ! MakeTimeOrNone(jt->TransferCompletionTime)); } |