Update of /cvsroot/pywin32/pywin32/com/win32com/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3985/com/win32com/src
Modified Files:
Tag: py3k
PyComHelpers.cpp PythonCOM.cpp oleargs.cpp
Log Message:
merge various changes, particularly PyTime, from trunk
Index: PythonCOM.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PythonCOM.cpp,v
retrieving revision 1.52.2.4
retrieving revision 1.52.2.5
diff -C2 -d -r1.52.2.4 -r1.52.2.5
*** PythonCOM.cpp 19 Dec 2008 02:33:56 -0000 1.52.2.4
--- PythonCOM.cpp 8 Jan 2009 03:45:49 -0000 1.52.2.5
***************
*** 742,758 ****
}
- // @pymethod <o PyIID>|pythoncom|MakeIID|Creates a new IID object.
static PyObject *pythoncom_MakeIID(PyObject *self, PyObject *args)
{
! // @comm This is simply an alias for <om pywintypes.IID>. Please see that method
! // for details.
return PyWinMethod_NewIID(self, args);
}
! // @pymethod <o PyTime>|pythoncom|MakeTime|Creates a new time object.
static PyObject *pythoncom_MakeTime(PyObject *self, PyObject *args)
{
! // @comm This is simply an alias for <om pywintypes.Time>. Please see that method
! // for details.
return PyWinMethod_NewTime(self, args);
}
--- 742,755 ----
}
static PyObject *pythoncom_MakeIID(PyObject *self, PyObject *args)
{
! PyErr_WarnEx(PyExc_PendingDeprecationWarning, "MakeIID is deprecated - please use pywintypes.IID() instead.", 1);
return PyWinMethod_NewIID(self, args);
}
! // no autoduct - this is deprecated.
static PyObject *pythoncom_MakeTime(PyObject *self, PyObject *args)
{
! PyErr_WarnEx(PyExc_PendingDeprecationWarning, "MakeTime is deprecated - please use pywintypes.Time() instead.", 1);
return PyWinMethod_NewTime(self, args);
}
***************
*** 1898,1903 ****
{ "LoadRegTypeLib", pythoncom_loadregtypelib, 1 }, // @pymeth LoadRegTypeLib|Loads a registered type library by CLSID
{ "LoadTypeLib", pythoncom_loadtypelib, 1 }, // @pymeth LoadTypeLib|Loads a type library by name
! { "MakeIID", pythoncom_MakeIID, 1 }, // @pymeth MakeIID|Makes an IID object from a string.
! { "MakeTime", pythoncom_MakeTime, 1 }, // @pymeth MakeTime|Makes a time object from the argument. Argument can be an integer/float or a tuple (as returned by time module functions).
{ "MakePyFactory", pythoncom_MakePyFactory, 1 }, // @pymeth MakePyFactory|Creates a new <o PyIClassFactory> object wrapping a PythonCOM Class Factory object.
#ifndef MS_WINCE
--- 1895,1900 ----
{ "LoadRegTypeLib", pythoncom_loadregtypelib, 1 }, // @pymeth LoadRegTypeLib|Loads a registered type library by CLSID
{ "LoadTypeLib", pythoncom_loadtypelib, 1 }, // @pymeth LoadTypeLib|Loads a type library by name
! { "MakeIID", pythoncom_MakeIID, 1 },
! { "MakeTime", pythoncom_MakeTime, 1 },
{ "MakePyFactory", pythoncom_MakePyFactory, 1 }, // @pymeth MakePyFactory|Creates a new <o PyIClassFactory> object wrapping a PythonCOM Class Factory object.
#ifndef MS_WINCE
Index: PyComHelpers.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyComHelpers.cpp,v
retrieving revision 1.15.2.3
retrieving revision 1.15.2.4
diff -C2 -d -r1.15.2.3 -r1.15.2.4
*** PyComHelpers.cpp 11 Oct 2008 18:44:57 -0000 1.15.2.3
--- PyComHelpers.cpp 8 Jan 2009 03:45:49 -0000 1.15.2.4
***************
*** 330,342 ****
if (!PyWinObject_AsULARGE_INTEGER(obSize, &pStat->cbSize))
return FALSE;
! if (!PyTime_Check(obmtime) || !PyTime_Check(obctime) || !PyTime_Check(obatime)) {
PyErr_SetString(PyExc_TypeError, "The time entries in a STATSTG tuple must be PyTime objects");
return FALSE;
}
! if (!((PyTime *)obmtime)->GetTime(&pStat->mtime))
return FALSE;
! if (!((PyTime *)obctime)->GetTime(&pStat->ctime))
return FALSE;
! if (!((PyTime *)obatime)->GetTime(&pStat->atime))
return FALSE;
if (!PyWinObject_AsIID(obCLSID, &pStat->clsid))
--- 330,342 ----
if (!PyWinObject_AsULARGE_INTEGER(obSize, &pStat->cbSize))
return FALSE;
! if (!PyWinTime_Check(obmtime) || !PyWinTime_Check(obctime) || !PyWinTime_Check(obatime)) {
PyErr_SetString(PyExc_TypeError, "The time entries in a STATSTG tuple must be PyTime objects");
return FALSE;
}
! if (!PyWinObject_AsFILETIME(obmtime, &pStat->mtime))
return FALSE;
! if (!PyWinObject_AsFILETIME(obctime, &pStat->ctime))
return FALSE;
! if (!PyWinObject_AsFILETIME(obatime, &pStat->atime))
return FALSE;
if (!PyWinObject_AsIID(obCLSID, &pStat->clsid))
Index: oleargs.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/oleargs.cpp,v
retrieving revision 1.41.2.5
retrieving revision 1.41.2.6
diff -C2 -d -r1.41.2.5 -r1.41.2.6
*** oleargs.cpp 13 Oct 2008 20:39:41 -0000 1.41.2.5
--- oleargs.cpp 8 Jan 2009 03:45:49 -0000 1.41.2.6
***************
*** 154,158 ****
V_ERROR(var) = DISP_E_PARAMNOTFOUND;
}
! else if (PyTime_Check(obj) || PyObject_HasAttrString(obj, "timetuple"))
{
V_VT(var) = VT_DATE;
--- 154,158 ----
V_ERROR(var) = DISP_E_PARAMNOTFOUND;
}
! else if (PyWinTime_Check(obj))
{
V_VT(var) = VT_DATE;
***************
*** 1290,1294 ****
V_DATEREF(var) = &m_dateBuf;
if (!VALID_BYREF_MISSING(obj)) {
! if ( !PyTime_Check(obj) ) BREAK_FALSE;
if ( !PyWinObject_AsDATE(obj, V_DATEREF(var) ) ) BREAK_FALSE;
} else
--- 1290,1294 ----
V_DATEREF(var) = &m_dateBuf;
if (!VALID_BYREF_MISSING(obj)) {
! if ( !PyWinTime_Check(obj) ) BREAK_FALSE;
if ( !PyWinObject_AsDATE(obj, V_DATEREF(var) ) ) BREAK_FALSE;
} else
|