pywin32-checkins Mailing List for Python for Windows Extensions (Page 106)
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...> - 2006-01-10 00:18:32
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26887 Modified Files: win32serviceutil.py Log Message: * If you tried to debug a service and pass it arguments, after the service terminated the usage() message would be printed. * Allow for py2exe services that don't explicitly specify the executable name default to using the current executable. * Allow for service debug mode to work in a py2exe service. * Drop the "to Python class mod.klass" in the install string. Index: win32serviceutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32serviceutil.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** win32serviceutil.py 24 Oct 2005 06:17:54 -0000 1.23 --- win32serviceutil.py 10 Jan 2006 00:18:24 -0000 1.24 *************** *** 13,16 **** --- 13,20 ---- def LocatePythonServiceExe(exeName = None): + if not exeName and hasattr(sys, "frozen"): + # If py2exe etc calls this with no exeName, default is current exe. + return sys.executable + # Try and find the specified EXE somewhere. If specifically registered, # use it. Otherwise look down sys.path, and the global PATH environment. *************** *** 421,424 **** --- 425,457 ---- print "Gave up waiting for the old service to stop!" + def _DebugCtrlHandler(evt): + if evt in (win32con.CTRL_C_EVENT, win32con.CTRL_BREAK_EVENT): + assert g_debugService + print "Stopping debug service." + g_debugService.SvcStop() + return True + return False + + def DebugService(cls, argv = []): + # Run a service in "debug" mode. Re-implements what pythonservice.exe + # does when it sees a "-debug" param. + # Currently only used by "frozen" (ie, py2exe) programs (but later may + # end up being used for all services should we ever remove + # pythonservice.exe) + import servicemanager + global g_debugService + + print "Debugging service %s - press Ctrl+C to stop." % (cls._svc_name_,) + servicemanager.Debugging(True) + servicemanager.PrepareToHostSingle(cls) + g_debugService = cls(argv) + # Setup a ctrl+c handler to simulate a "stop" + win32api.SetConsoleCtrlHandler(_DebugCtrlHandler, True) + try: + g_debugService.SvcRun() + finally: + win32api.SetConsoleCtrlHandler(_DebugCtrlHandler, False) + servicemanager.Debugging(False) + g_debugService = None def GetServiceClassString(cls, argv = None): *************** *** 554,568 **** elif arg=="debug": knownArg = 1 ! svcArgs = string.join(args[1:]) ! exeName = LocateSpecificServiceExe(serviceName) ! try: ! os.system("%s -debug %s %s" % (exeName, serviceName, svcArgs)) ! # ^C is used to kill the debug service. Sometimes Python also gets ! # interrupted - ignore it... ! except KeyboardInterrupt: ! pass ! if len(args)<>1: ! usage() if arg=="install": --- 587,608 ---- elif arg=="debug": knownArg = 1 ! if not hasattr(sys, "frozen"): ! # non-frozen services use pythonservice.exe which handles a ! # -debug option ! svcArgs = string.join(args[1:]) ! exeName = LocateSpecificServiceExe(serviceName) ! try: ! os.system("%s -debug %s %s" % (exeName, serviceName, svcArgs)) ! # ^C is used to kill the debug service. Sometimes Python also gets ! # interrupted - ignore it... ! except KeyboardInterrupt: ! pass ! else: ! # py2exe services don't use pythonservice - so we simulate ! # debugging here. ! DebugService(cls, args) ! if not knownArg and len(args)<>1: ! usage() # the rest of the cmds don't take addn args if arg=="install": *************** *** 584,588 **** except AttributeError: description = None ! print "Installing service %s to Python class %s" % (serviceName,serviceClassString) # Note that we install the service before calling the custom option # handler, so if the custom handler fails, we have an installed service (from NT's POV) --- 624,628 ---- except AttributeError: description = None ! print "Installing service %s" % (serviceName,) # Note that we install the service before calling the custom option # handler, so if the custom handler fails, we have an installed service (from NT's POV) *************** *** 634,637 **** --- 674,679 ---- try: ChangeServiceConfig(serviceClassString, serviceName, serviceDeps = serviceDeps, startType=startup, bRunInteractive=interactive, userName=userName,password=password, exeName=exeName, displayName = serviceDisplayName, perfMonIni=perfMonIni,perfMonDll=perfMonDll,exeArgs=exeArgs,description=description) + if customOptionHandler: + apply( customOptionHandler, (opts,) ) print "Service updated" except win32service.error, (hr, fn, msg): |
From: Mark H. <mha...@us...> - 2006-01-10 00:03:05
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19880 Modified Files: PythonService.cpp Log Message: Allow the "Debugging" method to optionally set the service debug flag. Index: PythonService.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PythonService.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** PythonService.cpp 20 Sep 2005 12:45:07 -0000 1.19 --- PythonService.cpp 10 Jan 2006 00:02:57 -0000 1.20 *************** *** 382,392 **** } ! // @pymethod True/False|servicemanager|Debugging|Indicates if the service is running in debug mode. static PyObject *PyDebugging(PyObject *self, PyObject *args) { ! if (!PyArg_ParseTuple(args, ":Debugging")) return NULL; PyObject *rc = bServiceDebug ? Py_True : Py_False; Py_INCREF(rc); return rc; } --- 382,398 ---- } ! // @pymethod True/False|servicemanager|Debugging|Indicates if the service is running in debug mode ! // and optionally toggles the debug flag. static PyObject *PyDebugging(PyObject *self, PyObject *args) { ! // @pyparm int|newVal|-1|If not -1, a new value for the debugging flag. ! // The result is the value of the flag before it is changed. ! int newVal = (int)-1; ! if (!PyArg_ParseTuple(args, "|i:Debugging", &newVal)) return NULL; PyObject *rc = bServiceDebug ? Py_True : Py_False; Py_INCREF(rc); + if (newVal != (int)-1) + bServiceDebug = newVal; return rc; } *************** *** 442,445 **** --- 448,453 ---- PyObject *nameOb = Py_None, *fileOb = Py_None; // @pyparm <o PyUnicode>|eventSourceName|None|The event source name + // @pyparm <o PyUnicode>|eventSourceFile|None|The name of the file + // (generally a DLL) with the event source messages. if (!PyArg_ParseTuple(args, "|OO", &nameOb, &fileOb)) return NULL; |
From: Mark H. <mha...@us...> - 2006-01-02 22:12:45
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20629 Modified Files: win32timezone.py Log Message: Patch from Jason to fix pywin32 bug 1392316. Added support for non-English versions of Windows. This required a restructure of the way time zones are retrieved. In particular, the "StandardName" key for the configured time zone is in the regional language, whereas all of the TimeZones keys are in English. I re-wrote GetIndexedTimeZones to make it more flexible so time zones can be retrieved by the "Standard" name. This internationalization support required the use of _winreg over win32api.Reg*, due to the fact that _winreg returns Unicode results. Note that 2 of 27 tests will fail on a non-English platform due to the regional translation of the time zone's display name. These failures do not affect the functionality of the module. Index: win32timezone.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32timezone.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** win32timezone.py 30 Dec 2005 08:10:18 -0000 1.4 --- win32timezone.py 2 Jan 2006 22:12:38 -0000 1.5 *************** *** 57,65 **** >>> est = win32timezone.TimeZoneInfo( 'Eastern Standard Time' ) >>> est.displayName ! '(GMT-05:00) Eastern Time (US & Canada)' >>> gmt = win32timezone.TimeZoneInfo( 'GMT Standard Time', True ) >>> gmt.displayName ! '(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London' TimeZoneInfo now supports being pickled and comparison --- 57,65 ---- >>> est = win32timezone.TimeZoneInfo( 'Eastern Standard Time' ) >>> est.displayName ! u'(GMT-05:00) Eastern Time (US & Canada)' >>> gmt = win32timezone.TimeZoneInfo( 'GMT Standard Time', True ) >>> gmt.displayName ! u'(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London' TimeZoneInfo now supports being pickled and comparison *************** *** 76,80 **** __date__ = '$Modtime: 04-04-14 10:52 $'[10:-2] ! import os, win32api, win32con, struct, datetime class TimeZoneInfo( datetime.tzinfo ): --- 76,80 ---- __date__ = '$Modtime: 04-04-14 10:52 $'[10:-2] ! import os, _winreg, struct, datetime class TimeZoneInfo( datetime.tzinfo ): *************** *** 92,105 **** def __init__( self, timeZoneName, fixedStandardTime=False ): self.timeZoneName = timeZoneName tzRegKeyPath = os.path.join( self.tzRegKey, timeZoneName ) try: ! key = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, ! tzRegKeyPath, ! 0, ! win32con.KEY_READ ) except: raise ValueError, 'Timezone Name %s not found.' % timeZoneName ! self._LoadInfoFromKey( key ) ! self.fixedStandardTime = fixedStandardTime def __getinitargs__( self ): --- 92,113 ---- def __init__( self, timeZoneName, fixedStandardTime=False ): self.timeZoneName = timeZoneName + key = self._FindTimeZoneKey() + self._LoadInfoFromKey( key ) + self.fixedStandardTime = fixedStandardTime + + def _FindTimeZoneKey( self ): + """Find the registry key for the time zone name (self.timeZoneName).""" + # for multi-language compatability, match the time zone name in the + # "Std" key of the time zone key. + zoneNames = dict( GetIndexedTimeZoneNames( 'Std' ) ) + # Also match the time zone key name itself, to be compatible with + # English-based hard-coded time zones. + timeZoneName = zoneNames.get( self.timeZoneName, self.timeZoneName ) tzRegKeyPath = os.path.join( self.tzRegKey, timeZoneName ) try: ! key = _winreg.OpenKeyEx( _winreg.HKEY_LOCAL_MACHINE, tzRegKeyPath ) except: raise ValueError, 'Timezone Name %s not found.' % timeZoneName ! return key def __getinitargs__( self ): *************** *** 109,118 **** """Loads the information from an opened time zone registry key into relevant fields of this TZI object""" ! self.displayName = win32api.RegQueryValueEx( key, "Display" )[0] ! self.standardName = win32api.RegQueryValueEx( key, "Std" )[0] ! self.daylightName = win32api.RegQueryValueEx( key, "Dlt" )[0] # TZI contains a structure of time zone information and is similar to # TIME_ZONE_INFORMATION described in the Windows Platform SDK ! winTZI, type = win32api.RegQueryValueEx( key, "TZI" ) winTZI = struct.unpack( '3l8h8h', winTZI ) makeMinuteTimeDelta = lambda x: datetime.timedelta( minutes = x ) --- 117,126 ---- """Loads the information from an opened time zone registry key into relevant fields of this TZI object""" ! self.displayName = _winreg.QueryValueEx( key, "Display" )[0] ! self.standardName = _winreg.QueryValueEx( key, "Std" )[0] ! self.daylightName = _winreg.QueryValueEx( key, "Dlt" )[0] # TZI contains a structure of time zone information and is similar to # TIME_ZONE_INFORMATION described in the Windows Platform SDK ! winTZI, type = _winreg.QueryValueEx( key, "TZI" ) winTZI = struct.unpack( '3l8h8h', winTZI ) makeMinuteTimeDelta = lambda x: datetime.timedelta( minutes = x ) *************** *** 149,160 **** def utcoffset( self, dt ): "Calculates the utcoffset according to the datetime.tzinfo spec" ! if dt is None: ! return None return -( self.bias + self.dst( dt ) ) def dst( self, dt ): "Calculates the daylight savings offset according to the datetime.tzinfo spec" ! if dt is None: ! return None assert dt.tzinfo is self result = self.standardBiasOffset --- 157,166 ---- def utcoffset( self, dt ): "Calculates the utcoffset according to the datetime.tzinfo spec" ! if dt is None: return return -( self.bias + self.dst( dt ) ) def dst( self, dt ): "Calculates the daylight savings offset according to the datetime.tzinfo spec" ! if dt is None: return assert dt.tzinfo is self result = self.standardBiasOffset *************** *** 216,245 **** def _RegKeyEnumerator( key ): "Enumerates an open registry key as an iterable generator" index = 0 try: while 1: ! yield win32api.RegEnumKey( key, index ) index += 1 ! except win32api.error: pass def GetTimeZoneNames( ): "Returns the names of the time zones as defined in the registry" ! key = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, ! TimeZoneInfo.tzRegKey, ! 0, ! win32con.KEY_READ ) return _RegKeyEnumerator( key ) ! def GetIndexedTimeZoneNames( ): ! """Returns the names of the time zones as defined in the registry, but includes ! the index by which they may be sorted longitudinally.""" for timeZoneName in GetTimeZoneNames(): tzRegKeyPath = os.path.join( TimeZoneInfo.tzRegKey, timeZoneName ) ! key = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, ! tzRegKeyPath, ! 0, ! win32con.KEY_READ ) ! tzIndex, type = win32api.RegQueryValueEx( key, 'Index' ) yield ( tzIndex, timeZoneName ) --- 222,257 ---- def _RegKeyEnumerator( key ): + return _RegEnumerator( key, _winreg.EnumKey ) + + def _RegValueEnumerator( key ): + return _RegEnumerator( key, _winreg.EnumValue ) + + def _RegEnumerator( key, func ): "Enumerates an open registry key as an iterable generator" index = 0 try: while 1: ! yield func( key, index ) index += 1 ! except WindowsError: pass ! ! def _RegKeyDict( key ): ! values = _RegValueEnumerator( key ) ! values = tuple( values ) ! return dict( map( lambda (name,value,type): (name,value), values ) ) def GetTimeZoneNames( ): "Returns the names of the time zones as defined in the registry" ! key = _winreg.OpenKeyEx( _winreg.HKEY_LOCAL_MACHINE, TimeZoneInfo.tzRegKey ) return _RegKeyEnumerator( key ) ! def GetIndexedTimeZoneNames( index_key = 'Index' ): ! """Returns the names of the time zones as defined in the registry, but ! includes an index by which they may be sorted. Default index is "Index" ! by which they may be sorted longitudinally.""" for timeZoneName in GetTimeZoneNames(): tzRegKeyPath = os.path.join( TimeZoneInfo.tzRegKey, timeZoneName ) ! key = _winreg.OpenKeyEx( _winreg.HKEY_LOCAL_MACHINE, tzRegKeyPath ) ! tzIndex, type = _winreg.QueryValueEx( key, index_key ) yield ( tzIndex, timeZoneName ) *************** *** 252,256 **** def GetLocalTimeZone( ): ! """Returns the local time zone as defined by the operating system in the registry >>> localTZ = GetLocalTimeZone() >>> nowLoc = datetime.datetime.now( localTZ ) --- 264,271 ---- def GetLocalTimeZone( ): ! """Returns the local time zone as defined by the operating system in the ! registry. ! Note that this will only work if the TimeZone in the registry has not been ! customized. It should have been selected from the Windows interface. >>> localTZ = GetLocalTimeZone() >>> nowLoc = datetime.datetime.now( localTZ ) *************** *** 268,275 **** """ tzRegKey = r'SYSTEM\CurrentControlSet\Control\TimeZoneInformation' ! key = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, ! tzRegKey, ! 0, ! win32con.KEY_READ ) ! tzName, type = win32api.RegQueryValueEx( key, 'StandardName' ) ! return TimeZoneInfo( tzName ) --- 283,293 ---- """ tzRegKey = r'SYSTEM\CurrentControlSet\Control\TimeZoneInformation' ! key = _winreg.OpenKeyEx( _winreg.HKEY_LOCAL_MACHINE, tzRegKey ) ! local = _RegKeyDict( key ) ! # if the user has not checked "Automatically adjust clock for daylight ! # saving changes" in the Date and Time Properties control, the standard ! # and daylight values will be the same. If this is the case, create a ! # timezone object fixed to standard time. ! fixStandardTime = local['StandardName'] == local['DaylightName'] and \ ! local['StandardBias'] == local['DaylightBias'] ! return TimeZoneInfo( local['StandardName'], fixStandardTime ) |
From: Mark H. <mha...@us...> - 2005-12-30 08:10:28
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6469 Modified Files: win32timezone.py Log Message: Patch from Jason Coombs: Added __getinitargs__ so TimeZoneInfo objects can be pickled. Revised utcoffset() and dst() methods to return None when appropriate (as with datetime.time objects). Index: win32timezone.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32timezone.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** win32timezone.py 12 Apr 2005 06:14:01 -0000 1.3 --- win32timezone.py 30 Dec 2005 08:10:18 -0000 1.4 *************** *** 63,66 **** --- 63,71 ---- '(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London' + TimeZoneInfo now supports being pickled and comparison + >>> import pickle + >>> tz = win32timezone.TimeZoneInfo( 'China Standard Time' ) + >>> tz == pickle.loads( pickle.dumps( tz ) ) + True """ from __future__ import generators *************** *** 98,101 **** --- 103,109 ---- self.fixedStandardTime = fixedStandardTime + def __getinitargs__( self ): + return ( self.timeZoneName, ) + def _LoadInfoFromKey( self, key ): """Loads the information from an opened time zone registry key *************** *** 141,148 **** --- 149,160 ---- def utcoffset( self, dt ): "Calculates the utcoffset according to the datetime.tzinfo spec" + if dt is None: + return None return -( self.bias + self.dst( dt ) ) def dst( self, dt ): "Calculates the daylight savings offset according to the datetime.tzinfo spec" + if dt is None: + return None assert dt.tzinfo is self result = self.standardBiasOffset *************** *** 200,203 **** --- 212,218 ---- return result + def __cmp__( self, other ): + return cmp( self.__dict__, other.__dict__ ) + def _RegKeyEnumerator( key ): "Enumerates an open registry key as an iterable generator" |
From: Mark H. <mha...@us...> - 2005-12-19 04:46:55
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14231 Modified Files: oleargs.cpp Log Message: Add support for some missing variant types in the safe array support. Index: oleargs.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/oleargs.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** oleargs.cpp 20 Oct 2005 22:32:28 -0000 1.31 --- oleargs.cpp 19 Dec 2005 04:46:44 -0000 1.32 *************** *** 661,680 **** HRESULT hres = 0; switch (vt) { - case VT_VARIANT: { - VARIANT varValue; - VariantInit(&varValue); - hres = SafeArrayGetElement(psa, arrayIndices, &varValue); - if (FAILED(hres)) break; - subitem = PyCom_PyObjectFromVariant(&varValue); - VariantClear(&varValue); // clean this up - break; - } - case VT_UI1: { - unsigned char i1; - hres = SafeArrayGetElement(psa, arrayIndices, &i1); - if (FAILED(hres)) break; - subitem = PyInt_FromLong(i1); - break; - } case VT_I2: { short sh; --- 661,664 ---- *************** *** 684,688 **** break; } ! case VT_I4: { long ln; hres = SafeArrayGetElement(psa, arrayIndices, &ln); --- 668,673 ---- break; } ! case VT_I4: ! case VT_ERROR: { long ln; hres = SafeArrayGetElement(psa, arrayIndices, &ln); *************** *** 705,708 **** --- 690,707 ---- break; } + case VT_CY: { + CURRENCY c; + hres = SafeArrayGetElement(psa, arrayIndices, &c); + if (FAILED(hres)) break; + subitem = PyObject_FromCurrency(c); + break; + } + case VT_DATE: { + DATE dt; + hres = SafeArrayGetElement(psa, arrayIndices, &dt); + if (FAILED(hres)) break; + subitem = PyWinObject_FromDATE(dt); + break; + } case VT_BSTR: { BSTR str; *************** *** 711,715 **** subitem = PyWinObject_FromBstr(str); break; ! } case VT_DISPATCH: { IDispatch *pDisp; --- 710,714 ---- subitem = PyWinObject_FromBstr(str); break; ! } case VT_DISPATCH: { IDispatch *pDisp; *************** *** 719,722 **** --- 718,738 ---- break; } + // case VT_ERROR - handled above with I4 + case VT_BOOL: { + bool b1; + hres = SafeArrayGetElement(psa, arrayIndices, &b1); + if (FAILED(hres)) break; + subitem = PyBool_FromLong(b1); + break; + } + case VT_VARIANT: { + VARIANT varValue; + VariantInit(&varValue); + hres = SafeArrayGetElement(psa, arrayIndices, &varValue); + if (FAILED(hres)) break; + subitem = PyCom_PyObjectFromVariant(&varValue); + VariantClear(&varValue); // clean this up + break; + } case VT_UNKNOWN: { IUnknown *pUnk; *************** *** 726,736 **** break; } ! case VT_DATE: { ! DATE dt; ! hres = SafeArrayGetElement(psa, arrayIndices, &dt); if (FAILED(hres)) break; ! subitem = PyWinObject_FromDATE(dt); break; ! }; default: { TCHAR buf[200]; --- 742,785 ---- break; } ! // case VT_DECIMAL ! // case VT_RECORD ! ! case VT_I1: ! case VT_UI1: { ! unsigned char i1; ! hres = SafeArrayGetElement(psa, arrayIndices, &i1); if (FAILED(hres)) break; ! subitem = PyInt_FromLong(i1); break; ! } ! case VT_UI2: { ! unsigned short s1; ! hres = SafeArrayGetElement(psa, arrayIndices, &s1); ! if (FAILED(hres)) break; ! subitem = PyLong_FromUnsignedLong(s1); ! break; ! } ! case VT_UI4: { ! unsigned long l1; ! hres = SafeArrayGetElement(psa, arrayIndices, &l1); ! if (FAILED(hres)) break; ! subitem = PyLong_FromUnsignedLong(l1); ! break; ! } ! case VT_INT: { ! int i1; ! hres = SafeArrayGetElement(psa, arrayIndices, &i1); ! if (FAILED(hres)) break; ! subitem = PyLong_FromLong(i1); ! break; ! } ! case VT_UINT: { ! unsigned int i1; ! hres = SafeArrayGetElement(psa, arrayIndices, &i1); ! if (FAILED(hres)) break; ! subitem = PyLong_FromUnsignedLong(i1); ! break; ! } ! default: { TCHAR buf[200]; |
From: Mark H. <mha...@us...> - 2005-12-06 21:53:24
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11008 Modified Files: win32bitmap.cpp Log Message: Allow GetBitmapBits to return a string or a list of ints (strings being *much* faster). Index: win32bitmap.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32bitmap.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** win32bitmap.cpp 26 Jun 2005 12:59:33 -0000 1.2 --- win32bitmap.cpp 6 Dec 2005 21:53:16 -0000 1.3 *************** *** 459,466 **** } ! // @pymethod tuple|PyBitmap|GetBitmapBits|Returns the bitmap bits. static PyObject *ui_get_bitmap_bits( PyObject *self, PyObject *args ) { ! if (!PyArg_ParseTuple(args,"")) return NULL; CBitmap *pBitmap = ui_bitmap::GetBitmap( self ); --- 459,469 ---- } ! // @pymethod tuple/string|PyBitmap|GetBitmapBits|Returns the bitmap bits. static PyObject *ui_get_bitmap_bits( PyObject *self, PyObject *args ) { ! // @pyparm int|asString|0|If False, the result is a tuple of ! // integers, if True, the result is a Python string ! int asString = 0; ! if (!PyArg_ParseTuple(args,"|i", &asString)) return NULL; CBitmap *pBitmap = ui_bitmap::GetBitmap( self ); *************** *** 478,484 **** RETURN_ERR("GetBitmapBits failed on bitmap"); } ! PyObject* rc = PyTuple_New(cnt); ! for (UINT i = 0; i < cnt; i++) { ! PyTuple_SetItem(rc, i, Py_BuildValue("i", (int)bits[i])); } free(bits); --- 481,492 ---- RETURN_ERR("GetBitmapBits failed on bitmap"); } ! PyObject* rc; ! if (asString) { ! rc = PyString_FromStringAndSize(bits, cnt); ! } else { ! rc = PyTuple_New(cnt); ! for (UINT i = 0; i < cnt; i++) { ! PyTuple_SetItem(rc, i, PyInt_FromLong((long)bits[i])); ! } } free(bits); |
From: Mark H. <mha...@us...> - 2005-12-03 03:46:24
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13113/com/win32comext/axcontrol/src Modified Files: AXControl.cpp Added Files: PyIObjectWithSite.cpp PyIObjectWithSite.h PyIOleCommandTarget.cpp PyIOleCommandTarget.h Log Message: * Add IObjectWithSite and IOleCommandTarget to axcontrol * Add IInputObject to shell * Remove axcontrol VC project file --- NEW FILE: PyIOleCommandTarget.cpp --- // This file implements the IOleCommandTarget Interface and Gateway for Python. // Generated by makegw.py #include "axcontrol_pch.h" #include "PyIOleCommandTarget.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIOleCommandTarget::PyIOleCommandTarget(IUnknown *pdisp): PyIUnknown(pdisp) { ob_type = &type; } PyIOleCommandTarget::~PyIOleCommandTarget() { } /* static */ IOleCommandTarget *PyIOleCommandTarget::GetI(PyObject *self) { return (IOleCommandTarget *)PyIUnknown::GetI(self); } // @pymethod |PyIOleCommandTarget|QueryStatus|Description of QueryStatus. PyObject *PyIOleCommandTarget::QueryStatus(PyObject *self, PyObject *args) { PyObject *ret = NULL; PyObject *obGUID, *obCmds; IOleCommandTarget *pIOCT = GetI(self); OLECMD *pCmds = NULL; OLECMDTEXT *retText = NULL; if ( pIOCT == NULL ) return NULL; if (!PyArg_ParseTuple(args, "OO", &obGUID, &obCmds)) return NULL; GUID guid; GUID *pguid; if (obGUID == Py_None) { pguid = NULL; } else { if (!PyWinObject_AsIID(obGUID, &guid)) return FALSE; pguid = &guid; } if (!PySequence_Check(obCmds)) return PyErr_Format(PyExc_TypeError, "cmds must be a sequence"); int ncmds = PySequence_Length(obCmds); int i; HRESULT hr; // From here, exit via 'goto done' const unsigned cbCmdText = 1024; retText = (OLECMDTEXT *)malloc(cbCmdText); if (!retText) { PyErr_NoMemory(); goto done; } retText->cwBuf = (cbCmdText - sizeof(OLECMDTEXT)) / sizeof(WCHAR); pCmds = (OLECMD *)malloc(ncmds * sizeof(OLECMD)); if (!pCmds) { PyErr_NoMemory(); goto done; } for (i=0;i<ncmds;i++) { OLECMD *pThis = pCmds + i; PyObject *sub = PySequence_GetItem(obCmds, i); if (!sub) goto done; if (!PyArg_ParseTuple(sub, "ii", &pThis->cmdID, &pThis->cmdf)) { PyErr_Format(PyExc_TypeError, "Element %d of command buffer was not a tuple of 2 integers", i); Py_DECREF(sub); goto done; } Py_DECREF(sub); } { // scope to prevent goto warning. PY_INTERFACE_PRECALL; hr = pIOCT->QueryStatus( pguid, ncmds, pCmds, retText ); PY_INTERFACE_POSTCALL; } if ( FAILED(hr) ) { PyCom_BuildPyException(hr, pIOCT, IID_IOleCommandTarget ); goto done; } ret = Py_BuildValue("iN", retText->cmdtextf, PyWinObject_FromWCHAR(retText->rgwz)); done: if (retText) free(retText); if (pCmds) free(pCmds); return ret; } // @pymethod |PyIOleCommandTarget|Exec|Description of Exec. PyObject *PyIOleCommandTarget::Exec(PyObject *self, PyObject *args) { PyObject *ret; int cmdid, cmdopt; PyObject *obVar; PyObject *obGUID; VARIANT varIn, varOut; IOleCommandTarget *pIOCT = GetI(self); if ( pIOCT == NULL ) return NULL; if (!PyArg_ParseTuple(args, "OiiO", &obGUID, &cmdid, &cmdopt, &obVar)) return NULL; GUID guid; GUID *pguid; if (obGUID == Py_None) { pguid = NULL; } else { if (!PyWinObject_AsIID(obGUID, &guid)) return FALSE; pguid = &guid; } VariantInit(&varIn); VariantInit(&varOut); if (!PyCom_VariantFromPyObject(obVar, &varIn)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOCT->Exec( pguid, cmdid, cmdopt, &varIn, &varOut); PY_INTERFACE_POSTCALL; VariantClear(&varIn); if ( FAILED(hr) ) { PyCom_BuildPyException(hr, pIOCT, IID_IOleCommandTarget ); ret = NULL; } else { ret = PyCom_PyObjectFromVariant(&varOut); } VariantClear(&varOut); return ret; } // @object PyIOleCommandTarget|Description of the interface static struct PyMethodDef PyIOleCommandTarget_methods[] = { { "QueryStatus", PyIOleCommandTarget::QueryStatus, 1 }, // @pymeth QueryStatus|Description of QueryStatus { "Exec", PyIOleCommandTarget::Exec, 1 }, // @pymeth Exec|Description of Exec { NULL } }; PyComTypeObject PyIOleCommandTarget::type("PyIOleCommandTarget", &PyIUnknown::type, sizeof(PyIOleCommandTarget), PyIOleCommandTarget_methods, GET_PYCOM_CTOR(PyIOleCommandTarget)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGOleCommandTarget::QueryStatus( /* [unique][in] */ const GUID * pguidCmdGroup, /* [in] */ ULONG cCmds, /* [out][in][size_is] */ OLECMD prgCmds[], /* [unique][out][in] */ OLECMDTEXT * pCmdText) { PY_GATEWAY_METHOD; PyObject *obGUID; if (pguidCmdGroup == NULL) { obGUID = Py_None; Py_INCREF(obGUID); } else { obGUID = PyWinObject_FromIID(*pguidCmdGroup); } PyObject *cmds = PyList_New(cCmds); if (!cmds) { Py_DECREF(obGUID); MAKE_PYCOM_GATEWAY_FAILURE_CODE("QueryStatus"); } for (ULONG i=0;i<cCmds;i++) { PyList_SET_ITEM(cmds, i, Py_BuildValue("ll", prgCmds[i].cmdID, prgCmds[i].cmdf)); } PyObject *obTest = Py_None; // tbd PyObject *result; HRESULT hr=InvokeViaPolicy("QueryStatus", &result, "NNO", obGUID, cmds, obTest); if (FAILED(hr)) return hr; Py_DECREF(result); return hr; } STDMETHODIMP PyGOleCommandTarget::Exec( /* [unique][in] */ const GUID * pguidCmdGroup, /* [in] */ DWORD nCmdID, /* [in] */ DWORD nCmdexecopt, /* [unique][in] */ VARIANT * pvaIn, /* [unique][out][in] */ VARIANT * pvaOut) { PY_GATEWAY_METHOD; PyObject *obGUID; if (pguidCmdGroup == NULL) { obGUID = Py_None; Py_INCREF(obGUID); } else { obGUID = PyWinObject_FromIID(*pguidCmdGroup); } PyObject *obpvaIn = PyCom_PyObjectFromVariant(pvaIn); PyObject *result; HRESULT hr=InvokeViaPolicy("Exec", &result, "NllN", obGUID, nCmdID, nCmdexecopt, obpvaIn); if (FAILED(hr)) return hr; hr = PyCom_VariantFromPyObject(result, pvaOut); Py_DECREF(result); return hr; } --- NEW FILE: PyIOleCommandTarget.h --- // This file declares the IOleCommandTarget Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration #include "docobj.h" class PyIOleCommandTarget : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIOleCommandTarget); static IOleCommandTarget *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *QueryStatus(PyObject *self, PyObject *args); static PyObject *Exec(PyObject *self, PyObject *args); protected: PyIOleCommandTarget(IUnknown *pdisp); ~PyIOleCommandTarget(); }; // --------------------------------------------------- // // Gateway Declaration class PyGOleCommandTarget : public PyGatewayBase, public IOleCommandTarget { protected: PyGOleCommandTarget(PyObject *instance) : PyGatewayBase(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGOleCommandTarget, IOleCommandTarget, IID_IOleCommandTarget, PyGatewayBase) // IOleCommandTarget STDMETHOD(QueryStatus)( const GUID * pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT * pCmdText); STDMETHOD(Exec)( const GUID * pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT * pvaIn, VARIANT * pvaOut); }; --- NEW FILE: PyIObjectWithSite.cpp --- // This file implements the IObjectWithSite Interface and Gateway for Python. // Generated by makegw.py #include "axcontrol_pch.h" #include "PyIObjectWithSite.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIObjectWithSite::PyIObjectWithSite(IUnknown *pdisp): PyIUnknown(pdisp) { ob_type = &type; } PyIObjectWithSite::~PyIObjectWithSite() { } /* static */ IObjectWithSite *PyIObjectWithSite::GetI(PyObject *self) { return (IObjectWithSite *)PyIUnknown::GetI(self); } // @pymethod |PyIObjectWithSite|SetSite|Description of SetSite. PyObject *PyIObjectWithSite::SetSite(PyObject *self, PyObject *args) { IObjectWithSite *pIOWS = GetI(self); if ( pIOWS == NULL ) return NULL; // @pyparm <o PyIUnknown *>|pUnkSite||Description for pUnkSite PyObject *obpUnkSite; IUnknown * pUnkSite; if ( !PyArg_ParseTuple(args, "O:SetSite", &obpUnkSite) ) return NULL; BOOL bPythonIsHappy = TRUE; if (!PyCom_InterfaceFromPyInstanceOrObject(obpUnkSite, IID_IUnknown, (void **)&pUnkSite, TRUE /* bNoneOK */)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOWS->SetSite( pUnkSite ); if (pUnkSite) pUnkSite->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOWS, IID_IObjectWithSite ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIObjectWithSite|GetSite|Description of GetSite. PyObject *PyIObjectWithSite::GetSite(PyObject *self, PyObject *args) { IObjectWithSite *pIOWS = GetI(self); if ( pIOWS == NULL ) return NULL; // @pyparm <o PyIID>|riid||Description for riid PyObject *obriid; IID riid; void *ppvSite; if ( !PyArg_ParseTuple(args, "O:GetSite", &obriid) ) return NULL; BOOL bPythonIsHappy = TRUE; if (!PyWinObject_AsIID(obriid, &riid)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIOWS->GetSite( riid, &ppvSite ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIOWS, IID_IObjectWithSite ); PyObject *obppvSite; obppvSite = PyCom_PyObjectFromIUnknown((IUnknown *)ppvSite, riid, FALSE); PyObject *pyretval = Py_BuildValue("O", obppvSite); Py_XDECREF(obppvSite); return pyretval; } // @object PyIObjectWithSite|Description of the interface static struct PyMethodDef PyIObjectWithSite_methods[] = { { "SetSite", PyIObjectWithSite::SetSite, 1 }, // @pymeth SetSite|Description of SetSite { "GetSite", PyIObjectWithSite::GetSite, 1 }, // @pymeth GetSite|Description of GetSite { NULL } }; PyComTypeObject PyIObjectWithSite::type("PyIObjectWithSite", &PyIUnknown::type, sizeof(PyIObjectWithSite), PyIObjectWithSite_methods, GET_PYCOM_CTOR(PyIObjectWithSite)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGObjectWithSite::SetSite( /* [in] */ IUnknown * pUnkSite) { PY_GATEWAY_METHOD; PyObject *obpUnkSite; obpUnkSite = PyCom_PyObjectFromIUnknown(pUnkSite, IID_IUnknown, TRUE); HRESULT hr=InvokeViaPolicy("SetSite", NULL, "O", obpUnkSite); Py_XDECREF(obpUnkSite); return hr; } STDMETHODIMP PyGObjectWithSite::GetSite( /* [in] */ REFIID riid, /* [iid_is][out] */ void ** ppvSite) { PY_GATEWAY_METHOD; PyObject *obriid; obriid = PyWinObject_FromIID(riid); PyObject *result; HRESULT hr=InvokeViaPolicy("GetSite", &result, "O", obriid); Py_XDECREF(obriid); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppvSite; if (!PyArg_Parse(result, "O" , &obppvSite)) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetSite"); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppvSite, riid, ppvSite, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetSite"); Py_DECREF(result); return hr; } Index: AXControl.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axcontrol/src/AXControl.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AXControl.cpp 8 Oct 2003 23:40:23 -0000 1.4 --- AXControl.cpp 3 Dec 2005 03:46:15 -0000 1.5 *************** *** 31,34 **** --- 31,36 ---- #include "PyIOleInPlaceSiteWindowless.h" #include "PyISpecifyPropertyPages.h" + #include "PyIObjectWithSite.h" + #include "PyIOleCommandTarget.h" BOOL PyObject_AsLOGPALETTE(PyObject *pbLogPal, LOGPALETTE **ppLogPal) *************** *** 329,332 **** --- 331,336 ---- PYCOM_INTERFACE_FULL (OleInPlaceSiteWindowless), PYCOM_INTERFACE_FULL (SpecifyPropertyPages), + PYCOM_INTERFACE_FULL (ObjectWithSite), + PYCOM_INTERFACE_FULL (OleCommandTarget), }; --- NEW FILE: PyIObjectWithSite.h --- // This file declares the IObjectWithSite Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIObjectWithSite : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIObjectWithSite); static IObjectWithSite *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *SetSite(PyObject *self, PyObject *args); static PyObject *GetSite(PyObject *self, PyObject *args); protected: PyIObjectWithSite(IUnknown *pdisp); ~PyIObjectWithSite(); }; // --------------------------------------------------- // // Gateway Declaration class PyGObjectWithSite : public PyGatewayBase, public IObjectWithSite { protected: PyGObjectWithSite(PyObject *instance) : PyGatewayBase(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGObjectWithSite, IObjectWithSite, IID_IObjectWithSite, PyGatewayBase) // IObjectWithSite STDMETHOD(SetSite)( IUnknown * pUnkSite); STDMETHOD(GetSite)( REFIID riid, void ** ppvSite); }; |
From: Mark H. <mha...@us...> - 2005-12-03 03:46:24
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13113/com/win32comext/shell/src Added Files: PyIInputObject.cpp PyIInputObject.h Log Message: * Add IObjectWithSite and IOleCommandTarget to axcontrol * Add IInputObject to shell * Remove axcontrol VC project file --- NEW FILE: PyIInputObject.cpp --- // This file implements the IInputObject Interface and Gateway for Python. // Generated by makegw.py #include "shell_pch.h" #include "PyIOleWindow.h" #include "PyIInputObject.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIInputObject::PyIInputObject(IUnknown *pdisp): PyIUnknown(pdisp) { ob_type = &type; } PyIInputObject::~PyIInputObject() { } /* static */ IInputObject *PyIInputObject::GetI(PyObject *self) { return (IInputObject *)PyIOleWindow::GetI(self); } // @pymethod |PyIInputObject|TranslateAccelerator|Description of TranslateAccelerator. PyObject *PyIInputObject::TranslateAcceleratorIO(PyObject *self, PyObject *args) { IInputObject *pISV = GetI(self); if ( pISV == NULL ) return NULL; MSG msg; PyObject *obpmsg; // @pyparm tuple|pmsg||Description for pmsg if ( !PyArg_ParseTuple(args, "O:TranslateAcceleratorIO", &obpmsg) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyObject_AsMSG( obpmsg, &msg )) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISV->TranslateAcceleratorIO( &msg ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISV, IID_IInputObject ); return PyInt_FromLong(hr); } // @pymethod |PyIInputObject|UIActivate|Description of UIActivate. PyObject *PyIInputObject::UIActivateIO(PyObject *self, PyObject *args) { IInputObject *pISV = GetI(self); if ( pISV == NULL ) return NULL; // @pyparm int|uState||Description for uState UINT uState; PyObject *obMsg; if ( !PyArg_ParseTuple(args, "iO:UIActivateIO", &uState, &obMsg) ) return NULL; MSG msg, *pMsg; if (obMsg == Py_None) { pMsg = NULL; } else { if (!PyObject_AsMSG( obMsg, &msg )) return NULL; pMsg = &msg; } HRESULT hr; PY_INTERFACE_PRECALL; hr = pISV->UIActivateIO( uState, pMsg ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISV, IID_IInputObject ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIInputObject|HasFocusIO|Description of Refresh. PyObject *PyIInputObject::HasFocusIO(PyObject *self, PyObject *args) { IInputObject *pISV = GetI(self); if ( pISV == NULL ) return NULL; if ( !PyArg_ParseTuple(args, ":HasFocusIO") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pISV->HasFocusIO( ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISV, IID_IInputObject ); return PyBool_FromLong(hr==S_OK); } // @object PyIInputObject|Description of the interface static struct PyMethodDef PyIInputObject_methods[] = { { "TranslateAcceleratorIO", PyIInputObject::TranslateAcceleratorIO, 1 }, // @pymeth TranslateAccelerator|Description of TranslateAccelerator { "UIActivateIO", PyIInputObject::UIActivateIO, 1 }, // @pymeth UIActivate|Description of UIActivate { "HasFocusIO", PyIInputObject::HasFocusIO, 1 }, // @pymeth HasFocusIO|Description of Refresh { NULL } }; PyComTypeObject PyIInputObject::type("PyIInputObject", &PyIOleWindow::type, sizeof(PyIInputObject), PyIInputObject_methods, GET_PYCOM_CTOR(PyIInputObject)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGInputObject::TranslateAcceleratorIO( /* [in] */ MSG * pmsg) { PY_GATEWAY_METHOD; PyObject *obpmsg = PyObject_FromMSG(pmsg); if (obpmsg==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("TranslateAcceleratorIO"); PyObject *result; HRESULT hr=InvokeViaPolicy("TranslateAcceleratorIO", &result, "(O)", obpmsg); Py_DECREF(obpmsg); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params if (PyInt_Check(result) || PyLong_Check(result)) hr = PyInt_AsLong(result); Py_DECREF(result); return hr; } STDMETHODIMP PyGInputObject::UIActivateIO( /* [in] */ BOOL uState, /* [in] */ MSG * pmsg) { PY_GATEWAY_METHOD; PyObject *obpmsg = PyObject_FromMSG(pmsg); if (obpmsg==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("UIActivateIO"); HRESULT hr=InvokeViaPolicy("UIActivateIO", NULL, "iN", uState, obpmsg); return hr; } STDMETHODIMP PyGInputObject::HasFocusIO( void) { PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("HasFocusIO", &result); if (SUCCEEDED(hr)) hr = PyObject_IsTrue(result) ? S_OK : S_FALSE; Py_XDECREF(result); return hr; } --- NEW FILE: PyIInputObject.h --- // This file declares the IInputObject Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIInputObject : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIInputObject); static IInputObject *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *TranslateAcceleratorIO(PyObject *self, PyObject *args); static PyObject *UIActivateIO(PyObject *self, PyObject *args); static PyObject *HasFocusIO(PyObject *self, PyObject *args); protected: PyIInputObject(IUnknown *pdisp); ~PyIInputObject(); }; // --------------------------------------------------- // // Gateway Declaration class PyGInputObject : public PyGatewayBase, public IInputObject { protected: PyGInputObject(PyObject *instance) : PyGatewayBase(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGInputObject, IInputObject, IID_IInputObject, PyGatewayBase) // IInputObject STDMETHOD(TranslateAcceleratorIO)( MSG * pmsg); STDMETHOD(UIActivateIO)( BOOL uState, MSG * pmsg); STDMETHOD(HasFocusIO)( void); }; |
From: Mark H. <mha...@us...> - 2005-12-03 03:46:24
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13113 Modified Files: setup.py Log Message: * Add IObjectWithSite and IOleCommandTarget to axcontrol * Add IInputObject to shell * Remove axcontrol VC project file Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** setup.py 29 Nov 2005 02:24:15 -0000 1.28 --- setup.py 3 Dec 2005 03:46:15 -0000 1.29 *************** *** 1097,1100 **** --- 1097,1101 ---- 'adsi' : 'com/win32comext/adsi/src', 'shell' : 'com/win32comext/shell/src', + 'axcontrol' : 'com/win32comext/axcontrol/src', } *************** *** 1126,1130 **** %(adsi)s/PyIADs.cpp """ % dirs).split()), ! WinExt_win32com('axcontrol', pch_header="axcontrol_pch.h"), WinExt_win32com('axscript', dsp_file=r"com\Active Scripting.dsp", --- 1127,1140 ---- %(adsi)s/PyIADs.cpp """ % dirs).split()), ! WinExt_win32com('axcontrol', pch_header="axcontrol_pch.h", ! sources=(""" ! %(axcontrol)s/AXControl.cpp %(axcontrol)s/PyIOleControl.cpp ! %(axcontrol)s/PyIOleInPlaceSiteEx.cpp %(axcontrol)s/PyISpecifyPropertyPages.cpp ! %(axcontrol)s/PyIObjectWithSite.cpp %(axcontrol)s/PyIOleInPlaceObject.cpp ! %(axcontrol)s/PyIOleInPlaceSiteWindowless.cpp %(axcontrol)s/PyIViewObject.cpp ! %(axcontrol)s/PyIOleClientSite.cpp %(axcontrol)s/PyIOleInPlaceSite.cpp ! %(axcontrol)s/PyIOleObject.cpp %(axcontrol)s/PyIViewObject2.cpp ! %(axcontrol)s/PyIOleCommandTarget.cpp ! """ % dirs).split()), WinExt_win32com('axscript', dsp_file=r"com\Active Scripting.dsp", *************** *** 1156,1159 **** --- 1166,1170 ---- %(shell)s/PyIEnumIDList.cpp %(shell)s/PyIExtractIcon.cpp + %(shell)s/PyIInputObject.cpp %(shell)s/PyIPersistFolder.cpp %(shell)s/PyIQueryAssociations.cpp |
From: Mark H. <mha...@us...> - 2005-12-02 07:55:21
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12893 Modified Files: CHANGES.txt Log Message: Oops - forgot to checkin 205 change notes before release. Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CHANGES.txt 31 May 2005 13:01:40 -0000 1.1 --- CHANGES.txt 2 Dec 2005 07:55:13 -0000 1.2 *************** *** 6,9 **** --- 6,38 ---- However contributors are encouraged to add their own entries for their work. + Build 205 + --------- + * Introduce support for Python's 'decimal' module when working with + COM 'currency' objects - see the included .chm for more details. + * More reliable loading of pywintypes/pythoncom when these files are not in + system32 + * Allow datetime objects to be passed directly to COM functions without + requiring explicit conversion. + * New win32crypt module for access to the windows crypto functions. + * New win32console module (Roger Upole) + * New win32com.shell.shell methods and leaks fixed, new win32gui methods + (Roger Upole) + * pywin32.version.txt file installed, and all .dll, .pyd and .exe files + are stamped with the pywin32 version number. + * Number of build related changes to work with the latest Platform SDK. + * Fix reference leaks when using OVERLAPPED objects with completion ports. + * win32api.GetConsoleTitle() now returns an empty string instead of + (0, "No Error") + * makepy didn't catch all Dispatchable interfaces, and now doesn't die + if a dependent typelib can not be loaded. + * win32com 'universal gateway' support did not handle byref args correctly. + * Fix [ 1208530 ] PyBitmap.GetBitmapBits Memory Leak + * [ 1208081 ] Fix: WaitForServiceStatus doesn't work for remote boxes + * Pythonwin patch from Matthias Haldimann: if there is a selection, use + that as the default search string. + * Lots of win32com.adsi enhancements. + * Tweaks to the new isapi support. + * Many other minor fixes and enhancements - see the CVS log for more + details Build 204 |
From: Mark H. <mha...@us...> - 2005-12-02 07:54:43
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12790/Pythonwin/pywin/framework Modified Files: help.py Log Message: Fix bad variable reference in exception handler. Index: help.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/help.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** help.py 6 Oct 2003 13:30:26 -0000 1.9 --- help.py 2 Dec 2005 07:54:35 -0000 1.10 *************** *** 77,81 **** import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error, (code, fn, desc) return retList try: --- 77,81 ---- import winerror if code!=winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error, (code, fn, details) return retList try: |
From: Mark H. <mha...@us...> - 2005-12-02 07:54:02
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12648/com/win32com/src Modified Files: PyStorage.cpp Log Message: autoduck: Clarify exception semantics for StgIsStorageFile Index: PyStorage.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyStorage.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PyStorage.cpp 12 Feb 2005 17:14:51 -0000 1.8 --- PyStorage.cpp 2 Dec 2005 07:53:53 -0000 1.9 *************** *** 118,122 **** PY_INTERFACE_POSTCALL; if (FAILED(hr)) return PyCom_BuildPyException(hr); ! // @rdesc The return value is 1 if a storage file, else 0 return PyInt_FromLong(hr==0); } --- 118,124 ---- PY_INTERFACE_POSTCALL; if (FAILED(hr)) return PyCom_BuildPyException(hr); ! // @rdesc The return value is 1 if a storage file, else 0. This ! // method will also raise com_error if the StgIsStorageFile function ! // returns a failure HRESULT. return PyInt_FromLong(hr==0); } |
From: Mark H. <mha...@us...> - 2005-12-02 07:53:02
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12583/win32/Lib Modified Files: sspicon.py Log Message: Add ISC_REQ_HTTP Index: sspicon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/sspicon.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sspicon.py 7 Mar 2005 11:08:41 -0000 1.2 --- sspicon.py 2 Dec 2005 07:52:53 -0000 1.3 *************** *** 81,84 **** --- 81,85 ---- ISC_REQ_RESERVED1 = 1048576 ISC_REQ_FRAGMENT_TO_FIT = 2097152 + ISC_REQ_HTTP = 0x10000000 ISC_RET_DELEGATE = 1 ISC_RET_MUTUAL_AUTH = 2 |
From: Mark H. <mha...@us...> - 2005-12-02 07:52:30
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12479/win32/Lib Modified Files: win32pdhutil.py Log Message: Add pointer to MS KB article in the comments. Index: win32pdhutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32pdhutil.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** win32pdhutil.py 5 Mar 2005 05:06:31 -0000 1.9 --- win32pdhutil.py 2 Dec 2005 07:52:23 -0000 1.10 *************** *** 47,51 **** # you should copy this function, but keep the counter open, and call # CollectQueryData() each time you need to know. ! # See http://msdn.microsoft.com/library/en-us/dnperfmo/html/perfmonpt2.asp # My older explanation for this was that the "AddCounter" process forced # the CPU to 100%, but the above makes more sense :) --- 47,52 ---- # you should copy this function, but keep the counter open, and call # CollectQueryData() each time you need to know. ! # See http://support.microsoft.com/default.aspx?scid=kb;EN-US;q262938 ! # and http://msdn.microsoft.com/library/en-us/dnperfmo/html/perfmonpt2.asp # My older explanation for this was that the "AddCounter" process forced # the CPU to 100%, but the above makes more sense :) |
From: Mark H. <mha...@us...> - 2005-12-02 07:51:54
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12409/win32/src Modified Files: win32apimodule.cpp Log Message: Stale win32 errors could cause GetConsoleTitle to fail. Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** win32apimodule.cpp 9 Oct 2005 09:47:06 -0000 1.50 --- win32apimodule.cpp 2 Dec 2005 07:51:47 -0000 1.51 *************** *** 736,739 **** --- 736,740 ---- char title[128] = ""; // @pyseeapi GetConsoleTitle + ::SetLastError(0); // sigh - stale errors can hang around. if (GetConsoleTitle(title, sizeof(title))==0 && ::GetLastError() != 0) return ReturnAPIError("GetConsoleTitle"); |
From: Mark H. <mha...@us...> - 2005-12-02 07:50:55
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12213/win32/src Modified Files: win32clipboardmodule.cpp Log Message: autoduck corrections. Index: win32clipboardmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32clipboardmodule.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** win32clipboardmodule.cpp 26 Jan 2004 04:39:52 -0000 1.14 --- win32clipboardmodule.cpp 2 Dec 2005 07:50:47 -0000 1.15 *************** *** 874,878 **** // the standard clipboard formats, see Standard Clipboard Formats. ! // @pyparm int|hMem||Integer handle to the data in the specified format. // This parameter can be 0, indicating that the window provides data in // the specified clipboard format (renders the format) upon request. If a --- 874,879 ---- // the standard clipboard formats, see Standard Clipboard Formats. ! // @pyparm int/buffer|hMem||Integer handle to the data in the specified ! // format, or a buffer object (eg, string). // This parameter can be 0, indicating that the window provides data in // the specified clipboard format (renders the format) upon request. If a |
From: Mark H. <mha...@us...> - 2005-12-02 07:49:57
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11509/win32/src Modified Files: win32gui.i Log Message: Add basic autoduck for SetWindowLong Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** win32gui.i 14 Oct 2005 18:16:40 -0000 1.71 --- win32gui.i 2 Dec 2005 07:49:49 -0000 1.72 *************** *** 1507,1511 **** ); ! %endif // End of winxpgui only functi0ons // @pyswig int|GetWindowLong| --- 1507,1511 ---- ); ! %endif // End of winxpgui only functions // @pyswig int|GetWindowLong| *************** *** 1573,1576 **** --- 1573,1582 ---- long wndproc, hwnd, wparam, lparam; UINT msg; + // @pyparm int|wndproc||The wndproc to call - this is generally the return + // value of SetWindowLong(GWL_WNDPROC) + // @pyparm int|hwnd|| + // @pyparm int|msg|| + // @pyparm int|wparam|| + // @pyparm int|lparam|| if (!PyArg_ParseTuple(args, "llill", &wndproc, &hwnd, &msg, &wparam, &lparam)) return NULL; |
From: Mark H. <mha...@us...> - 2005-11-29 02:24:28
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24662/com/win32comext/shell/src Modified Files: shell.cpp Added Files: PyIDeskBand.cpp PyIDeskBand.h PyIDockingWindow.cpp PyIDockingWindow.h Log Message: Add support for IDeskBand and IDockingWindow. --- NEW FILE: PyIDockingWindow.h --- // This file declares the IDockingWindow Gateway for Python. // --------------------------------------------------------- // // Gateway Declaration class PyGDockingWindow: public PyGOleWindow, public IDockingWindow { protected: PyGDockingWindow(PyObject *instance) : PyGOleWindow(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGDockingWindow, IDockingWindow, IID_IDockingWindow, PyGOleWindow) // IOleWindow STDMETHOD(GetWindow)( HWND __RPC_FAR * phwnd); STDMETHOD(ContextSensitiveHelp)( BOOL fEnterMode); // IDockingWindow STDMETHOD(ShowDW)( BOOL fShow); STDMETHOD(CloseDW)( DWORD dwReserved); STDMETHOD(ResizeBorderDW)( LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved); }; --- NEW FILE: PyIDockingWindow.cpp --- // This file implements the IDockingWindow Interface and Gateway for Python. #include "shell_pch.h" #include "PyIOleWindow.h" #include "PyIDockingWindow.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGDockingWindow::GetWindow(HWND __RPC_FAR * phwnd) {return PyGOleWindow::GetWindow(phwnd);} STDMETHODIMP PyGDockingWindow::ContextSensitiveHelp(BOOL fEnterMode) {return PyGOleWindow::ContextSensitiveHelp(fEnterMode);} STDMETHODIMP PyGDockingWindow::ShowDW(BOOL fShow) { PY_GATEWAY_METHOD; return InvokeViaPolicy("ShowDW", NULL, "i", fShow); } STDMETHODIMP PyGDockingWindow::CloseDW(DWORD dwReserved) { PY_GATEWAY_METHOD; return InvokeViaPolicy("CloseDW", NULL, "i", dwReserved); } STDMETHODIMP PyGDockingWindow::ResizeBorderDW( /* [in] */ LPCRECT prcBorder, /* [in] */ IUnknown *punkToolbarSite, /* [in] */ BOOL fReserved) { PY_GATEWAY_METHOD; PyObject *obSite = PyCom_PyObjectFromIUnknown(punkToolbarSite, IID_IUnknown, TRUE); if (!obSite) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("ResizeBorderDW"); return InvokeViaPolicy("ResizeWindowDW", NULL, "(iiii)Ni", prcBorder->left, prcBorder->top, prcBorder->right, prcBorder->bottom, obSite, fReserved); } --- NEW FILE: PyIDeskBand.cpp --- // This file implements the IDeskBand Interface and Gateway for Python. #include "shell_pch.h" #include "PyIOleWindow.h" #include "PyIDockingWindow.h" #include "PyIDeskBand.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Gateway Implementation // IOleWindow STDMETHODIMP PyGDeskBand::GetWindow(HWND __RPC_FAR * phwnd) {return PyGDockingWindow::GetWindow(phwnd);} STDMETHODIMP PyGDeskBand::ContextSensitiveHelp(BOOL fEnterMode) {return PyGDockingWindow::ContextSensitiveHelp(fEnterMode);} // IDockingWindow STDMETHODIMP PyGDeskBand::ShowDW(BOOL fShow) { return PyGDockingWindow::ShowDW(fShow); } STDMETHODIMP PyGDeskBand::CloseDW(DWORD dwReserved) { return PyGDockingWindow::CloseDW(dwReserved); } STDMETHODIMP PyGDeskBand::ResizeBorderDW( LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved) { return PyGDockingWindow::ResizeBorderDW(prcBorder, punkToolbarSite, fReserved); } STDMETHODIMP PyGDeskBand::GetBandInfo( DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO* pdbi) { PY_GATEWAY_METHOD; PyObject *ret; HRESULT hr=InvokeViaPolicy("GetBandInfo", &ret, "ikk", dwBandID, dwViewMode, pdbi->dwMask); if (FAILED(hr)) return hr; // I'm slack here - all values must be returned from Python (eg, even // if the mask doesn't want a value, you must provide one (usually 0) PyObject *obtitle; if (!PyArg_ParseTuple(ret, "(ii)(ii)(ii)(ii)Oii", &pdbi->ptMinSize.x, &pdbi->ptMinSize.y, &pdbi->ptMaxSize.x, &pdbi->ptMaxSize.y, &pdbi->ptIntegral.x, &pdbi->ptIntegral.y, &pdbi->ptActual.x, &pdbi->ptActual.y, &obtitle, &pdbi->dwModeFlags, &pdbi->crBkgnd)) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetBandInfo"); else { WCHAR *title = NULL; if (!PyWinObject_AsWCHAR(obtitle, &title)) { hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetBandInfo"); } else { wcsncpy(pdbi->wszTitle, title, sizeof(pdbi->wszTitle)/sizeof(pdbi->wszTitle[0])); PyWinObject_FreeWCHAR(title); } } Py_DECREF(ret); return hr; } Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** shell.cpp 20 Oct 2005 22:30:58 -0000 1.40 --- shell.cpp 29 Nov 2005 02:24:16 -0000 1.41 *************** *** 35,38 **** --- 35,40 ---- #include "PyIAsyncOperation.h" #include "PyIQueryAssociations.h" + #include "PyIDockingWindow.h" + #include "PyIDeskBand.h" #include "PythonCOMRegister.h" // For simpler registration of IIDs etc. *************** *** 2165,2168 **** --- 2167,2172 ---- PYCOM_INTERFACE_FULL(DropTargetHelper), PYCOM_INTERFACE_CLIENT_ONLY(QueryAssociations), + PYCOM_INTERFACE_SERVER_ONLY(DeskBand), + PYCOM_INTERFACE_SERVER_ONLY(DockingWindow), // IID_ICopyHook doesn't exist - hack it up { &IID_IShellCopyHook, "IShellCopyHook", "IID_IShellCopyHook", &PyICopyHook::type, GET_PYGATEWAY_CTOR(PyGCopyHook) }, --- NEW FILE: PyIDeskBand.h --- // This file declares the IDeskBand Gateway for Python. // --------------------------------------------------- // --------------------------------------------------- // // Gateway Declaration class PyGDeskBand: public PyGDockingWindow, public IDeskBand { protected: PyGDeskBand(PyObject *instance) : PyGDockingWindow(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGDeskBand, IDeskBand, IID_IDeskBand, PyGDockingWindow) // IOleWindow STDMETHOD(GetWindow)( HWND __RPC_FAR * phwnd); STDMETHOD(ContextSensitiveHelp)( BOOL fEnterMode); // IDockingWindow STDMETHOD(ShowDW)( BOOL fShow); STDMETHOD(CloseDW)( DWORD dwReserved); STDMETHOD(ResizeBorderDW)( LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved); // IDeskBand STDMETHOD(GetBandInfo)( DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO* pdbi); }; |
From: Mark H. <mha...@us...> - 2005-11-29 02:24:27
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24662 Modified Files: setup.py Log Message: Add support for IDeskBand and IDockingWindow. Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** setup.py 29 Oct 2005 04:20:12 -0000 1.27 --- setup.py 29 Nov 2005 02:24:15 -0000 1.28 *************** *** 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 :) --- 1,3 ---- ! build_id="205.1" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) *************** *** 1096,1099 **** --- 1096,1100 ---- dirs = { 'adsi' : 'com/win32comext/adsi/src', + 'shell' : 'com/win32comext/shell/src', } *************** *** 1143,1147 **** WinExt_win32com_mapi('exchange', libraries="version"), WinExt_win32com_mapi('exchdapi'), ! WinExt_win32com('shell', libraries='shell32', pch_header="shell_pch.h"), WinExt_win32com('taskscheduler', libraries='mstask'), WinExt_win32com('ifilter', libraries='ntquery'), --- 1144,1172 ---- WinExt_win32com_mapi('exchange', libraries="version"), WinExt_win32com_mapi('exchdapi'), ! WinExt_win32com('shell', libraries='shell32', pch_header="shell_pch.h", ! sources=(""" ! %(shell)s/PyIAsyncOperation.cpp ! %(shell)s/PyIBrowserFrameOptions.cpp ! %(shell)s/PyIColumnProvider.cpp ! %(shell)s/PyIContextMenu.cpp ! %(shell)s/PyICopyHook.cpp ! %(shell)s/PyIDeskBand.cpp ! %(shell)s/PyIDockingWindow.cpp ! %(shell)s/PyIDropTargetHelper.cpp ! %(shell)s/PyIEnumIDList.cpp ! %(shell)s/PyIExtractIcon.cpp ! %(shell)s/PyIPersistFolder.cpp ! %(shell)s/PyIQueryAssociations.cpp ! %(shell)s/PyIShellBrowser.cpp ! %(shell)s/PyIShellExtInit.cpp ! %(shell)s/PyIShellFolder.cpp ! %(shell)s/PyIShellIcon.cpp ! %(shell)s/PyIShellIconOverlay.cpp ! %(shell)s/PyIShellIconOverlayIdentifier.cpp ! %(shell)s/PyIShellIconOverlayManager.cpp ! %(shell)s/PyIShellLink.cpp ! %(shell)s/PyIShellView.cpp ! %(shell)s/shell.cpp ! """ % dirs).split()), WinExt_win32com('taskscheduler', libraries='mstask'), WinExt_win32com('ifilter', libraries='ntquery'), |
From: Mark H. <mha...@us...> - 2005-11-29 02:24:27
|
Update of /cvsroot/pywin32/pywin32/com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24662/com Removed Files: shell.dsp Log Message: Add support for IDeskBand and IDockingWindow. --- shell.dsp DELETED --- |
From: Mark H. <mha...@us...> - 2005-11-29 02:23:15
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24509/com/win32com/src/extensions Modified Files: PyIPropertyStorage.cpp Log Message: Add some code for new VT_ types - but disable it until we know it actually works! Also include the VT_ value when raising an error about unsupported values. Index: PyIPropertyStorage.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIPropertyStorage.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PyIPropertyStorage.cpp 31 May 2005 12:36:03 -0000 1.11 --- PyIPropertyStorage.cpp 29 Nov 2005 02:23:07 -0000 1.12 *************** *** 135,140 **** // case VT_DISPATCH: // return PyCom_PyObjectFromIUnknown(pVar->pdispVal, IID_IDispatch, TRUE); default: ! PyErr_SetString(PyExc_TypeError, "Unsupported property type"); return NULL; } --- 135,162 ---- // case VT_DISPATCH: // return PyCom_PyObjectFromIUnknown(pVar->pdispVal, IID_IDispatch, TRUE); + + /* + // Want to get VT_CF and VT_BLOB working with a test case first! + case VT_CF: { // special "clipboard format" + // cbSize is the size of the buffer pointed to + // by pClipData, plus sizeof(ulClipFmt) + // XXX - in that case, shouldn't we pass + // pClipData + sizeof(DWORD) to Py_BuildValue?? + ULONG cb = CBPCLIPDATA(*pVar->pclipdata); + return Py_BuildValue("is#", + pVar->pclipdata->ulClipFmt, + pVar->pclipdata->pClipData, + (int)cb); + } + case VT_BLOB: + // DWORD count of bytes, followed by that many bytes of data. + // The byte count does not include the four bytes for the + // length of the count itself; an empty blob member would + // have a count of zero, followed by zero bytes. + return PyString_FromStringAndSize((const char *)pVar->blob.pBlobData, + pVar->blob.cbSize); + */ default: ! PyErr_Format(PyExc_TypeError, "Unsupported property type 0x%x", pVar->vt); return NULL; } |
From: Mark H. <mha...@us...> - 2005-11-29 02:16:50
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23594/com/win32com/client Modified Files: genpy.py Log Message: Remove the work around for Python bug 1163244 - Python 2.4 now gets the 'encoding' line again. Index: genpy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/genpy.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** genpy.py 20 Sep 2005 12:46:46 -0000 1.48 --- genpy.py 29 Nov 2005 02:16:35 -0000 1.49 *************** *** 24,28 **** error = "makepy.error" ! makepy_version = "0.4.94" # Written to generated file. GEN_FULL="full" --- 24,28 ---- error = "makepy.error" ! makepy_version = "0.4.95" # Written to generated file. GEN_FULL="full" *************** *** 784,795 **** self.bHaveWrittenEventBaseClass = 0 ! # encodings were giving me grief with McMillan's Installer ! # until I get to the bottom of this, don't generate ! # a coding line when frozen. ! # *sigh* - and see http://www.python.org/sf/1163244 which is causing ! # problems for 2.4+ - avoiding a coding line seems to avoid it. ! if not hasattr(sys, "frozen") and sys.platform.startswith("win") and \ ! sys.hexversion < 0x2040000: ! print >> self.file, '# -*- coding: mbcs -*-' # Is this always correct? print >> self.file, '# Created by makepy.py version %s' % (makepy_version,) print >> self.file, '# By python version %s' % \ --- 784,788 ---- self.bHaveWrittenEventBaseClass = 0 ! print >> self.file, '# -*- coding: mbcs -*-' # Is this always correct? print >> self.file, '# Created by makepy.py version %s' % (makepy_version,) print >> self.file, '# By python version %s' % \ |
From: Roger U. <ru...@us...> - 2005-11-14 07:30:21
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19420/win32/src Modified Files: win32file.i Log Message: Add FILE_FLAG_OPEN_REPARSE_POINT Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** win32file.i 13 Nov 2005 08:40:50 -0000 1.50 --- win32file.i 14 Nov 2005 07:30:09 -0000 1.51 *************** *** 120,123 **** --- 120,125 ---- // This includes allowing multiple files with names, differing only in case, for file systems that support such naming. // Use care when using this option because files created with this flag may not be accessible by applications written for MS-DOS or Windows. + #define FILE_FLAG_OPEN_REPARSE_POINT FILE_FLAG_OPEN_REPARSE_POINT + // used to open a handle for use with DeviceIoControl and FSCTL_GET_REPARSE_POINT/FSCTL_SET_REPARSE_POINT) #ifndef MS_WINCE |
From: Roger U. <ru...@us...> - 2005-11-14 07:28:18
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19068/win32/Lib Modified Files: winnt.py Log Message: Update IO_REPARSE_* constants Index: winnt.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/winnt.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** winnt.py 2 Jul 2003 03:39:12 -0000 1.2 --- winnt.py 14 Nov 2005 07:28:10 -0000 1.3 *************** *** 336,352 **** FILE_SUPPORTS_OBJECT_IDS = 65536 FILE_SUPPORTS_ENCRYPTION = 131072 MAXIMUM_REPARSE_DATA_BUFFER_SIZE = ( 16 * 1024 ) IO_REPARSE_TAG_RESERVED_ZERO = (0) IO_REPARSE_TAG_RESERVED_ONE = (1) IO_REPARSE_TAG_SYMBOLIC_LINK = (2) - IO_REPARSE_TAG_DFS = (3) - IO_REPARSE_TAG_HSM = (4) IO_REPARSE_TAG_NSS = (5) ! IO_REPARSE_TAG_MOUNT_POINT = (6) ! IO_REPARSE_TAG_SIS = (7) IO_REPARSE_TAG_NSSRECOVER = (8) IO_REPARSE_TAG_RESERVED_MS_RANGE = (256) IO_REPARSE_TAG_RESERVED_RANGE = IO_REPARSE_TAG_RESERVED_ONE IO_COMPLETION_MODIFY_STATE = 2 DUPLICATE_CLOSE_SOURCE = 1 DUPLICATE_SAME_ACCESS = 2 --- 336,355 ---- FILE_SUPPORTS_OBJECT_IDS = 65536 FILE_SUPPORTS_ENCRYPTION = 131072 + MAXIMUM_REPARSE_DATA_BUFFER_SIZE = ( 16 * 1024 ) IO_REPARSE_TAG_RESERVED_ZERO = (0) IO_REPARSE_TAG_RESERVED_ONE = (1) IO_REPARSE_TAG_SYMBOLIC_LINK = (2) IO_REPARSE_TAG_NSS = (5) ! IO_REPARSE_TAG_FILTER_MANAGER = -2147483637 ! IO_REPARSE_TAG_DFS = -2147483638 ! IO_REPARSE_TAG_SIS = -2147483641 ! IO_REPARSE_TAG_MOUNT_POINT = -1610612733 ! IO_REPARSE_TAG_HSM = -1073741820 IO_REPARSE_TAG_NSSRECOVER = (8) IO_REPARSE_TAG_RESERVED_MS_RANGE = (256) IO_REPARSE_TAG_RESERVED_RANGE = IO_REPARSE_TAG_RESERVED_ONE IO_COMPLETION_MODIFY_STATE = 2 + DUPLICATE_CLOSE_SOURCE = 1 DUPLICATE_SAME_ACCESS = 2 *************** *** 362,365 **** --- 365,369 ---- STANDARD_RIGHTS_ALL = (2031616) SPECIFIC_RIGHTS_ALL = (65535) + IO_COMPLETION_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3 ACCESS_SYSTEM_SECURITY = (16777216) MAXIMUM_ALLOWED = (33554432) |
From: Roger U. <ru...@us...> - 2005-11-13 08:40:59
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27316/win32/src Modified Files: win32file.i Log Message: Add QueryDosDevice Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** win32file.i 1 Nov 2005 21:24:09 -0000 1.49 --- win32file.i 13 Nov 2005 08:40:50 -0000 1.50 *************** *** 1513,1518 **** #endif // MS_WINCE ! // QueryDosDevice ! %{ --- 1513,1557 ---- #endif // MS_WINCE ! // @pyswig string|QueryDosDevice|Returns the mapping for a device name, or all device names ! %native (QueryDosDevice) MyQueryDosDevice; ! %{ ! static PyObject *MyQueryDosDevice(PyObject *self, PyObject *args) ! { ! PyObject *ret=NULL; ! char *devicename, *targetpath=NULL; ! DWORD retlen, buflen, err; ! // @pyparm string|DeviceName||Name of device to query, or None to return all defined devices ! // @rdesc Returns a string containing substrings separated by NULLs with 2 terminating NULLs ! if (!PyArg_ParseTuple(args, "z:QueryDosDevice", &devicename)) ! return NULL; ! if (devicename==NULL) // this returns a huge string ! buflen=8192; ! else ! buflen=256; ! // function returns ERROR_INSUFFICIENT_BUFFER with no indication of how much memory is actually needed ! while (true){ ! if (targetpath){ ! free(targetpath); ! buflen*=2; ! } ! targetpath=(char *)malloc(buflen); ! if (targetpath==NULL) ! return PyErr_Format(PyExc_MemoryError, "Unable to allocate %d bytes", buflen); ! retlen=QueryDosDevice(devicename, targetpath, buflen); ! if (retlen!=0){ ! ret=PyString_FromStringAndSize(targetpath, retlen); ! break; ! } ! err=GetLastError(); ! if (err!=ERROR_INSUFFICIENT_BUFFER){ ! PyWin_SetAPIError("QueryDosDevice",err); ! break; ! } ! } ! if (targetpath) ! free(targetpath); ! return ret; ! } ! %} %{ *************** *** 2688,2691 **** --- 2727,2731 ---- + // @pyswig <o PyUnicode>|SetVolumeMountPoint|Mounts the specified volume at the specified volume mount point. static PyObject* *************** *** 3522,3526 **** return Py_BuildValue("ll", bytes_written, ctxt); } - %} --- 3562,3565 ---- *************** *** 3607,3611 **** fp = GetProcAddress(hmodule, "BackupWrite"); if (fp) pfnBackupWrite = (BOOL (WINAPI *)(HANDLE, LPBYTE, DWORD, LPDWORD, BOOL, BOOL, LPVOID*))(fp); - } %} --- 3646,3649 ---- |