pywin32-checkins Mailing List for Python for Windows Extensions (Page 107)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(6) |
Jul
(50) |
Aug
(11) |
Sep
(24) |
Oct
(184) |
Nov
(118) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(31) |
Feb
(25) |
Mar
(34) |
Apr
(105) |
May
(49) |
Jun
(38) |
Jul
(39) |
Aug
(7) |
Sep
(98) |
Oct
(79) |
Nov
(20) |
Dec
(17) |
2005 |
Jan
(66) |
Feb
(32) |
Mar
(43) |
Apr
(30) |
May
(58) |
Jun
(30) |
Jul
(16) |
Aug
(4) |
Sep
(21) |
Oct
(42) |
Nov
(11) |
Dec
(14) |
2006 |
Jan
(42) |
Feb
(30) |
Mar
(22) |
Apr
(1) |
May
(9) |
Jun
(15) |
Jul
(20) |
Aug
(9) |
Sep
(8) |
Oct
(1) |
Nov
(9) |
Dec
(43) |
2007 |
Jan
(52) |
Feb
(45) |
Mar
(20) |
Apr
(12) |
May
(59) |
Jun
(39) |
Jul
(35) |
Aug
(31) |
Sep
(17) |
Oct
(20) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(28) |
Feb
(111) |
Mar
(4) |
Apr
(27) |
May
(40) |
Jun
(27) |
Jul
(32) |
Aug
(94) |
Sep
(87) |
Oct
(153) |
Nov
(336) |
Dec
(331) |
2009 |
Jan
(298) |
Feb
(127) |
Mar
(20) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
2010 |
Jan
(7) |
Feb
(1) |
Mar
|
Apr
|
May
(15) |
Jun
(4) |
Jul
(3) |
Aug
(28) |
Sep
(1) |
Oct
(19) |
Nov
(16) |
Dec
(6) |
2011 |
Jan
(2) |
Feb
(18) |
Mar
(17) |
Apr
(12) |
May
(5) |
Jun
(11) |
Jul
(7) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(4) |
Dec
|
2012 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(8) |
May
(4) |
Jun
(3) |
Jul
(13) |
Aug
(27) |
Sep
(8) |
Oct
(9) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(10) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(9) |
2014 |
Jan
(2) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Mark H. <mha...@us...> - 2005-11-11 02:37:47
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1320 Modified Files: PythonCOM.cpp dllmain.cpp Log Message: Correct and document behaviour of CoInitializeEx exception throwing behaviour. Also fix what previously appeared to be an optimizer error but turns out to be incorrect calling convention on the function pointer. Index: PythonCOM.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PythonCOM.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** PythonCOM.cpp 20 Oct 2005 22:36:07 -0000 1.37 --- PythonCOM.cpp 11 Nov 2005 02:37:38 -0000 1.38 *************** *** 523,527 **** return PyCom_BuildPyException(sc); return PyCom_PyObjectFromIUnknown(disp, IID_IDispatch); ! // @comm This function is equivilent to <om pythoncom.GetActiveObject>(clsid).<om pythoncom.QueryInterace>(pythoncom.IID_IDispatch) } #endif // MS_WINCE --- 523,527 ---- return PyCom_BuildPyException(sc); return PyCom_PyObjectFromIUnknown(disp, IID_IDispatch); ! // @comm This function is equivalent to <om pythoncom.GetActiveObject>(clsid).<om pythoncom.QueryInterace>(pythoncom.IID_IDispatch) } #endif // MS_WINCE *************** *** 946,954 **** HRESULT hr = PyCom_CoInitialize(NULL); PY_INTERFACE_POSTCALL; ! if (FAILED(hr)) ! PyCom_BuildPyException(hr); Py_INCREF(Py_None); return Py_None; ! // @comm Equivilent to <om pythoncom.CoInitializeEx>(pythoncom.COINIT_APARTMENTTHREADED). // See <om pythoncom.CoInitializeEx> for a description. } --- 946,964 ---- HRESULT hr = PyCom_CoInitialize(NULL); PY_INTERFACE_POSTCALL; ! // @rdesc This function will ignore the RPC_E_CHANGED_MODE error, as ! // that error indicates someone else beat you to the initialization, and ! // did so with a different threading model. This error is ignored as it ! // still means COM is ready for use on this thread, and as this function ! // does not explicitly specify a threading model the caller probably ! // doesn't care what model it is. ! // <nl>All other COM errors will raise pythoncom.error as usual. Use ! // <om pythoncom.CoInitializeEx> if you also want to handle the RPC_E_CHANGED_MODE ! // error. ! if (FAILED(hr) && hr != RPC_E_CHANGED_MODE) ! return PyCom_BuildPyException(hr); Py_INCREF(Py_None); return Py_None; ! // @comm Apart from the error handling semantics, this is equivalent ! // to <om pythoncom.CoInitializeEx>(pythoncom.COINIT_APARTMENTTHREADED). // See <om pythoncom.CoInitializeEx> for a description. } *************** *** 957,960 **** --- 967,976 ---- static PyObject *pythoncom_CoInitializeEx(PyObject *self, PyObject *args) { + // @rdesc This function will raise pythoncom.error for all error + // return values, including RPC_E_CHANGED_MODE error. This is + // in contrast to <om pythoncom.CoInitialize> which will hide that + // specific error. If your code is happy to work in a threading model + // other than the one you specified, you must explicitly handle + // (and presumably ignore) this exception. DWORD val; if (!PyArg_ParseTuple(args, "l:CoInitializeEx", &val)) *************** *** 965,969 **** PY_INTERFACE_POSTCALL; if (FAILED(hr)) ! PyCom_BuildPyException(hr); Py_INCREF(Py_None); return Py_None; --- 981,985 ---- PY_INTERFACE_POSTCALL; if (FAILED(hr)) ! return PyCom_BuildPyException(hr); Py_INCREF(Py_None); return Py_None; Index: dllmain.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/dllmain.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** dllmain.cpp 25 Jan 2005 13:33:15 -0000 1.11 --- dllmain.cpp 11 Nov 2005 02:37:38 -0000 1.12 *************** *** 153,165 **** } ! #ifdef _MSC_VER ! // Wierd problems with optimizer. When anyone ! // calls this, things go very strange. Debugger indicates ! // all params are wierd etc.. ! // Only release mode, of course :-( Dunno what optimization! ! // Compiler version 11.00.7022 ! #pragma optimize ("", off) ! #endif // _MSC_VER ! // Some clients or COM extensions (notably MAPI) are _very_ --- 153,157 ---- } ! typedef HRESULT (WINAPI *PFNCoInitializeEx)(LPVOID pvReserved, DWORD dwCoInit); // Some clients or COM extensions (notably MAPI) are _very_ *************** *** 184,189 **** if (fp==NULL) return E_NOTIMPL; ! HRESULT (*mypfn)(void *pvReserved, DWORD dwCoInit); ! mypfn = (HRESULT (*)(void *pvReserved, DWORD dwCoInit))fp; HRESULT hr = (*mypfn)(reserved, dwInit); --- 176,181 ---- if (fp==NULL) return E_NOTIMPL; ! PFNCoInitializeEx mypfn; ! mypfn = (PFNCoInitializeEx)fp; HRESULT hr = (*mypfn)(reserved, dwInit); *************** *** 205,212 **** return hr; } - #ifdef _MSC_VER - #pragma optimize ("", on) - #endif // _MSC_VER - HRESULT PyCom_CoInitialize(LPVOID reserved) --- 197,200 ---- |
From: Mark H. <mha...@us...> - 2005-11-11 02:35:39
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1257 Modified Files: ErrorUtils.cpp Log Message: Must have Python lock before trying to log an error. Index: ErrorUtils.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/ErrorUtils.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ErrorUtils.cpp 20 May 2005 23:26:53 -0000 1.26 --- ErrorUtils.cpp 11 Nov 2005 02:35:29 -0000 1.27 *************** *** 594,597 **** --- 594,598 ---- static void _DoLogger(PyObject *logProvider, char *log_method, const char *fmt, va_list argptr) { + CEnterLeavePython _celp; PyObject *exc_typ = NULL, *exc_val = NULL, *exc_tb = NULL; PyErr_Fetch( &exc_typ, &exc_val, &exc_tb); |
From: Mark H. <mha...@us...> - 2005-11-01 21:24:21
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2864/win32/src Modified Files: win32file.i Log Message: Autoduck corrections for LockFile. Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** win32file.i 28 Jun 2005 12:35:59 -0000 1.48 --- win32file.i 1 Nov 2005 21:24:09 -0000 1.49 *************** *** 1132,1136 **** #ifndef MS_WINCE ! // @pyswig |LockFileEx|locks a file. Wrapper for LockFileEx win32 API. static PyObject * MyLockFileEx(PyObject *self, PyObject *args) --- 1132,1136 ---- #ifndef MS_WINCE ! // @pyswig |LockFileEx|Locks a file. Wrapper for LockFileEx win32 API. static PyObject * MyLockFileEx(PyObject *self, PyObject *args) *************** *** 1468,1472 **** #ifndef MS_WINCE ! // @pyswig |LockFile|Determines the type of a file. BOOLAPI LockFile( PyHANDLE hFile, // @pyparm <o PyHANDLE>|hFile||handle of file to lock --- 1468,1472 ---- #ifndef MS_WINCE ! // @pyswig |LockFile|Locks a specified file for exclusive access by the calling process. BOOLAPI LockFile( PyHANDLE hFile, // @pyparm <o PyHANDLE>|hFile||handle of file to lock |
From: Mark H. <mha...@us...> - 2005-10-29 04:20:20
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26027 Modified Files: setup.py Log Message: Use an external process to stamp the built files, so it works for win32api! Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** setup.py 25 Oct 2005 00:22:03 -0000 1.26 --- setup.py 29 Oct 2005 04:20:12 -0000 1.27 *************** *** 55,58 **** --- 55,60 ---- from distutils.sysconfig import get_python_lib from distutils.filelist import FileList + from distutils.errors import DistutilsExecError + import types, glob import os, string, sys *************** *** 902,933 **** debug, *args, **kw) # Here seems a good place to stamp the version of the built ! # target. try: ! import win32verstamp ! import optparse except ImportError: ! log.info('Unable to import verstamp, no version info will be added') ! else: try: ! v=optparse.Values() ! v.ensure_value('version',pywin32_version) ! v.ensure_value('comments',"http://pywin32.sourceforge.net") ! v.ensure_value('company',None) ! v.ensure_value('description',None) ! v.ensure_value('internal_name',None) ! v.ensure_value('copyright',None) ! v.ensure_value('trademarks',None) ! v.ensure_value('original_filename',os.path.basename(output_filename)) ! v.ensure_value('product','Pywin32') ! v.ensure_value('dll',None) ! v.ensure_value('debug',None) ! v.ensure_value('verbose','-v' in sys.argv) ! win32verstamp.stamp(output_filename, v) ! except: ! # Failure to stamp files means our build stops, which ! # isn't good! ! print "FAILED to stamp files" ! import traceback ! traceback.print_exc() finally: if old_linker is not None: --- 904,936 ---- debug, *args, **kw) # Here seems a good place to stamp the version of the built ! # target. Do this externally to avoid suddenly dragging in the ! # modules needed by this process, and which we will soon try and ! # update. try: ! import optparse # win32verstamp will not work without this! ! ok = True except ImportError: ! ok = False ! if ok: ! stamp_script = os.path.join(sys.prefix, "Lib", "site-packages", ! "win32", "lib", "win32verstamp.py") ! ok = os.path.isfile(stamp_script) ! if ok: ! args = [sys.executable] ! args.append(stamp_script) ! args.append("--version=%s" % (pywin32_version,)) ! args.append("--comments=http://pywin32.sourceforge.net") ! args.append("--original-filename=%s" % (os.path.basename(output_filename),)) ! args.append("--product=PyWin32") ! if '-v' not in sys.argv: ! args.append("--quiet") ! args.append(output_filename) try: ! self.spawn(args) ! except DistutilsExecError, msg: ! log.info("VersionStamp failed: %s", msg) ! ok = False ! if not ok: ! log.info('Unable to import verstamp, no version info will be added') finally: if old_linker is not None: |
From: Mark H. <mha...@us...> - 2005-10-27 12:26:09
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11758 Modified Files: PySID.cpp Log Message: Fix leak in PySID::strFunc Index: PySID.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PySID.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PySID.cpp 30 Mar 2004 04:14:27 -0000 1.10 --- PySID.cpp 27 Oct 2005 12:26:00 -0000 1.11 *************** *** 396,400 **** strcpy(buf, prefix); GetTextualSid(psid, buf+strlen(prefix), &bufSize); ! return PyString_FromString(buf); } #else /* NO_PYWINTYPES_SECURITY */ --- 396,402 ---- strcpy(buf, prefix); GetTextualSid(psid, buf+strlen(prefix), &bufSize); ! PyObject *ret = PyString_FromString(buf); ! free(buf); ! return ret; } #else /* NO_PYWINTYPES_SECURITY */ |
From: Roger U. <ru...@us...> - 2005-10-26 01:05:27
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9412/com/win32comext/shell/src Modified Files: PyIShellFolder.cpp Log Message: Autoduck fixes, argument handling fix Index: PyIShellFolder.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellFolder.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PyIShellFolder.cpp 18 Oct 2005 00:36:05 -0000 1.11 --- PyIShellFolder.cpp 26 Oct 2005 01:05:18 -0000 1.12 *************** *** 225,229 **** } ! // @pymethod |PyIShellFolder|CreateViewObject|Description of CreateViewObject. PyObject *PyIShellFolder::CreateViewObject(PyObject *self, PyObject *args) { --- 225,229 ---- } ! // @pymethod <o PyIShellView>|PyIShellFolder|CreateViewObject|Creates a view object for a shell folder. PyObject *PyIShellFolder::CreateViewObject(PyObject *self, PyObject *args) { *************** *** 231,236 **** if ( pISF == NULL ) return NULL; ! // @pyparm HWND|hwndOwner||Description for hwndOwner ! // @pyparm <o PyIID>|riid||Description for riid PyObject *obriid; HWND hwndOwner; --- 231,236 ---- if ( pISF == NULL ) return NULL; ! // @pyparm HWND|hwndOwner||Parent window for a custom folder view, or 0 ! // @pyparm <o PyIID>|riid||IID of the desired interface, usually IID_IShellView PyObject *obriid; HWND hwndOwner; *************** *** 254,258 **** } ! // @pymethod |PyIShellFolder|GetAttributesOf|Description of GetAttributesOf. PyObject *PyIShellFolder::GetAttributesOf(PyObject *self, PyObject *args) { --- 254,259 ---- } ! // @pymethod int|PyIShellFolder|GetAttributesOf|Queries attributes of items within the shell folder ! // @rdesc The requested attributes are only returned if they are common to all of the specified items PyObject *PyIShellFolder::GetAttributesOf(PyObject *self, PyObject *args) { *************** *** 260,265 **** if ( pISF == NULL ) return NULL; ! // @pyparm <o PyIDL>|pidl||Description for pidl ! // @pyparm int|rgfInOut||Description for rgfInOut PyObject *obpidl; UINT cidl; --- 261,266 ---- if ( pISF == NULL ) return NULL; ! // @pyparm (<o PyIDL>,...)|pidl||A sequence of single-level pidls identifying items directly contained by the folder ! // @pyparm int|rgfInOut||Combination of shellcon.SFGAO_* constants PyObject *obpidl; UINT cidl; *************** *** 283,287 **** } ! // @pymethod int, <o PyIUnknown>|PyIShellFolder|GetUIObjectOf|Description of GetUIObjectOf. PyObject *PyIShellFolder::GetUIObjectOf(PyObject *self, PyObject *args) { --- 284,288 ---- } ! // @pymethod int, <o PyIUnknown>|PyIShellFolder|GetUIObjectOf|Creates an interface to one or more items in a shell folder PyObject *PyIShellFolder::GetUIObjectOf(PyObject *self, PyObject *args) { *************** *** 289,297 **** if ( pISF == NULL ) return NULL; ! // @pyparm HWND|hwndOwner||Description for hwndOwner ! // @pyparm <o PyIDL>|pidl||Description for pidl ! // @pyparm <o PyIID>|riid||Description for riid ! // @pyparm int|rgfInOut||Description for rgfInOut ! // @pyparm <o PyIID>|iidout|None|The IID to wrap the result in. If not specified, riid is used. PyObject *obpidl; PyObject *obriid; --- 290,297 ---- if ( pISF == NULL ) return NULL; ! // @pyparm HWND|hwndOwner||Specifies a window in which to display any required dialogs or errors, can be 0 ! // @pyparm (<o PyIDL>,...)|pidl||A sequence of single-level pidls identifying items in the folder ! // @pyparm <o PyIID>|riid||The interface to create, one of IID_IContextMenu, IID_IContextMenu2, IID_IDataObject, IID_IDropTarget, IID_IExtractIcon, IID_IQueryInfo ! // @pyparm int|rgfReserved|0|Reserved, use 0 if passed in PyObject *obpidl; PyObject *obriid; *************** *** 306,310 **** return NULL; BOOL bPythonIsHappy = TRUE; - if (bPythonIsHappy && !PyObject_AsPIDLArray(obpidl, &cidl, &pidl)) bPythonIsHappy = FALSE; if (!PyWinObject_AsIID(obriid, &riid)) bPythonIsHappy = FALSE; if (obiidout==NULL) --- 306,309 ---- *************** *** 312,315 **** --- 311,315 ---- else if (!PyWinObject_AsIID(obiidout, &iidout)) bPythonIsHappy = FALSE; + if (bPythonIsHappy && !PyObject_AsPIDLArray(obpidl, &cidl, &pidl)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; *************** *** 330,334 **** } ! // @pymethod |PyIShellFolder|GetDisplayNameOf|Description of GetDisplayNameOf. PyObject *PyIShellFolder::GetDisplayNameOf(PyObject *self, PyObject *args) { --- 330,334 ---- } ! // @pymethod str|PyIShellFolder|GetDisplayNameOf|Returns the display name of an item within this shell folder PyObject *PyIShellFolder::GetDisplayNameOf(PyObject *self, PyObject *args) { *************** *** 336,341 **** if ( pISF == NULL ) return NULL; ! // @pyparm <o PyIDL>|pidl||Description for pidl ! // @pyparm int|uFlags||Description for uFlags PyObject *obpidl; ITEMIDLIST *pidl; --- 336,341 ---- if ( pISF == NULL ) return NULL; ! // @pyparm <o PyIDL>|pidl||PIDL that identifies the item relative to the parent folder ! // @pyparm int|uFlags||Combination of shellcon.SHGDN_* flags PyObject *obpidl; ITEMIDLIST *pidl; *************** *** 343,349 **** if ( !PyArg_ParseTuple(args, "Ol:GetDisplayNameOf", &obpidl, &uFlags) ) return NULL; ! BOOL bPythonIsHappy = TRUE; ! if (bPythonIsHappy && !PyObject_AsPIDL(obpidl, &pidl)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) return NULL; HRESULT hr; STRRET out; --- 343,348 ---- if ( !PyArg_ParseTuple(args, "Ol:GetDisplayNameOf", &obpidl, &uFlags) ) return NULL; ! if (!PyObject_AsPIDL(obpidl, &pidl)) ! return NULL; HRESULT hr; STRRET out; *************** *** 359,363 **** } ! // @pymethod |PyIShellFolder|SetNameOf|Description of SetNameOf. PyObject *PyIShellFolder::SetNameOf(PyObject *self, PyObject *args) { --- 358,363 ---- } ! // @pymethod <o PyIDL>|PyIShellFolder|SetNameOf|Sets the display name of an item and changes its PIDL ! // @rdesc Returns the new PIDL for item PyObject *PyIShellFolder::SetNameOf(PyObject *self, PyObject *args) { *************** *** 365,395 **** if ( pISF == NULL ) return NULL; ! // @pyparm HWND|hwndOwner||Description for hwndOwner ! // @pyparm <o PyIDL>|pidl||Description for pidl ! // @pyparm <o unicode>|lpszName||Description for lpszName ! PyObject *obpidl; ! PyObject *oblpszName; HWND hwndOwner; ! ITEMIDLIST *pidl; ITEMIDLIST *pidlRet; ! LPOLESTR lpszName; ! long flags; if ( !PyArg_ParseTuple(args, "lOOl:SetNameOf", &hwndOwner, &obpidl, &oblpszName, &flags) ) return NULL; ! BOOL bPythonIsHappy = TRUE; ! if (bPythonIsHappy && !PyObject_AsPIDL(obpidl, &pidl)) bPythonIsHappy = FALSE; ! if (bPythonIsHappy && !PyWinObject_AsBstr(oblpszName, &lpszName)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) return NULL; ! HRESULT hr; ! PY_INTERFACE_PRECALL; ! hr = pISF->SetNameOf( hwndOwner, pidl, lpszName, (SHGDNF)flags, &pidlRet ); PyObject_FreePIDL(pidl); SysFreeString(lpszName); - - PY_INTERFACE_POSTCALL; - - if ( FAILED(hr) ) - return PyCom_BuildPyException(hr, pISF, IID_IShellFolder ); - PyObject *ret = PyObject_FromPIDL(pidlRet, TRUE); return ret; } --- 365,396 ---- if ( pISF == NULL ) return NULL; ! // @pyparm HWND|hwndOwner||Window in which to display any message boxes or dialogs, can be 0 ! // @pyparm <o PyIDL>|pidl||PIDL that identifies the item relative to the parent folder ! // @pyparm <o unicode>|lpszName||New name for the item ! // @pyparm int|Flags||Combination of shellcon.SHGDM_* values ! PyObject *obpidl=NULL, *ret=NULL; ! PyObject *oblpszName=NULL; HWND hwndOwner; ! ITEMIDLIST *pidl=NULL; ITEMIDLIST *pidlRet; ! LPOLESTR lpszName=NULL; ! DWORD flags; ! if ( !PyArg_ParseTuple(args, "lOOl:SetNameOf", &hwndOwner, &obpidl, &oblpszName, &flags) ) return NULL; ! if (PyObject_AsPIDL(obpidl, &pidl)&& ! PyWinObject_AsBstr(oblpszName, &lpszName)){ ! HRESULT hr; ! PY_INTERFACE_PRECALL; ! hr = pISF->SetNameOf( hwndOwner, pidl, lpszName, (SHGDNF)flags, &pidlRet ); ! PY_INTERFACE_POSTCALL; ! if ( FAILED(hr) ) ! PyCom_BuildPyException(hr, pISF, IID_IShellFolder ); ! else ! ret = PyObject_FromPIDL(pidlRet, TRUE); ! } ! PyObject_FreePIDL(pidl); SysFreeString(lpszName); return ret; } *************** *** 398,411 **** static struct PyMethodDef PyIShellFolder_methods[] = { ! { "ParseDisplayName", PyIShellFolder::ParseDisplayName, 1 }, // @pymeth ParseDisplayName|Description of ParseDisplayName ! { "EnumObjects", PyIShellFolder::EnumObjects, 1 }, // @pymeth EnumObjects|Description of EnumObjects ! { "BindToObject", PyIShellFolder::BindToObject, 1 }, // @pymeth BindToObject|Description of BindToObject ! { "BindToStorage", PyIShellFolder::BindToStorage, 1 }, // @pymeth BindToStorage|Description of BindToStorage ! { "CompareIDs", PyIShellFolder::CompareIDs, 1 }, // @pymeth CompareIDs|Description of CompareIDs ! { "CreateViewObject", PyIShellFolder::CreateViewObject, 1 }, // @pymeth CreateViewObject|Description of CreateViewObject ! { "GetAttributesOf", PyIShellFolder::GetAttributesOf, 1 }, // @pymeth GetAttributesOf|Description of GetAttributesOf ! { "GetUIObjectOf", PyIShellFolder::GetUIObjectOf, 1 }, // @pymeth GetUIObjectOf|Description of GetUIObjectOf ! { "GetDisplayNameOf", PyIShellFolder::GetDisplayNameOf, 1 }, // @pymeth GetDisplayNameOf|Description of GetDisplayNameOf ! { "SetNameOf", PyIShellFolder::SetNameOf, 1 }, // @pymeth SetNameOf|Description of SetNameOf { NULL } }; --- 399,412 ---- static struct PyMethodDef PyIShellFolder_methods[] = { ! { "ParseDisplayName", PyIShellFolder::ParseDisplayName, 1 }, // @pymeth ParseDisplayName|Returns the PIDL of an item in a shell folder ! { "EnumObjects", PyIShellFolder::EnumObjects, 1 }, // @pymeth EnumObjects|Creates an enumerator to list the contents of the shell folder ! { "BindToObject", PyIShellFolder::BindToObject, 1 }, // @pymeth BindToObject|Returns an IShellFolder interface for a subfolder ! { "BindToStorage", PyIShellFolder::BindToStorage, 1 }, // @pymeth BindToStorage|Returns an interface to a storage object in a shell folder ! { "CompareIDs", PyIShellFolder::CompareIDs, 1 }, // @pymeth CompareIDs|Determines the sorting order of 2 items in shell folder ! { "CreateViewObject", PyIShellFolder::CreateViewObject, 1 }, // @pymeth CreateViewObject|Creates a view object for a shell folder. ! { "GetAttributesOf", PyIShellFolder::GetAttributesOf, 1 }, // @pymeth GetAttributesOf|Queries attributes of items within the shell folder ! { "GetUIObjectOf", PyIShellFolder::GetUIObjectOf, 1 }, // @pymeth GetUIObjectOf|Creates an interface to one or more items in a shell folder ! { "GetDisplayNameOf", PyIShellFolder::GetDisplayNameOf, 1 }, // @pymeth GetDisplayNameOf|Returns the display name of an item within this shell folder ! { "SetNameOf", PyIShellFolder::SetNameOf, 1 }, // @pymeth SetNameOf|Sets the display name of an item and changes its PIDL { NULL } }; |
From: Mark H. <mha...@us...> - 2005-10-25 00:22:14
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24568 Modified Files: setup.py Log Message: Build 205 and version number tweaks. Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** setup.py 23 Oct 2005 11:33:52 -0000 1.25 --- setup.py 25 Oct 2005 00:22:03 -0000 1.26 *************** *** 1,3 **** ! build_id="204.3" # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) --- 1,3 ---- ! build_id="205" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) *************** *** 23,26 **** --- 23,28 ---- where guid is 4afe3504-c209-4a73-ac5d-ff2a4a3b48b7 Just install it - this setup script will automatically locate it. + (updated for build 205: mapi just seems to require the platform SDK, whereas + the exchange SDK appears missing in action, so these extensions don't build) Note: 'axdebug' appears to work with recent Platform SDKs, with no *************** *** 58,62 **** import _winreg ! pywin32_version="%d.%d.%s" % (sys.version_info[0], sys.version_info[1], build_id) print "Building pywin32", pywin32_version --- 60,68 ---- import _winreg ! build_id_patch = build_id ! if not "." in build_id_patch: ! build_id_patch = build_id_patch + ".0" ! pywin32_version="%d.%d.%s" % (sys.version_info[0], sys.version_info[1], ! build_id_patch) print "Building pywin32", pywin32_version *************** *** 350,354 **** ver_fname = os.path.join(os.environ['temp'], "pywin32.version.txt") try: ! f = open(ver_fname, "U") f.write("%s\n" % build_id) f.close() --- 356,360 ---- ver_fname = os.path.join(os.environ['temp'], "pywin32.version.txt") try: ! f = open(ver_fname, "w") f.write("%s\n" % build_id) f.close() |
From: Mark H. <mha...@us...> - 2005-10-24 06:18:01
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18072 Modified Files: win32serviceutil.py Log Message: Also search sys.prefix for pythonservice.exe Index: win32serviceutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32serviceutil.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** win32serviceutil.py 20 Sep 2005 12:16:22 -0000 1.22 --- win32serviceutil.py 24 Oct 2005 06:17:54 -0000 1.23 *************** *** 33,37 **** except win32api.error: # OK - not there - lets go a-searchin' ! for path in sys.path: look = os.path.join(path, exeName) if os.path.isfile(look): --- 33,37 ---- except win32api.error: # OK - not there - lets go a-searchin' ! for path in [sys.prefix] + sys.path: look = os.path.join(path, exeName) if os.path.isfile(look): |
From: Mark H. <mha...@us...> - 2005-10-23 12:31:22
|
Update of /cvsroot/pywin32/pywin32/win32/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11332 Modified Files: regsetup.py Log Message: Reindent evil mixed tab/space file. Index: regsetup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/scripts/regsetup.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** regsetup.py 23 Oct 2005 12:25:44 -0000 1.13 --- regsetup.py 23 Oct 2005 12:31:12 -0000 1.14 *************** *** 6,30 **** def FileExists(fname): ! """Check if a file exists. Returns true or false. ! """ ! import os ! try: ! os.stat(fname) ! return 1 ! except os.error, details: ! return 0 def IsPackageDir(path, packageName, knownFileName): ! """Given a path, a ni package name, and possibly a known file name in ! the root of the package, see if this path is good. ! """ ! import os ! if knownFileName is None: ! knownFileName = "." ! return FileExists(os.path.join(os.path.join(path, packageName),knownFileName)) def IsDebug(): """Return "_d" if we're running a debug version. ! This is to be used within DLL names when locating them. """ --- 6,30 ---- def FileExists(fname): ! """Check if a file exists. Returns true or false. ! """ ! import os ! try: ! os.stat(fname) ! return 1 ! except os.error, details: ! return 0 def IsPackageDir(path, packageName, knownFileName): ! """Given a path, a ni package name, and possibly a known file name in ! the root of the package, see if this path is good. ! """ ! import os ! if knownFileName is None: ! knownFileName = "." ! return FileExists(os.path.join(os.path.join(path, packageName),knownFileName)) def IsDebug(): """Return "_d" if we're running a debug version. ! This is to be used within DLL names when locating them. """ *************** *** 36,367 **** def FindPackagePath(packageName, knownFileName, searchPaths): ! """Find a package. ! Given a ni style package name, check the package is registered. ! First place looked is the registry for an existing entry. Then ! the searchPaths are searched. ! """ ! import regutil, os ! pathLook = regutil.GetRegisteredNamedPath(packageName) ! if pathLook and IsPackageDir(pathLook, packageName, knownFileName): ! return pathLook, None # The currently registered one is good. ! # Search down the search paths. ! for pathLook in searchPaths: ! if IsPackageDir(pathLook, packageName, knownFileName): ! # Found it ! ret = os.path.abspath(pathLook) ! return ret, ret ! raise error, "The package %s can not be located" % packageName def FindHelpPath(helpFile, helpDesc, searchPaths): ! # See if the current registry entry is OK ! import os, win32api, win32con ! try: ! key = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\Help", 0, win32con.KEY_ALL_ACCESS) ! try: ! try: ! path = win32api.RegQueryValueEx(key, helpDesc)[0] ! if FileExists(os.path.join(path, helpFile)): ! return os.path.abspath(path) ! except win32api.error: ! pass # no registry entry. ! finally: ! key.Close() ! except win32api.error: ! pass ! for pathLook in searchPaths: ! if FileExists(os.path.join(pathLook, helpFile)): ! return os.path.abspath(pathLook) ! pathLook = os.path.join(pathLook, "Help") ! if FileExists(os.path.join( pathLook, helpFile)): ! return os.path.abspath(pathLook) ! raise error, "The help file %s can not be located" % helpFile def FindAppPath(appName, knownFileName, searchPaths): ! """Find an application. ! First place looked is the registry for an existing entry. Then ! the searchPaths are searched. ! """ ! # Look in the first path. ! import regutil, string, os ! regPath = regutil.GetRegisteredNamedPath(appName) ! if regPath: ! pathLook = string.split(regPath,";")[0] ! if regPath and FileExists(os.path.join(pathLook, knownFileName)): ! return None # The currently registered one is good. ! # Search down the search paths. ! for pathLook in searchPaths: ! if FileExists(os.path.join(pathLook, knownFileName)): ! # Found it ! return os.path.abspath(pathLook) ! raise error, "The file %s can not be located for application %s" % (knownFileName, appName) def FindPythonExe(exeAlias, possibleRealNames, searchPaths): ! """Find an exe. ! Returns the full path to the .exe, and a boolean indicating if the current ! registered entry is OK. We don't trust the already registered version even ! if it exists - it may be wrong (ie, for a different Python version) ! """ ! import win32api, regutil, string, os, sys ! if possibleRealNames is None: ! possibleRealNames = exeAlias ! # Look first in Python's home. ! found = os.path.join(sys.prefix, possibleRealNames) ! if not FileExists(found): # for developers ! found = os.path.join(sys.prefix, "PCBuild", possibleRealNames) ! if not FileExists(found): ! found = LocateFileName(possibleRealNames, searchPaths) ! registered_ok = 0 ! try: ! registered = win32api.RegQueryValue(regutil.GetRootKey(), regutil.GetAppPathsKey() + "\\" + exeAlias) ! registered_ok = found==registered ! except win32api.error: ! pass ! return found, registered_ok def QuotedFileName(fname): ! """Given a filename, return a quoted version if necessary ! """ ! import regutil, string ! try: ! string.index(fname, " ") # Other chars forcing quote? ! return '"%s"' % fname ! except ValueError: ! # No space in name. ! return fname def LocateFileName(fileNamesString, searchPaths): ! """Locate a file name, anywhere on the search path. ! If the file can not be located, prompt the user to find it for us ! (using a common OpenFile dialog) ! Raises KeyboardInterrupt if the user cancels. ! """ ! import regutil, string, os ! fileNames = string.split(fileNamesString,";") ! for path in searchPaths: ! for fileName in fileNames: ! try: ! retPath = os.path.join(path, fileName) ! os.stat(retPath) ! break ! except os.error: ! retPath = None ! if retPath: ! break ! else: ! fileName = fileNames[0] ! try: ! import win32ui, win32con ! except ImportError: ! raise error, "Need to locate the file %s, but the win32ui module is not available\nPlease run the program again, passing as a parameter the path to this file." % fileName ! # Display a common dialog to locate the file. ! flags=win32con.OFN_FILEMUSTEXIST ! ext = os.path.splitext(fileName)[1] ! filter = "Files of requested type (*%s)|*%s||" % (ext,ext) ! dlg = win32ui.CreateFileDialog(1,None,fileName,flags,filter,None) ! dlg.SetOFNTitle("Locate " + fileName) ! if dlg.DoModal() <> win32con.IDOK: ! raise KeyboardInterrupt, "User cancelled the process" ! retPath = dlg.GetPathName() ! return os.path.abspath(retPath) def LocatePath(fileName, searchPaths): ! """Like LocateFileName, but returns a directory only. ! """ ! import os ! return os.path.abspath(os.path.split(LocateFileName(fileName, searchPaths))[0]) def LocateOptionalPath(fileName, searchPaths): ! """Like LocatePath, but returns None if the user cancels. ! """ ! try: ! return LocatePath(fileName, searchPaths) ! except KeyboardInterrupt: ! return None def LocateOptionalFileName(fileName, searchPaths = None): ! """Like LocateFileName, but returns None if the user cancels. ! """ ! try: ! return LocateFileName(fileName, searchPaths) ! except KeyboardInterrupt: ! return None def LocatePythonCore(searchPaths): ! """Locate and validate the core Python directories. Returns a list ! of paths that should be used as the core (ie, un-named) portion of ! the Python path. ! """ ! import string, os, regutil ! currentPath = regutil.GetRegisteredNamedPath(None) ! if currentPath: ! presearchPaths = string.split(currentPath, ";") ! else: ! presearchPaths = [os.path.abspath(".")] ! libPath = None ! for path in presearchPaths: ! if FileExists(os.path.join(path, "os.py")): ! libPath = path ! break ! if libPath is None and searchPaths is not None: ! libPath = LocatePath("os.py", searchPaths) ! if libPath is None: ! raise error, "The core Python library could not be located." ! corePath = None ! suffix = IsDebug() ! for path in presearchPaths: ! if FileExists(os.path.join(path, "unicodedata%s.pyd" % suffix)): ! corePath = path ! break ! if corePath is None and searchPaths is not None: ! corePath = LocatePath("unicodedata%s.pyd" % suffix, searchPaths) ! if corePath is None: ! raise error, "The core Python path could not be located." ! installPath = os.path.abspath(os.path.join(libPath, "..")) ! return installPath, [libPath, corePath] def FindRegisterPackage(packageName, knownFile, searchPaths, registryAppName = None): ! """Find and Register a package. ! Assumes the core registry setup correctly. ! In addition, if the location located by the package is already ! in the **core** path, then an entry is registered, but no path. ! (no other paths are checked, as the application whose path was used ! may later be uninstalled. This should not happen with the core) ! """ ! import regutil, string ! if not packageName: raise error, "A package name must be supplied" ! corePaths = string.split(regutil.GetRegisteredNamedPath(None),";") ! if not searchPaths: searchPaths = corePaths ! registryAppName = registryAppName or packageName ! try: ! pathLook, pathAdd = FindPackagePath(packageName, knownFile, searchPaths) ! if pathAdd is not None: ! if pathAdd in corePaths: ! pathAdd = "" ! regutil.RegisterNamedPath(registryAppName, pathAdd) ! return pathLook ! except error, details: ! print "*** The %s package could not be registered - %s" % (packageName, details) ! print "*** Please ensure you have passed the correct paths on the command line." ! print "*** - For packages, you should pass a path to the packages parent directory," ! print "*** - and not the package directory itself..." def FindRegisterApp(appName, knownFiles, searchPaths): ! """Find and Register a package. ! Assumes the core registry setup correctly. ! """ ! import regutil, string ! if type(knownFiles)==type(''): ! knownFiles = [knownFiles] ! paths=[] ! try: ! for knownFile in knownFiles: ! pathLook = FindAppPath(appName, knownFile, searchPaths) ! if pathLook: ! paths.append(pathLook) ! except error, details: ! print "*** ", details ! return ! regutil.RegisterNamedPath(appName, string.join(paths,";")) def FindRegisterPythonExe(exeAlias, searchPaths, actualFileNames = None): ! """Find and Register a Python exe (not necessarily *the* python.exe) ! Assumes the core registry setup correctly. ! """ ! import regutil, string ! fname, ok = FindPythonExe(exeAlias, actualFileNames, searchPaths) ! if not ok: ! regutil.RegisterPythonExe(fname, exeAlias) ! return fname def FindRegisterHelpFile(helpFile, searchPaths, helpDesc = None ): ! import regutil ! ! try: ! pathLook = FindHelpPath(helpFile, helpDesc, searchPaths) ! except error, details: ! print "*** ", details ! return ! # print "%s found at %s" % (helpFile, pathLook) ! regutil.RegisterHelpFile(helpFile, pathLook, helpDesc) ! def SetupCore(searchPaths): ! """Setup the core Python information in the registry. ! This function makes no assumptions about the current state of sys.path. ! After this function has completed, you should have access to the standard ! Python library, and the standard Win32 extensions ! """ ! import sys ! for path in searchPaths: ! sys.path.append(path) ! import string, os ! import regutil, win32api,win32con ! ! installPath, corePaths = LocatePythonCore(searchPaths) ! # Register the core Pythonpath. ! print corePaths ! regutil.RegisterNamedPath(None, string.join(corePaths,";")) ! # Register the install path. ! hKey = win32api.RegCreateKey(regutil.GetRootKey() , regutil.BuildDefaultPythonKey()) ! try: ! # Core Paths. ! win32api.RegSetValue(hKey, "InstallPath", win32con.REG_SZ, installPath) ! finally: ! win32api.RegCloseKey(hKey) ! # Register the win32 core paths. ! win32paths = os.path.abspath( os.path.split(win32api.__file__)[0]) + ";" + \ ! os.path.abspath( os.path.split(LocateFileName("win32con.py;win32con.pyc", sys.path ) )[0] ) ! # Python has builtin support for finding a "DLLs" directory, but ! # not a PCBuild. Having it in the core paths means it is ignored when ! # an EXE not in the Python dir is hosting us - so we add it as a named ! # value ! check = os.path.join(sys.prefix, "PCBuild") ! if os.path.isdir(check): ! regutil.RegisterNamedPath("PCBuild",check) def RegisterShellInfo(searchPaths): ! """Registers key parts of the Python installation with the Windows Shell. ! Assumes a valid, minimal Python installation exists ! (ie, SetupCore() has been previously successfully run) ! """ ! import regutil, win32con ! suffix = IsDebug() ! # Set up a pointer to the .exe's ! exePath = FindRegisterPythonExe("Python%s.exe" % suffix, searchPaths) ! regutil.SetRegistryDefaultValue(".py", "Python.File", win32con.HKEY_CLASSES_ROOT) ! regutil.RegisterShellCommand("Open", QuotedFileName(exePath)+" \"%1\" %*", "&Run") ! regutil.SetRegistryDefaultValue("Python.File\\DefaultIcon", "%s,0" % exePath, win32con.HKEY_CLASSES_ROOT) ! ! FindRegisterHelpFile("Python.hlp", searchPaths, "Main Python Documentation") ! FindRegisterHelpFile("ActivePython.chm", searchPaths, "Main Python Documentation") ! # We consider the win32 core, as it contains all the win32 api type ! # stuff we need. ! # FindRegisterApp("win32", ["win32con.pyc", "win32api%s.pyd" % suffix], searchPaths) usage = """\ --- 36,367 ---- def FindPackagePath(packageName, knownFileName, searchPaths): ! """Find a package. ! Given a ni style package name, check the package is registered. ! First place looked is the registry for an existing entry. Then ! the searchPaths are searched. ! """ ! import regutil, os ! pathLook = regutil.GetRegisteredNamedPath(packageName) ! if pathLook and IsPackageDir(pathLook, packageName, knownFileName): ! return pathLook, None # The currently registered one is good. ! # Search down the search paths. ! for pathLook in searchPaths: ! if IsPackageDir(pathLook, packageName, knownFileName): ! # Found it ! ret = os.path.abspath(pathLook) ! return ret, ret ! raise error, "The package %s can not be located" % packageName def FindHelpPath(helpFile, helpDesc, searchPaths): ! # See if the current registry entry is OK ! import os, win32api, win32con ! try: ! key = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\Help", 0, win32con.KEY_ALL_ACCESS) ! try: ! try: ! path = win32api.RegQueryValueEx(key, helpDesc)[0] ! if FileExists(os.path.join(path, helpFile)): ! return os.path.abspath(path) ! except win32api.error: ! pass # no registry entry. ! finally: ! key.Close() ! except win32api.error: ! pass ! for pathLook in searchPaths: ! if FileExists(os.path.join(pathLook, helpFile)): ! return os.path.abspath(pathLook) ! pathLook = os.path.join(pathLook, "Help") ! if FileExists(os.path.join( pathLook, helpFile)): ! return os.path.abspath(pathLook) ! raise error, "The help file %s can not be located" % helpFile def FindAppPath(appName, knownFileName, searchPaths): ! """Find an application. ! First place looked is the registry for an existing entry. Then ! the searchPaths are searched. ! """ ! # Look in the first path. ! import regutil, string, os ! regPath = regutil.GetRegisteredNamedPath(appName) ! if regPath: ! pathLook = string.split(regPath,";")[0] ! if regPath and FileExists(os.path.join(pathLook, knownFileName)): ! return None # The currently registered one is good. ! # Search down the search paths. ! for pathLook in searchPaths: ! if FileExists(os.path.join(pathLook, knownFileName)): ! # Found it ! return os.path.abspath(pathLook) ! raise error, "The file %s can not be located for application %s" % (knownFileName, appName) def FindPythonExe(exeAlias, possibleRealNames, searchPaths): ! """Find an exe. ! Returns the full path to the .exe, and a boolean indicating if the current ! registered entry is OK. We don't trust the already registered version even ! if it exists - it may be wrong (ie, for a different Python version) ! """ ! import win32api, regutil, string, os, sys ! if possibleRealNames is None: ! possibleRealNames = exeAlias ! # Look first in Python's home. ! found = os.path.join(sys.prefix, possibleRealNames) ! if not FileExists(found): # for developers ! found = os.path.join(sys.prefix, "PCBuild", possibleRealNames) ! if not FileExists(found): ! found = LocateFileName(possibleRealNames, searchPaths) ! registered_ok = 0 ! try: ! registered = win32api.RegQueryValue(regutil.GetRootKey(), regutil.GetAppPathsKey() + "\\" + exeAlias) ! registered_ok = found==registered ! except win32api.error: ! pass ! return found, registered_ok def QuotedFileName(fname): ! """Given a filename, return a quoted version if necessary ! """ ! import regutil, string ! try: ! string.index(fname, " ") # Other chars forcing quote? ! return '"%s"' % fname ! except ValueError: ! # No space in name. ! return fname def LocateFileName(fileNamesString, searchPaths): ! """Locate a file name, anywhere on the search path. ! If the file can not be located, prompt the user to find it for us ! (using a common OpenFile dialog) ! Raises KeyboardInterrupt if the user cancels. ! """ ! import regutil, string, os ! fileNames = string.split(fileNamesString,";") ! for path in searchPaths: ! for fileName in fileNames: ! try: ! retPath = os.path.join(path, fileName) ! os.stat(retPath) ! break ! except os.error: ! retPath = None ! if retPath: ! break ! else: ! fileName = fileNames[0] ! try: ! import win32ui, win32con ! except ImportError: ! raise error, "Need to locate the file %s, but the win32ui module is not available\nPlease run the program again, passing as a parameter the path to this file." % fileName ! # Display a common dialog to locate the file. ! flags=win32con.OFN_FILEMUSTEXIST ! ext = os.path.splitext(fileName)[1] ! filter = "Files of requested type (*%s)|*%s||" % (ext,ext) ! dlg = win32ui.CreateFileDialog(1,None,fileName,flags,filter,None) ! dlg.SetOFNTitle("Locate " + fileName) ! if dlg.DoModal() <> win32con.IDOK: ! raise KeyboardInterrupt, "User cancelled the process" ! retPath = dlg.GetPathName() ! return os.path.abspath(retPath) def LocatePath(fileName, searchPaths): ! """Like LocateFileName, but returns a directory only. ! """ ! import os ! return os.path.abspath(os.path.split(LocateFileName(fileName, searchPaths))[0]) def LocateOptionalPath(fileName, searchPaths): ! """Like LocatePath, but returns None if the user cancels. ! """ ! try: ! return LocatePath(fileName, searchPaths) ! except KeyboardInterrupt: ! return None def LocateOptionalFileName(fileName, searchPaths = None): ! """Like LocateFileName, but returns None if the user cancels. ! """ ! try: ! return LocateFileName(fileName, searchPaths) ! except KeyboardInterrupt: ! return None def LocatePythonCore(searchPaths): ! """Locate and validate the core Python directories. Returns a list ! of paths that should be used as the core (ie, un-named) portion of ! the Python path. ! """ ! import string, os, regutil ! currentPath = regutil.GetRegisteredNamedPath(None) ! if currentPath: ! presearchPaths = string.split(currentPath, ";") ! else: ! presearchPaths = [os.path.abspath(".")] ! libPath = None ! for path in presearchPaths: ! if FileExists(os.path.join(path, "os.py")): ! libPath = path ! break ! if libPath is None and searchPaths is not None: ! libPath = LocatePath("os.py", searchPaths) ! if libPath is None: ! raise error, "The core Python library could not be located." ! corePath = None ! suffix = IsDebug() ! for path in presearchPaths: ! if FileExists(os.path.join(path, "unicodedata%s.pyd" % suffix)): ! corePath = path ! break ! if corePath is None and searchPaths is not None: ! corePath = LocatePath("unicodedata%s.pyd" % suffix, searchPaths) ! if corePath is None: ! raise error, "The core Python path could not be located." ! installPath = os.path.abspath(os.path.join(libPath, "..")) ! return installPath, [libPath, corePath] def FindRegisterPackage(packageName, knownFile, searchPaths, registryAppName = None): ! """Find and Register a package. ! Assumes the core registry setup correctly. ! In addition, if the location located by the package is already ! in the **core** path, then an entry is registered, but no path. ! (no other paths are checked, as the application whose path was used ! may later be uninstalled. This should not happen with the core) ! """ ! import regutil, string ! if not packageName: raise error, "A package name must be supplied" ! corePaths = string.split(regutil.GetRegisteredNamedPath(None),";") ! if not searchPaths: searchPaths = corePaths ! registryAppName = registryAppName or packageName ! try: ! pathLook, pathAdd = FindPackagePath(packageName, knownFile, searchPaths) ! if pathAdd is not None: ! if pathAdd in corePaths: ! pathAdd = "" ! regutil.RegisterNamedPath(registryAppName, pathAdd) ! return pathLook ! except error, details: ! print "*** The %s package could not be registered - %s" % (packageName, details) ! print "*** Please ensure you have passed the correct paths on the command line." ! print "*** - For packages, you should pass a path to the packages parent directory," ! print "*** - and not the package directory itself..." def FindRegisterApp(appName, knownFiles, searchPaths): ! """Find and Register a package. ! Assumes the core registry setup correctly. ! """ ! import regutil, string ! if type(knownFiles)==type(''): ! knownFiles = [knownFiles] ! paths=[] ! try: ! for knownFile in knownFiles: ! pathLook = FindAppPath(appName, knownFile, searchPaths) ! if pathLook: ! paths.append(pathLook) ! except error, details: ! print "*** ", details ! return ! regutil.RegisterNamedPath(appName, string.join(paths,";")) def FindRegisterPythonExe(exeAlias, searchPaths, actualFileNames = None): ! """Find and Register a Python exe (not necessarily *the* python.exe) ! Assumes the core registry setup correctly. ! """ ! import regutil, string ! fname, ok = FindPythonExe(exeAlias, actualFileNames, searchPaths) ! if not ok: ! regutil.RegisterPythonExe(fname, exeAlias) ! return fname def FindRegisterHelpFile(helpFile, searchPaths, helpDesc = None ): ! import regutil ! ! try: ! pathLook = FindHelpPath(helpFile, helpDesc, searchPaths) ! except error, details: ! print "*** ", details ! return ! # print "%s found at %s" % (helpFile, pathLook) ! regutil.RegisterHelpFile(helpFile, pathLook, helpDesc) ! def SetupCore(searchPaths): ! """Setup the core Python information in the registry. ! This function makes no assumptions about the current state of sys.path. ! After this function has completed, you should have access to the standard ! Python library, and the standard Win32 extensions ! """ ! import sys ! for path in searchPaths: ! sys.path.append(path) ! import string, os ! import regutil, win32api,win32con ! installPath, corePaths = LocatePythonCore(searchPaths) ! # Register the core Pythonpath. ! print corePaths ! regutil.RegisterNamedPath(None, string.join(corePaths,";")) ! # Register the install path. ! hKey = win32api.RegCreateKey(regutil.GetRootKey() , regutil.BuildDefaultPythonKey()) ! try: ! # Core Paths. ! win32api.RegSetValue(hKey, "InstallPath", win32con.REG_SZ, installPath) ! finally: ! win32api.RegCloseKey(hKey) ! # Register the win32 core paths. ! win32paths = os.path.abspath( os.path.split(win32api.__file__)[0]) + ";" + \ ! os.path.abspath( os.path.split(LocateFileName("win32con.py;win32con.pyc", sys.path ) )[0] ) ! ! # Python has builtin support for finding a "DLLs" directory, but ! # not a PCBuild. Having it in the core paths means it is ignored when ! # an EXE not in the Python dir is hosting us - so we add it as a named ! # value ! check = os.path.join(sys.prefix, "PCBuild") ! if os.path.isdir(check): ! regutil.RegisterNamedPath("PCBuild",check) def RegisterShellInfo(searchPaths): ! """Registers key parts of the Python installation with the Windows Shell. ! Assumes a valid, minimal Python installation exists ! (ie, SetupCore() has been previously successfully run) ! """ ! import regutil, win32con ! suffix = IsDebug() ! # Set up a pointer to the .exe's ! exePath = FindRegisterPythonExe("Python%s.exe" % suffix, searchPaths) ! regutil.SetRegistryDefaultValue(".py", "Python.File", win32con.HKEY_CLASSES_ROOT) ! regutil.RegisterShellCommand("Open", QuotedFileName(exePath)+" \"%1\" %*", "&Run") ! regutil.SetRegistryDefaultValue("Python.File\\DefaultIcon", "%s,0" % exePath, win32con.HKEY_CLASSES_ROOT) ! FindRegisterHelpFile("Python.hlp", searchPaths, "Main Python Documentation") ! FindRegisterHelpFile("ActivePython.chm", searchPaths, "Main Python Documentation") ! ! # We consider the win32 core, as it contains all the win32 api type ! # stuff we need. ! # FindRegisterApp("win32", ["win32con.pyc", "win32api%s.pyd" % suffix], searchPaths) usage = """\ *************** *** 379,386 **** paths specified are added to the registry. -c -- Add the specified paths to the core Pythonpath. ! If a path appears on the core path, and a package also ! needs that same path, the package will not bother ! registering it. Therefore, By adding paths to the ! core path, you can avoid packages re-registering the same path. -m filename -- Find and register the specific file name as a module. Do not include a path on the filename! --- 379,386 ---- paths specified are added to the registry. -c -- Add the specified paths to the core Pythonpath. ! If a path appears on the core path, and a package also ! needs that same path, the package will not bother ! registering it. Therefore, By adding paths to the ! core path, you can avoid packages re-registering the same path. -m filename -- Find and register the specific file name as a module. Do not include a path on the filename! *************** *** 395,404 **** description="""\ ! If no options are processed, the program attempts to validate and set the standard Python path to the point where the standard library is available. This can be handy if you move Python to a new drive/sub-directory, in which case most of the options would fail (as they need at least string.py, os.py etc to function.) ! Running without options should repair Python well enough to run with the other options. --- 395,404 ---- description="""\ ! If no options are processed, the program attempts to validate and set the standard Python path to the point where the standard library is available. This can be handy if you move Python to a new drive/sub-directory, in which case most of the options would fail (as they need at least string.py, os.py etc to function.) ! Running without options should repair Python well enough to run with the other options. *************** *** 438,510 **** if __name__=='__main__': ! if len(sys.argv)>1 and sys.argv[1] in ['/?','-?','-help','-h']: ! print usage ! elif len(sys.argv)==1 or not sys.argv[1][0] in ['/','-']: ! # No args, or useful args. ! searchPath = sys.path[:] ! for arg in sys.argv[1:]: ! searchPath.append(arg) ! # Good chance we are being run from the "regsetup.py" directory. ! # Typically this will be "\somewhere\win32\Scripts" and the ! # "somewhere" and "..\Lib" should also be searched. ! searchPath.append("..\\Build") ! searchPath.append("..\\Lib") ! searchPath.append("..") ! searchPath.append("..\\..") ! # for developers: ! # also search somewhere\lib, ..\build, and ..\..\build ! searchPath.append("..\\..\\lib") ! searchPath.append("..\\build") ! searchPath.append("..\\..\\pcbuild") ! print "Attempting to setup/repair the Python core" ! SetupCore(searchPath) ! RegisterShellInfo(searchPath) ! FindRegisterHelpFile("PyWin32.chm", searchPath, "Pythonwin Reference") ! # Check the registry. ! print "Registration complete - checking the registry..." ! import regcheck ! regcheck.CheckRegistry() ! else: ! searchPaths = [] ! import getopt, string ! opts, args = getopt.getopt(sys.argv[1:], 'p:a:m:c', ! ['shell','upackage=','uapp=','umodule=','description','examples']) ! for arg in args: ! searchPaths.append(arg) ! for o,a in opts: ! if o=='--description': ! print description ! if o=='--examples': ! print examples ! if o=='--shell': ! print "Registering the Python core." ! RegisterShellInfo(searchPaths) ! if o=='-p': ! print "Registering package", a ! FindRegisterPackage(a,None,searchPaths) ! if o in ['--upackage', '--uapp']: ! import regutil ! print "Unregistering application/package", a ! regutil.UnregisterNamedPath(a) ! if o=='-a': ! import regutil ! path = string.join(searchPaths,";") ! print "Registering application", a,"to path",path ! regutil.RegisterNamedPath(a,path) ! if o=='-c': ! if not len(searchPaths): ! raise error, "-c option must provide at least one additional path" ! import win32api, regutil ! currentPaths = string.split(regutil.GetRegisteredNamedPath(None),";") ! oldLen = len(currentPaths) ! for newPath in searchPaths: ! if newPath not in currentPaths: ! currentPaths.append(newPath) ! if len(currentPaths)<>oldLen: ! print "Registering %d new core paths" % (len(currentPaths)-oldLen) ! regutil.RegisterNamedPath(None,string.join(currentPaths,";")) ! else: ! print "All specified paths are already registered." --- 438,510 ---- if __name__=='__main__': ! if len(sys.argv)>1 and sys.argv[1] in ['/?','-?','-help','-h']: ! print usage ! elif len(sys.argv)==1 or not sys.argv[1][0] in ['/','-']: ! # No args, or useful args. ! searchPath = sys.path[:] ! for arg in sys.argv[1:]: ! searchPath.append(arg) ! # Good chance we are being run from the "regsetup.py" directory. ! # Typically this will be "\somewhere\win32\Scripts" and the ! # "somewhere" and "..\Lib" should also be searched. ! searchPath.append("..\\Build") ! searchPath.append("..\\Lib") ! searchPath.append("..") ! searchPath.append("..\\..") ! # for developers: ! # also search somewhere\lib, ..\build, and ..\..\build ! searchPath.append("..\\..\\lib") ! searchPath.append("..\\build") ! searchPath.append("..\\..\\pcbuild") ! print "Attempting to setup/repair the Python core" ! SetupCore(searchPath) ! RegisterShellInfo(searchPath) ! FindRegisterHelpFile("PyWin32.chm", searchPath, "Pythonwin Reference") ! # Check the registry. ! print "Registration complete - checking the registry..." ! import regcheck ! regcheck.CheckRegistry() ! else: ! searchPaths = [] ! import getopt, string ! opts, args = getopt.getopt(sys.argv[1:], 'p:a:m:c', ! ['shell','upackage=','uapp=','umodule=','description','examples']) ! for arg in args: ! searchPaths.append(arg) ! for o,a in opts: ! if o=='--description': ! print description ! if o=='--examples': ! print examples ! if o=='--shell': ! print "Registering the Python core." ! RegisterShellInfo(searchPaths) ! if o=='-p': ! print "Registering package", a ! FindRegisterPackage(a,None,searchPaths) ! if o in ['--upackage', '--uapp']: ! import regutil ! print "Unregistering application/package", a ! regutil.UnregisterNamedPath(a) ! if o=='-a': ! import regutil ! path = string.join(searchPaths,";") ! print "Registering application", a,"to path",path ! regutil.RegisterNamedPath(a,path) ! if o=='-c': ! if not len(searchPaths): ! raise error, "-c option must provide at least one additional path" ! import win32api, regutil ! currentPaths = string.split(regutil.GetRegisteredNamedPath(None),";") ! oldLen = len(currentPaths) ! for newPath in searchPaths: ! if newPath not in currentPaths: ! currentPaths.append(newPath) ! if len(currentPaths)<>oldLen: ! print "Registering %d new core paths" % (len(currentPaths)-oldLen) ! regutil.RegisterNamedPath(None,string.join(currentPaths,";")) ! else: ! print "All specified paths are already registered." |
From: Mark H. <mha...@us...> - 2005-10-23 12:25:53
|
Update of /cvsroot/pywin32/pywin32/win32/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10313/win32/scripts Modified Files: regsetup.py Log Message: Bring these ancient and semi-useless registry utilities somewhat up to date Index: regsetup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/scripts/regsetup.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** regsetup.py 13 Feb 2005 12:16:17 -0000 1.12 --- regsetup.py 23 Oct 2005 12:25:44 -0000 1.13 *************** *** 25,36 **** def IsDebug(): ! """Return "_d" if we're running a debug version. ! ! This is to be used within DLL names when locating them. ! """ ! import parser # This comes as a .pyd with most versions. ! if parser.__file__[-6:] == '_d.pyd': ! return '_d' ! return '' def FindPackagePath(packageName, knownFileName, searchPaths): --- 25,37 ---- def IsDebug(): ! """Return "_d" if we're running a debug version. ! ! This is to be used within DLL names when locating them. ! """ ! import imp ! for suffix_item in imp.get_suffixes(): ! if suffix_item[0]=='_d.pyd': ! return '_d' ! return '' def FindPackagePath(packageName, knownFileName, searchPaths): *************** *** 218,226 **** suffix = IsDebug() for path in presearchPaths: ! if FileExists(os.path.join(path, "parser%s.pyd" % suffix)): corePath = path break if corePath is None and searchPaths is not None: ! corePath = LocatePath("parser%s.pyd" % suffix, searchPaths) if corePath is None: raise error, "The core Python path could not be located." --- 219,227 ---- suffix = IsDebug() for path in presearchPaths: ! if FileExists(os.path.join(path, "unicodedata%s.pyd" % suffix)): corePath = path break if corePath is None and searchPaths is not None: ! corePath = LocatePath("unicodedata%s.pyd" % suffix, searchPaths) if corePath is None: raise error, "The core Python path could not be located." *************** *** 330,338 **** finally: win32api.RegCloseKey(hKey) - # The core DLL. - # regutil.RegisterCoreDLL() - - # Register the win32 extensions, as some of them are pretty much core! - # Why doesnt win32con.__file__ give me a path? (ahh - because only the .pyc exists?) # Register the win32 core paths. --- 331,334 ---- *************** *** 340,348 **** os.path.abspath( os.path.split(LocateFileName("win32con.py;win32con.pyc", sys.path ) )[0] ) ! suffix = IsDebug() ! ver_str = hex(sys.hexversion)[2] + hex(sys.hexversion)[4] ! # pywintypes now has a .py stub ! regutil.RegisterNamedPath("win32",win32paths) ! def RegisterShellInfo(searchPaths): --- 336,346 ---- os.path.abspath( os.path.split(LocateFileName("win32con.py;win32con.pyc", sys.path ) )[0] ) ! # Python has builtin support for finding a "DLLs" directory, but ! # not a PCBuild. Having it in the core paths means it is ignored when ! # an EXE not in the Python dir is hosting us - so we add it as a named ! # value ! check = os.path.join(sys.prefix, "PCBuild") ! if os.path.isdir(check): ! regutil.RegisterNamedPath("PCBuild",check) def RegisterShellInfo(searchPaths): *************** *** 367,421 **** # FindRegisterApp("win32", ["win32con.pyc", "win32api%s.pyd" % suffix], searchPaths) - def RegisterPythonwin(searchPaths): - """Knows how to register Pythonwin components - """ - import regutil - suffix = IsDebug() - # FindRegisterApp("Pythonwin", "docview.py", searchPaths) - - FindRegisterHelpFile("PyWin32.chm", searchPaths, "Pythonwin Reference") - - FindRegisterPythonExe("pythonwin%s.exe" % suffix, searchPaths, "Pythonwin%s.exe" % suffix) - - fnamePythonwin = regutil.GetRegisteredExe("Pythonwin%s.exe" % suffix) - fnamePython = regutil.GetRegisteredExe("Python%s.exe" % suffix) - - regutil.RegisterShellCommand("Edit", QuotedFileName(fnamePythonwin)+" /edit \"%1\"") - regutil.RegisterDDECommand("Edit", "Pythonwin", "System", '[self.OpenDocumentFile(r"%1")]') - - FindRegisterPackage("pywin", "__init__.py", searchPaths, "Pythonwin") - - regutil.RegisterFileExtensions(defPyIcon=fnamePythonwin+",0", - defPycIcon = fnamePythonwin+",5", - runCommand = QuotedFileName(fnamePython)+" \"%1\" %*") - - def UnregisterPythonwin(): - """Knows how to unregister Pythonwin components - """ - import regutil - regutil.UnregisterNamedPath("Pythonwin") - regutil.UnregisterHelpFile("Pythonwin.hlp") - regutil.UnregisterHelpFile("PyWin32.chm") - - suffix = IsDebug() - regutil.UnregisterPythonExe("pythonwin%s.exe" % suffix) - - #regutil.UnregisterShellCommand("Edit") - - regutil.UnregisterModule("win32ui") - regutil.UnregisterModule("win32uiole") - - - def RegisterWin32com(searchPaths): - """Knows how to register win32com components - """ - import win32api - # import ni,win32dbg;win32dbg.brk() - corePath = FindRegisterPackage("win32com", "olectl.py", searchPaths) - if corePath: - FindRegisterHelpFile("PyWin32.chm", searchPaths + [corePath+"\\win32com"], "Python COM Reference") - suffix = IsDebug() - ver_str = hex(sys.hexversion)[2] + hex(sys.hexversion)[4] - usage = """\ regsetup.py - Setup/maintain the registry for Python apps. --- 365,368 ---- *************** *** 439,445 **** Do not include a path on the filename! --shell -- Register everything with the Win95/NT shell. - --pythonwin -- Find and register all Pythonwin components. - --unpythonwin -- Unregister Pythonwin - --win32com -- Find and register all win32com components --upackage name -- Unregister the package --uapp name -- Unregister the app (identical to --upackage) --- 386,389 ---- *************** *** 462,467 **** For example, when registering the core Python, you may wish to provide paths to non-standard places to look for the Python help files, ! library files, etc. When registering win32com, you should pass paths ! specific to win32com. See also the "regcheck.py" utility which will check and dump the contents --- 406,410 ---- For example, when registering the core Python, you may wish to provide paths to non-standard places to look for the Python help files, ! library files, etc. See also the "regcheck.py" utility which will check and dump the contents *************** *** 476,485 **** python14.dll, the standard library and Win32 Extensions. - "regsetup --win32com" - Attempts to register win32com. No options are passed, so this is only - likely to succeed if win32com is already successfully registered, or the - win32com directory is current. If neither of these are true, you should pass - the path to the win32com directory. - "regsetup -a myappname . .\subdir" Registers a new Pythonpath entry named myappname, with "C:\\I\\AM\\HERE" and --- 419,422 ---- *************** *** 523,529 **** print "Attempting to setup/repair the Python core" ! SetupCore(searchPath) ! RegisterShellInfo(searchPath) # Check the registry. print "Registration complete - checking the registry..." --- 460,467 ---- print "Attempting to setup/repair the Python core" ! SetupCore(searchPath) ! RegisterShellInfo(searchPath) ! FindRegisterHelpFile("PyWin32.chm", searchPath, "Pythonwin Reference") # Check the registry. print "Registration complete - checking the registry..." *************** *** 534,538 **** import getopt, string opts, args = getopt.getopt(sys.argv[1:], 'p:a:m:c', ! ['pythonwin','unpythonwin','win32com','shell','upackage=','uapp=','umodule=','description','examples']) for arg in args: searchPaths.append(arg) --- 472,476 ---- import getopt, string opts, args = getopt.getopt(sys.argv[1:], 'p:a:m:c', ! ['shell','upackage=','uapp=','umodule=','description','examples']) for arg in args: searchPaths.append(arg) *************** *** 545,557 **** print "Registering the Python core." RegisterShellInfo(searchPaths) - if o=='--pythonwin': - print "Registering Pythonwin" - RegisterPythonwin(searchPaths) - if o=='--win32com': - print "Registering win32com" - RegisterWin32com(searchPaths) - if o=='--unpythonwin': - print "Unregistering Pythonwin" - UnregisterPythonwin() if o=='-p': print "Registering package", a --- 483,486 ---- |
From: Mark H. <mha...@us...> - 2005-10-23 12:25:53
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10313/win32/Lib Modified Files: regcheck.py Log Message: Bring these ancient and semi-useless registry utilities somewhat up to date Index: regcheck.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/regcheck.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** regcheck.py 8 Jan 2002 05:41:13 -0000 1.3 --- regcheck.py 23 Oct 2005 12:25:44 -0000 1.4 *************** *** 87,95 **** win32api.RegCloseKey(key) ! def ChcekRegisteredModules(verbose): # Check out all registered modules. k=regutil.BuildDefaultPythonKey() + "\\Modules" try: keyhandle = win32api.RegOpenKey(regutil.GetRootKey(), k) except win32api.error, (code, fn, details): import winerror --- 87,96 ---- win32api.RegCloseKey(key) ! def CheckRegisteredModules(verbose): # Check out all registered modules. k=regutil.BuildDefaultPythonKey() + "\\Modules" try: keyhandle = win32api.RegOpenKey(regutil.GetRootKey(), k) + print "WARNING: 'Modules' registry entry is deprectated and evil!" except win32api.error, (code, fn, details): import winerror *************** *** 97,121 **** raise win32api.error, (code, fn, details) return - try: - if verbose: print "Registered Modules:" - num = 0 - while 1: - try: - key = win32api.RegEnumKey(keyhandle, num) - except win32api.error: - break; - num = num+1 - value = win32api.RegQueryValue(keyhandle, key) - if verbose: print "\t%s:" % key, - try: - os.stat(value) - if verbose: print value - except os.error: - if not verbose: - print "Error is registered module %s" % value, - print "** Not found at %s" % value - finally: - win32api.RegCloseKey(keyhandle) - def CheckRegistry(verbose=0): --- 98,101 ---- *************** *** 127,133 **** CheckPythonPaths(verbose) CheckHelpFiles(verbose) ! ChcekRegisteredModules(verbose) CheckRegisteredExe("Python.exe") - CheckRegisteredExe("Pythonwin.exe") if __name__=='__main__': --- 107,112 ---- CheckPythonPaths(verbose) CheckHelpFiles(verbose) ! CheckRegisteredModules(verbose) CheckRegisteredExe("Python.exe") if __name__=='__main__': |
From: Mark H. <mha...@us...> - 2005-10-23 11:34:08
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv707/win32/src Modified Files: win32consolemodule.cpp win32crypt.i Log Message: Get things building with the various Python versions we support. Index: win32consolemodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32consolemodule.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** win32consolemodule.cpp 30 Sep 2005 01:46:42 -0000 1.7 --- win32consolemodule.cpp 23 Oct 2005 11:33:52 -0000 1.8 *************** *** 556,560 **** --- 556,564 ---- return -1; } + #if (PY_VERSION_HEX < 0x02030000) + *dest_ptr=PyLong_AsUnsignedLong(obvalue); + #else *dest_ptr=PyInt_AsUnsignedLongMask(obvalue); + #endif if ((*dest_ptr==(DWORD)-1) && PyErr_Occurred()) return -1; Index: win32crypt.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32crypt.i,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32crypt.i 4 Jul 2005 05:40:29 -0000 1.1 --- win32crypt.i 23 Oct 2005 11:33:52 -0000 1.2 *************** *** 8,11 **** --- 8,12 ---- #include "PyWinTypes.h" #include "malloc.h" + #include "abstract.h" // for PyObject_AsReadBuffer %} *************** *** 19,26 **** BOOL PyWinObject_AsDATA_BLOB(PyObject *ob, DATA_BLOB *b) { - PyAPI_FUNC(int) PyObject_AsReadBuffer(PyObject *obj, - const void **buffer, - int *buffer_len); - return PyObject_AsReadBuffer(ob, (const void **)(&b->pbData), (int *)(&b->cbData))==0; } --- 20,23 ---- |
From: Mark H. <mha...@us...> - 2005-10-23 11:34:02
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv707/com/win32com/src Modified Files: PyComHelpers.cpp Log Message: Get things building with the various Python versions we support. Index: PyComHelpers.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyComHelpers.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PyComHelpers.cpp 31 May 2005 12:36:02 -0000 1.9 --- PyComHelpers.cpp 23 Oct 2005 11:33:52 -0000 1.10 *************** *** 86,92 **** --- 86,94 ---- use_decimal=PyObject_IsTrue(__future_currency__); if (!use_decimal && !warned_future_currency) { + #if (PY_VERSION_HEX >= 0x02030000) PyErr_Warn(PyExc_FutureWarning, "Currency objects will soon be changed so a decimal.Decimal instance is used." "\n (set pythoncom.__future_currency__ to get these objects now.)"); + #endif warned_future_currency = TRUE; } |
From: Mark H. <mha...@us...> - 2005-10-23 11:34:02
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv707 Modified Files: setup.py Log Message: Get things building with the various Python versions we support. Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** setup.py 22 Oct 2005 01:41:26 -0000 1.24 --- setup.py 23 Oct 2005 11:33:52 -0000 1.25 *************** *** 58,62 **** import _winreg ! pywin32_version='.'.join(sys.version.split('.')[:2])+'.'+build_id print "Building pywin32", pywin32_version --- 58,62 ---- import _winreg ! pywin32_version="%d.%d.%s" % (sys.version_info[0], sys.version_info[1], build_id) print "Building pywin32", pywin32_version *************** *** 350,354 **** ver_fname = os.path.join(os.environ['temp'], "pywin32.version.txt") try: ! f = open(ver_fname, "wU") f.write("%s\n" % build_id) f.close() --- 350,354 ---- ver_fname = os.path.join(os.environ['temp'], "pywin32.version.txt") try: ! f = open(ver_fname, "U") f.write("%s\n" % build_id) f.close() *************** *** 419,423 **** % (ext.windows_h_version, self.windows_h_version) ! look_dirs = self.include_dirs + self.compiler.get_msvc_paths("include") for h in ext.optional_headers: for d in look_dirs: --- 419,428 ---- % (ext.windows_h_version, self.windows_h_version) ! try: ! get_msvc_paths = self.compiler.get_msvc_paths ! except AttributeError: ! # module method in early Python versions ! get_msvc_paths = msvccompiler.get_msvc_paths ! look_dirs = self.include_dirs + get_msvc_paths("include") for h in ext.optional_headers: for d in look_dirs: *************** *** 892,915 **** # Here seems a good place to stamp the version of the built # target. - import optparse try: import win32verstamp except ImportError: log.info('Unable to import verstamp, no version info will be added') else: ! v=optparse.Values() ! v.ensure_value('version',pywin32_version) ! v.ensure_value('comments',"http://pywin32.sourceforge.net") ! v.ensure_value('company',None) ! v.ensure_value('description',None) ! v.ensure_value('internal_name',None) ! v.ensure_value('copyright',None) ! v.ensure_value('trademarks',None) ! v.ensure_value('original_filename',os.path.basename(output_filename)) ! v.ensure_value('product','Pywin32') ! v.ensure_value('dll',None) ! v.ensure_value('debug',None) ! v.ensure_value('verbose','-v' in sys.argv) ! win32verstamp.stamp(output_filename, v) finally: if old_linker is not None: --- 897,927 ---- # Here seems a good place to stamp the version of the built # target. try: import win32verstamp + import optparse except ImportError: log.info('Unable to import verstamp, no version info will be added') else: ! try: ! v=optparse.Values() ! v.ensure_value('version',pywin32_version) ! v.ensure_value('comments',"http://pywin32.sourceforge.net") ! v.ensure_value('company',None) ! v.ensure_value('description',None) ! v.ensure_value('internal_name',None) ! v.ensure_value('copyright',None) ! v.ensure_value('trademarks',None) ! v.ensure_value('original_filename',os.path.basename(output_filename)) ! v.ensure_value('product','Pywin32') ! v.ensure_value('dll',None) ! v.ensure_value('debug',None) ! v.ensure_value('verbose','-v' in sys.argv) ! win32verstamp.stamp(output_filename, v) ! except: ! # Failure to stamp files means our build stops, which ! # isn't good! ! print "FAILED to stamp files" ! import traceback ! traceback.print_exc() finally: if old_linker is not None: |
From: Mark H. <mha...@us...> - 2005-10-23 11:31:44
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv367/com/win32com/test Modified Files: testExchange.py Log Message: Fail gracefully when CDO/MAPI is not installed. Index: testExchange.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testExchange.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** testExchange.py 23 Oct 2003 06:56:17 -0000 1.5 --- testExchange.py 23 Oct 2005 11:31:35 -0000 1.6 *************** *** 52,57 **** # PropTagsById={} ! for name, val in ammodule.constants.__dict__.items(): ! PropTagsById[val] = name --- 52,58 ---- # PropTagsById={} ! if ammodule: ! for name, val in ammodule.constants.__dict__.items(): ! PropTagsById[val] = name *************** *** 75,78 **** --- 76,83 ---- def test(): + if not ammodule: + print "MAPI does not appear to be installed on this machine - skipping." + return + import win32com.client oldcwd = os.getcwd() |
From: Mark H. <mha...@us...> - 2005-10-23 11:31:16
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32744/win32/Lib Modified Files: win32verstamp.py Log Message: Correct error in error handler! Index: win32verstamp.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32verstamp.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32verstamp.py 15 Sep 2005 23:54:19 -0000 1.1 --- win32verstamp.py 23 Oct 2005 11:31:07 -0000 1.2 *************** *** 123,127 **** vmaj, vmin, vsub, vbuild = bits except (IndexError, TypeError, ValueError): ! parser.error("--version must be a.b.c.d (all integers)") ifn = options.internal_name --- 123,127 ---- vmaj, vmin, vsub, vbuild = bits except (IndexError, TypeError, ValueError): ! raise ValueError, "--version must be a.b.c.d (all integers) - got %r" % ver ifn = options.internal_name |
From: Mark H. <mha...@us...> - 2005-10-22 01:41:40
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21725/win32/src Modified Files: win32inet.i Log Message: Insist on winver 0x500 so we get FtpCommand. Index: win32inet.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32inet.i,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** win32inet.i 29 Jul 2005 01:33:08 -0000 1.2 --- win32inet.i 22 Oct 2005 01:41:26 -0000 1.3 *************** *** 422,426 **** ); - %ifdef WINVER >= 0x0500 // @pyswig <o PyHINTERNET>|FtpCommand|Allows an application to send commands directly to an FTP server. BOOLAPI FtpCommand( --- 422,425 ---- *************** *** 436,440 **** PyHINTERNET *OUTPUT ); - %endif %init %{ --- 435,438 ---- |
From: Mark H. <mha...@us...> - 2005-10-22 01:41:34
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21725 Modified Files: setup.py Log Message: Insist on winver 0x500 so we get FtpCommand. Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** setup.py 22 Oct 2005 01:38:48 -0000 1.23 --- setup.py 22 Oct 2005 01:41:26 -0000 1.24 *************** *** 1002,1006 **** ("win32trace", "advapi32", False), ("win32wnet", "netapi32 mpr", False), ! ("win32inet", "wininet", False), ("win32console", "kernel32", True, 0x0501, "win32/src/win32consolemodule.cpp"), ("_win32sysloader", "", False, 0x0501, "win32/src/_win32sysloader.cpp"), --- 1002,1006 ---- ("win32trace", "advapi32", False), ("win32wnet", "netapi32 mpr", False), ! ("win32inet", "wininet", False, 0x500), ("win32console", "kernel32", True, 0x0501, "win32/src/win32consolemodule.cpp"), ("_win32sysloader", "", False, 0x0501, "win32/src/_win32sysloader.cpp"), |
From: Mark H. <mha...@us...> - 2005-10-22 01:38:59
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21346 Modified Files: setup.py Log Message: Assign each extension a DLL base address, and versionstamp the build DLLs at link time. Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** setup.py 21 Oct 2005 06:13:33 -0000 1.22 --- setup.py 22 Oct 2005 01:38:48 -0000 1.23 *************** *** 89,92 **** --- 89,96 ---- os.chdir(os.path.dirname(this_file)) + # Start address we assign base addresses from. See comment re + # dll_base_address later in this file... + dll_base_address = 0x1e200000 + # We need to know the platform SDK dir before we can list the extensions. def find_platform_sdk_dir(): *************** *** 184,187 **** --- 188,192 ---- # skip this extension optional_headers=[], + base_address = None, ): assert dsp_file or sources, "Either dsp_file or sources must be specified" *************** *** 209,212 **** --- 214,218 ---- self.optional_headers = optional_headers self.is_regular_dll = is_regular_dll + self.base_address = base_address Extension.__init__ (self, name, sources, include_dirs, *************** *** 350,379 **** print "Failed to open '%s': %s" % (ver_fname, why) - ## add version info to dll's, exe's, and pyd's - if 'install' not in sys.argv: - import optparse - try: - import win32verstamp - except ImportError: - log.info('Unable to import verstamp, no version info will be added') - else: - v=optparse.Values() - v.ensure_value('version',pywin32_version) - v.ensure_value('comments',None) - v.ensure_value('company',None) - v.ensure_value('description',None) - v.ensure_value('internal_name',None) - v.ensure_value('copyright',None) - v.ensure_value('trademarks',None) - v.ensure_value('original_filename',None) - v.ensure_value('product','Pywin32') - v.ensure_value('dll',None) - v.ensure_value('debug',None) - v.ensure_value('verbose','-v' in sys.argv) - for dirname, subdirs, fnames in os.walk(self.build_base): - for fname in fnames: - if os.path.splitext(fname)[1].lower() in ('.dll','.exe','.pyd'): - win32verstamp.stamp(os.path.join(dirname,fname),v) - class my_build_ext(build_ext): --- 356,359 ---- *************** *** 682,685 **** --- 662,672 ---- ext.extra_compile_args.append("/Fp"+pch_name) + # Put our DLL base address in. + if not self.mingw32: + base = ext.base_address + if not base: + base = dll_base_addresses[ext.name] + ext.extra_link_args.append("/BASE:0x%x" % (base,)) + # some source files are compiled for different extensions # with special defines. So we cannot use a shared *************** *** 893,906 **** self.linker = new_compiler.linker try: ! return msvccompiler.MSVCCompiler.link( self, ! target_desc, ! objects, ! output_filename, ! output_dir, ! libraries, ! library_dirs, ! runtime_library_dirs, ! export_symbols, ! debug, *args, **kw) finally: if old_linker is not None: --- 880,915 ---- self.linker = new_compiler.linker try: ! msvccompiler.MSVCCompiler.link( self, ! target_desc, ! objects, ! output_filename, ! output_dir, ! libraries, ! library_dirs, ! runtime_library_dirs, ! export_symbols, ! debug, *args, **kw) ! # Here seems a good place to stamp the version of the built ! # target. ! import optparse ! try: ! import win32verstamp ! except ImportError: ! log.info('Unable to import verstamp, no version info will be added') ! else: ! v=optparse.Values() ! v.ensure_value('version',pywin32_version) ! v.ensure_value('comments',"http://pywin32.sourceforge.net") ! v.ensure_value('company',None) ! v.ensure_value('description',None) ! v.ensure_value('internal_name',None) ! v.ensure_value('copyright',None) ! v.ensure_value('trademarks',None) ! v.ensure_value('original_filename',os.path.basename(output_filename)) ! v.ensure_value('product','Pywin32') ! v.ensure_value('dll',None) ! v.ensure_value('debug',None) ! v.ensure_value('verbose','-v' in sys.argv) ! win32verstamp.stamp(output_filename, v) finally: if old_linker is not None: *************** *** 1076,1080 **** --- 1085,1091 ---- pch_header = "stdafx.h", windows_h_version = 0x500, + base_address = dll_base_address, ) + dll_base_address += 0x80000 # pythoncom is large! com_extensions = [pythoncom] com_extensions += [ *************** *** 1121,1129 **** pythonwin_extensions = [ WinExt_pythonwin("win32ui", extra_compile_args = ['-DBUILD_PYW'], ! pch_header="stdafx.h"), WinExt_pythonwin("win32uiole", pch_header="stdafxole.h", windows_h_version = 0x500), WinExt_pythonwin("dde", pch_header="stdafxdde.h"), ] other_extensions = [] --- 1132,1143 ---- pythonwin_extensions = [ WinExt_pythonwin("win32ui", extra_compile_args = ['-DBUILD_PYW'], ! pch_header="stdafx.h", base_address=dll_base_address), WinExt_pythonwin("win32uiole", pch_header="stdafxole.h", windows_h_version = 0x500), WinExt_pythonwin("dde", pch_header="stdafxdde.h"), ] + # win32ui is large, so we reserve more bytes than normal + dll_base_address += 0x100000 + other_extensions = [] *************** *** 1302,1305 **** --- 1316,1335 ---- py_modules = expand_modules("win32\\lib") + ext_modules = win32_extensions + com_extensions + pythonwin_extensions + \ + other_extensions + + # Build a map of DLL base addresses. According to Python's PC\dllbase_nt.txt, + # we start at 0x1e200000 and go up in 0x00020000 increments. A couple of + # our modules just go over this limit, so we use 30000. We also do it sorted + # so each module gets the same addy each build. + # Note: If a module specifies a base address it still gets a slot reserved + # here which is unused. We can live with that tho. + names = [ext.name for ext in ext_modules] + names.sort() + dll_base_addresses = {} + for name in names: + dll_base_addresses[name] = dll_base_address + dll_base_address += 0x30000 + dist = setup(name="pywin32", version=str(build_id), *************** *** 1327,1332 **** scripts = ["pywin32_postinstall.py"], ! ext_modules = win32_extensions + com_extensions + pythonwin_extensions + \ ! other_extensions, package_dir = {"win32com": "com/win32com", --- 1357,1361 ---- scripts = ["pywin32_postinstall.py"], ! ext_modules = ext_modules, package_dir = {"win32com": "com/win32com", |
From: Mark H. <mha...@us...> - 2005-10-21 06:14:12
|
Update of /cvsroot/pywin32/pywin32/SWIG/swig_lib/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7666/SWIG/swig_lib/python Modified Files: pythoncom.i Log Message: Finish the excise of the atl unicode conversion macros. Index: pythoncom.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/SWIG/swig_lib/python/pythoncom.i,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pythoncom.i 22 Sep 2004 09:09:54 -0000 1.2 --- pythoncom.i 21 Oct 2005 06:14:03 -0000 1.3 *************** *** 1,5 **** %{ - #include "mapix.h" - #include <atlbase.h> #include "PythonCOM.h" --- 1,3 ---- |
From: Mark H. <mha...@us...> - 2005-10-21 06:14:12
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32wnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7666/win32/src/win32wnet Modified Files: PyNCB.cpp win32wnet.cpp Log Message: Finish the excise of the atl unicode conversion macros. Index: win32wnet.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32wnet/win32wnet.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** win32wnet.cpp 9 Feb 2001 07:24:36 -0000 1.8 --- win32wnet.cpp 21 Oct 2005 06:14:04 -0000 1.9 *************** *** 54,58 **** #include "windows.h" - #include "atlbase.h" #include "Python.h" #include "PyWinTypes.h" --- 54,57 ---- *************** *** 137,142 **** { // @todo Eventually should update this to use a NETRESOURCE object (it was written before PyNETRESOURCE) - USES_CONVERSION; - DWORD Type; // @pyparm int|type||The resource type. May be either RESOURCETYPE_DISK, RESOURCETYPE_PRINT, or RESOURCETYPE_ANY (from win32netcon) LPSTR LocalName; // @pyparm string|localName||holds the name of a local device to map connection to; may be NULL --- 136,139 ---- *************** *** 163,174 **** memset((void *)&NetResource, '\0', sizeof(NETRESOURCE)); NetResource.dwType = Type; ! NetResource.lpLocalName = A2T(LocalName); ! NetResource.lpProvider = A2T(ProviderName); ! NetResource.lpRemoteName = A2T(RemoteName); #ifdef _WIN32_WCE_ // Windows CE only has the #3 version...use NULL for HWND to simulate #2 ! ErrorNo = WNetAddConnection3(NULL,&NetResource, A2T(Password), A2T(Username), flags); #else ! ErrorNo = WNetAddConnection2(&NetResource, A2T(Password), A2T(Username), flags); #endif Py_END_ALLOW_THREADS --- 160,171 ---- memset((void *)&NetResource, '\0', sizeof(NETRESOURCE)); NetResource.dwType = Type; ! NetResource.lpLocalName = LocalName; ! NetResource.lpProvider = ProviderName; ! NetResource.lpRemoteName = RemoteName; #ifdef _WIN32_WCE_ // Windows CE only has the #3 version...use NULL for HWND to simulate #2 ! ErrorNo = WNetAddConnection3(NULL,&NetResource, Password, Username, flags); #else ! ErrorNo = WNetAddConnection2(&NetResource, Password, Username, flags); #endif Py_END_ALLOW_THREADS *************** *** 189,194 **** PyWNetCancelConnection2 (PyObject *self, PyObject *args) { - USES_CONVERSION; - LPSTR lpName; // @pyparm string|name||Name of existing connection to be closed DWORD dwFlags; // @pyparm int|flags||Currently determines if the persisent connection information will be updated as a result of this call. --- 186,189 ---- *************** *** 200,204 **** Py_BEGIN_ALLOW_THREADS ! ErrorNo = WNetCancelConnection2(A2T(lpName), dwFlags, (BOOL)bForce); Py_END_ALLOW_THREADS --- 195,199 ---- Py_BEGIN_ALLOW_THREADS ! ErrorNo = WNetCancelConnection2(lpName, dwFlags, (BOOL)bForce); Py_END_ALLOW_THREADS Index: PyNCB.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32wnet/PyNCB.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyNCB.cpp 4 Aug 2000 04:40:42 -0000 1.3 --- PyNCB.cpp 21 Oct 2005 06:14:04 -0000 1.4 *************** *** 33,37 **** #include <windows.h> #include "python.h" - #include <atlbase.h> #include "PyNCB.h" --- 33,36 ---- |
From: Mark H. <mha...@us...> - 2005-10-21 06:14:11
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7666/win32/src/win32net Modified Files: win32netmisc.cpp Log Message: Finish the excise of the atl unicode conversion macros. Index: win32netmisc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netmisc.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** win32netmisc.cpp 29 Aug 2005 09:51:45 -0000 1.12 --- win32netmisc.cpp 21 Oct 2005 06:14:04 -0000 1.13 *************** *** 12,17 **** #include "stddef.h" - #include "atlbase.h" - #define SI0_ENTRY(name, t, r) { _T(#name), t, offsetof(SHARE_INFO_0, shi0_##name), r } // @object PySHARE_INFO_0|A dictionary holding the infomation in a Win32 SHARE_INFO_0 structure. --- 12,15 ---- *************** *** 281,288 **** **************************************************************************************************************/ // Old style before we got more flexible info levels. ! static PyObject *PyNetShareEnum1(char *szServerName) { - USES_CONVERSION; - DWORD dwLevel = 1; DWORD dwMaxLen = MAX_PREFERRED_LENGTH; --- 279,284 ---- **************************************************************************************************************/ // Old style before we got more flexible info levels. ! static PyObject *PyNetShareEnum1(WCHAR *szServerName) { DWORD dwLevel = 1; DWORD dwMaxLen = MAX_PREFERRED_LENGTH; *************** *** 297,301 **** { Py_BEGIN_ALLOW_THREADS ! Errno = NetShareEnum(A2W(szServerName),dwLevel,(LPBYTE *)&lpBuffer,dwMaxLen,&dwCount,&dwMaxCount,&dwResume); Py_END_ALLOW_THREADS --- 293,297 ---- { Py_BEGIN_ALLOW_THREADS ! Errno = NetShareEnum(szServerName,dwLevel,(LPBYTE *)&lpBuffer,dwMaxLen,&dwCount,&dwMaxCount,&dwResume); Py_END_ALLOW_THREADS *************** *** 310,314 **** do { ! PyObject *t_ob = Py_BuildValue("(sis)",W2A(p_nr->shi1_netname),p_nr->shi1_type,W2A(p_nr->shi1_remark)); int listerr = PyList_Append(pRetlist,t_ob); // append our PyNETRESOURCE obj...Append does an INCREF! --- 306,313 ---- do { ! PyObject *t_ob = Py_BuildValue("(NiN)", ! PyWinObject_FromWCHAR(p_nr->shi1_netname), ! p_nr->shi1_type, ! PyWinObject_FromWCHAR(p_nr->shi1_remark)); int listerr = PyList_Append(pRetlist,t_ob); // append our PyNETRESOURCE obj...Append does an INCREF! *************** *** 355,360 **** // @pyparmalt1 string|serverName||The name of the server on which the call should execute, or None for the local computer. // @comm If the old style is used, the result is a list of [(shareName, type, remarks), ...] ! if (PyArg_ParseTuple(args, "z:NetShareEnum",&szServerName)) ! return PyNetShareEnum1(szServerName); PyErr_Clear(); // Use new style --- 354,366 ---- // @pyparmalt1 string|serverName||The name of the server on which the call should execute, or None for the local computer. // @comm If the old style is used, the result is a list of [(shareName, type, remarks), ...] ! if (PyArg_ParseTuple(args, "z:NetShareEnum",&szServerName)) { ! WCHAR *wServerName = NULL; ! if (szServerName && !PyWin_String_AsWCHAR(szServerName, -1, &wServerName)) ! return NULL; ! PyObject *ret = PyNetShareEnum1(wServerName); ! if (wServerName) ! PyWinObject_FreeString(wServerName); ! return ret; ! } PyErr_Clear(); // Use new style |
From: Mark H. <mha...@us...> - 2005-10-21 06:14:11
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/mapi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7666/com/win32comext/mapi/src Modified Files: PyMAPIUtil.h Log Message: Finish the excise of the atl unicode conversion macros. Index: PyMAPIUtil.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/mapi/src/PyMAPIUtil.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyMAPIUtil.h 25 Jan 2005 13:34:07 -0000 1.2 --- PyMAPIUtil.h 21 Oct 2005 06:14:03 -0000 1.3 *************** *** 1,4 **** --- 1,6 ---- // PyMapiUtil.h + #include "mapix.h" + // We should not be using this! #define OleSetOleError PyCom_BuildPyException |
From: Mark H. <mha...@us...> - 2005-10-21 06:13:41
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7581 Modified Files: setup.py Log Message: Latest platform SDK refuses to build VC6 debug projects - so use the VC7 linker in this case. Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** setup.py 21 Oct 2005 02:25:49 -0000 1.21 --- setup.py 21 Oct 2005 06:13:33 -0000 1.22 *************** *** 861,864 **** --- 861,910 ---- class my_compiler(msvccompiler.MSVCCompiler): + def link(self, + target_desc, + objects, + output_filename, + output_dir=None, + libraries=None, + library_dirs=None, + runtime_library_dirs=None, + export_symbols=None, + debug=0, *args, **kw): + # Oh joy of joys. With latest platform SDKs, VC6 is unable to link + # debug mode projects. So we use the VC7 linker. + old_linker = None + if debug and sys.hexversion < 0x02040000: + # msvc compiler uses __ prefix on attributes, making it hard + # to patch things up. So we get tricky, creating a new compiler + # after tricking distutils into thinking we are a later version. + save_env = {} + for key in "LIB INCLUDE PATH".split(): + save_env[key] = os.environ[key] + def hack_get_build_version(): + return 7.1 + gbv = msvccompiler.get_build_version + msvccompiler.get_build_version = hack_get_build_version + new_compiler = msvccompiler.MSVCCompiler() + msvccompiler.get_build_version = gbv + for key in save_env.keys(): + os.environ[key] = save_env[key] + + old_linker = self.linker + self.linker = new_compiler.linker + try: + return msvccompiler.MSVCCompiler.link( self, + target_desc, + objects, + output_filename, + output_dir, + libraries, + library_dirs, + runtime_library_dirs, + export_symbols, + debug, *args, **kw) + finally: + if old_linker is not None: + self.linker = old_linker + # overriding _setup_compile is the easiest way to get this support in. def _setup_compile(self, *args): |
From: Roger U. <ru...@us...> - 2005-10-21 04:44:49
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25807/win32/Lib Modified Files: winioctlcon.py Log Message: Use longs for hex values that trigger warning in 2.3 Index: winioctlcon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/winioctlcon.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** winioctlcon.py 18 Oct 2005 23:35:56 -0000 1.1 --- winioctlcon.py 21 Oct 2005 04:44:39 -0000 1.2 *************** *** 7,11 **** def DEVICE_TYPE_FROM_CTL_CODE(ctrlCode): ! return (ctrlCode & 0xffff0000) >> 16 FILE_DEVICE_BEEP = 0x00000001 --- 7,11 ---- def DEVICE_TYPE_FROM_CTL_CODE(ctrlCode): ! return (ctrlCode & 0xffff0000L) >> 16 FILE_DEVICE_BEEP = 0x00000001 *************** *** 94,98 **** MEDIA_READ_WRITE = 0x00000008 MEDIA_WRITE_PROTECTED = 0x00000100 ! MEDIA_CURRENTLY_MOUNTED = 0x80000000 IOCTL_DISK_BASE = FILE_DEVICE_DISK PARTITION_ENTRY_UNUSED = 0x00 --- 94,98 ---- MEDIA_READ_WRITE = 0x00000008 MEDIA_WRITE_PROTECTED = 0x00000100 ! MEDIA_CURRENTLY_MOUNTED = 0x80000000L IOCTL_DISK_BASE = FILE_DEVICE_DISK PARTITION_ENTRY_UNUSED = 0x00 *************** *** 203,218 **** CHANGER_DRIVE_EMPTY_ON_DOOR_ACCESS = 0x20000000 ! CHANGER_RESERVED_BIT = 0x80000000 ! CHANGER_PREDISMOUNT_ALIGN_TO_SLOT = 0x80000001 ! CHANGER_PREDISMOUNT_ALIGN_TO_DRIVE = 0x80000002 ! CHANGER_CLEANER_AUTODISMOUNT = 0x80000004 ! CHANGER_TRUE_EXCHANGE_CAPABLE = 0x80000008 ! CHANGER_SLOTS_USE_TRAYS = 0x80000010 ! CHANGER_RTN_MEDIA_TO_ORIGINAL_ADDR = 0x80000020 ! CHANGER_CLEANER_OPS_NOT_SUPPORTED = 0x80000040 ! CHANGER_IEPORT_USER_CONTROL_OPEN = 0x80000080 ! CHANGER_IEPORT_USER_CONTROL_CLOSE = 0x80000100 ! CHANGER_MOVE_EXTENDS_IEPORT = 0x80000200 ! CHANGER_MOVE_RETRACTS_IEPORT = 0x80000400 --- 203,218 ---- CHANGER_DRIVE_EMPTY_ON_DOOR_ACCESS = 0x20000000 ! CHANGER_RESERVED_BIT = 0x80000000L ! CHANGER_PREDISMOUNT_ALIGN_TO_SLOT = 0x80000001L ! CHANGER_PREDISMOUNT_ALIGN_TO_DRIVE = 0x80000002L ! CHANGER_CLEANER_AUTODISMOUNT = 0x80000004L ! CHANGER_TRUE_EXCHANGE_CAPABLE = 0x80000008L ! CHANGER_SLOTS_USE_TRAYS = 0x80000010L ! CHANGER_RTN_MEDIA_TO_ORIGINAL_ADDR = 0x80000020L ! CHANGER_CLEANER_OPS_NOT_SUPPORTED = 0x80000040L ! CHANGER_IEPORT_USER_CONTROL_OPEN = 0x80000080L ! CHANGER_IEPORT_USER_CONTROL_CLOSE = 0x80000100L ! CHANGER_MOVE_EXTENDS_IEPORT = 0x80000200L ! CHANGER_MOVE_RETRACTS_IEPORT = 0x80000400L *************** *** 248,252 **** ERROR_TRAY_MALFUNCTION = 0x00000010 ERROR_INIT_STATUS_NEEDED = 0x00000011 ! ERROR_UNHANDLED_ERROR = 0xFFFFFFFF SEARCH_ALL = 0x0 SEARCH_PRIMARY = 0x1 --- 248,252 ---- ERROR_TRAY_MALFUNCTION = 0x00000010 ERROR_INIT_STATUS_NEEDED = 0x00000011 ! ERROR_UNHANDLED_ERROR = 0xFFFFFFFFL SEARCH_ALL = 0x0 SEARCH_PRIMARY = 0x1 *************** *** 282,286 **** USN_REASON_REPARSE_POINT_CHANGE = 0x00100000 USN_REASON_STREAM_CHANGE = 0x00200000 ! USN_REASON_CLOSE = 0x80000000 USN_DELETE_FLAG_DELETE = 0x00000001 USN_DELETE_FLAG_NOTIFY = 0x00000002 --- 282,286 ---- USN_REASON_REPARSE_POINT_CHANGE = 0x00100000 USN_REASON_STREAM_CHANGE = 0x00200000 ! USN_REASON_CLOSE = 0x80000000L USN_DELETE_FLAG_DELETE = 0x00000001 USN_DELETE_FLAG_NOTIFY = 0x00000002 |