pywin32-checkins Mailing List for Python for Windows Extensions (Page 126)
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...> - 2004-09-20 02:55:54
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/c_extension In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9477/c_extension Added Files: README.txt setup.py win32_extension.cpp Log Message: Sample extension that uses pywintypes --- NEW FILE: win32_extension.cpp --- // Note: this sample does nothing useful other than to show you how // your own Python extension can link with and use the functions from // pywintypesxx.dll #include "Python.h" #include "PyWinTypes.h" static struct PyMethodDef win32extension_functions[] = { 0 }; extern "C" __declspec(dllexport) void initwin32_extension(void) { // Initialize PyWin32 globals (such as error objects etc) PyWinGlobals_Ensure(); PyObject *module; module = Py_InitModule("win32_extension", win32extension_functions); if (!module) return; } --- NEW FILE: setup.py --- # A sample distutils script to show to build your own # extension module which extends pywintypes or pythoncom. # # Use 'python setup.py build' to build this extension. import os from distutils.core import setup, Extension from distutils.sysconfig import get_python_lib sources = ["win32_extension.cpp"] # Specify the directory where the PyWin32 .h and .lib files are installed. # If you are doing a win32com extension, you will also need to add # win32com\Include and win32com\Libs. ext = Extension("win32_extension", sources, include_dirs = [os.path.join(get_python_lib(), "win32", "Include")], library_dirs = [os.path.join(get_python_lib(), "win32", "Libs")], ) setup( name="win32 extension sample", version="0.1", ext_modules=[ext], ) --- NEW FILE: README.txt --- This directory contains a sample Python extension module which includes PyWinTypes.h and links against PyWinTypesXX.lib The same technique can be used to include and extend pythoncom. The sample does nothing useful other than to show how to compile and link such an extension using a standard pywin32 installation. |
From: Mark H. <mha...@us...> - 2004-09-20 02:54:48
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9275 Modified Files: setup_win32all.py Log Message: Patch from Enzhou Wang to install the .h and .lib files necessary for people writing extensions which use pywintypes or pythoncom. Index: setup_win32all.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup_win32all.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** setup_win32all.py 13 Sep 2004 10:36:34 -0000 1.32 --- setup_win32all.py 20 Sep 2004 02:54:39 -0000 1.33 *************** *** 399,403 **** # real directory - this avoids the generated .lib/.exp build_temp = os.path.abspath(os.path.join(self.build_temp, "scintilla")) ! dir_util.mkpath(build_temp, verbose=self.verbose, dry_run=self.dry_run) makeargs.append("SUB_DIR_O=%s" % build_temp) makeargs.append("SUB_DIR_BIN=%s" % build_temp) --- 399,403 ---- # real directory - this avoids the generated .lib/.exp build_temp = os.path.abspath(os.path.join(self.build_temp, "scintilla")) ! self.mkpath(build_temp) makeargs.append("SUB_DIR_O=%s" % build_temp) makeargs.append("SUB_DIR_BIN=%s" % build_temp) *************** *** 416,423 **** else: base_name = "scintilla.dll" ! file_util.copy_file( os.path.join(self.build_temp, "scintilla", base_name), ! os.path.join(self.build_lib, "pythonwin"), ! verbose = self.verbose, dry_run = self.dry_run) def build_exefile(self, ext): --- 416,432 ---- else: base_name = "scintilla.dll" ! self.copy_file( os.path.join(self.build_temp, "scintilla", base_name), ! os.path.join(self.build_lib, "pythonwin")) ! ! # Copy cpp lib files needed to create Python COM extensions ! clib_files = (['win32', 'pywintypes.lib'], ! ['win32com', 'pythoncom.lib']) ! for clib_file in clib_files: ! target_dir = os.path.join(self.build_lib, clib_file[0], "libs") ! if not os.path.exists(target_dir): ! self.mkpath(target_dir) ! self.copy_file( ! os.path.join(self.build_temp, clib_file[1]), target_dir) def build_exefile(self, ext): *************** *** 1108,1111 **** --- 1117,1127 ---- 'com/win32comext/ifilter/demo/*.py', ]) + + # The headers and .lib files + [ + ('win32/include', ('win32/src/PyWinTypes.h',)), + ('win32com/include', ('com/win32com/src/include/PythonCOM.h', + 'com/win32com/src/include/PythonCOMRegister.h', + 'com/win32com/src/include/PythonCOMServer.h')) + ] + # And data files convert_data_files can't handle. [ |
From: Mark H. <mha...@us...> - 2004-09-20 02:51:18
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/c_extension In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8885/c_extension Log Message: Directory /cvsroot/pywin32/pywin32/win32/Demos/c_extension added to the repository |
From: Mark H. <mha...@us...> - 2004-09-13 10:36:45
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19061 Modified Files: setup_win32all.py Log Message: Allow for 'optional_headers', so axdebug can be skipped. Index: setup_win32all.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup_win32all.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** setup_win32all.py 9 Sep 2004 17:18:33 -0000 1.31 --- setup_win32all.py 13 Sep 2004 10:36:34 -0000 1.32 *************** *** 109,112 **** --- 109,115 ---- windows_h_version=None, # min version of windows.h needed. extra_swig_commands=None, + # list of headers which may not be installed forcing us to + # skip this extension + optional_headers=[], ): assert dsp_file or sources, "Either dsp_file or sources must be specified" *************** *** 132,135 **** --- 135,139 ---- self.extra_swig_commands = extra_swig_commands or [] self.windows_h_version = windows_h_version + self.optional_headers = optional_headers Extension.__init__ (self, name, sources, include_dirs, *************** *** 326,329 **** --- 330,340 ---- % (ext.windows_h_version, self.windows_h_version) + for h in ext.optional_headers: + for d in self.include_dirs: + if os.path.isfile(os.path.join(d, h)): + break + else: + return "The header '%s' can not be located" % (h,) + common_dirs = self.compiler.library_dirs[:] common_dirs += os.environ.get("LIB").split(os.pathsep) *************** *** 856,863 **** --- 867,877 ---- pch_header = "stdafx.h" ), + # ActiveDebugging is a mess. See the comments in the docstring of this + # module for details on getting it built. WinExt_win32com('axdebug', dsp_file=r"com\Active Debugging.dsp", libraries="axscript ad1", pch_header = "stdafx.h", + optional_headers = ["activdbg.h"], ), WinExt_win32com('internet'), *************** *** 1115,1118 **** --- 1129,1134 ---- for ext, why in excluded_extensions: print " %s: %s" % (ext.name, why) + print "For more details on installing the correct libraries and headers," + print "please execute this script with no arguments (or see the docstring)" else: print "All extension modules %s OK" % (what_string,) |
From: Mark H. <mha...@us...> - 2004-09-13 03:02:42
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5972 Modified Files: dbi.cpp Log Message: PyMODINIT_FUNC doesn't work in python 2.2 Index: dbi.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/dbi.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dbi.cpp 13 Jul 2004 05:05:27 -0000 1.6 --- dbi.cpp 13 Sep 2004 03:02:31 -0000 1.7 *************** *** 266,270 **** }; ! PyMODINIT_FUNC initdbi() { --- 266,270 ---- }; ! __declspec(dllexport) void initdbi() { |
From: Mark H. <mha...@us...> - 2004-09-13 02:19:27
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31688 Modified Files: win32serviceutil.py Log Message: Allow 'start' and 'stop' to wait for the service to actually start or stop. Particularly useful for installers/uninstallers, or anything that needs to know the service is looking good before continuing. Index: win32serviceutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32serviceutil.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** win32serviceutil.py 16 Aug 2004 12:47:34 -0000 1.13 --- win32serviceutil.py 13 Sep 2004 02:19:18 -0000 1.14 *************** *** 319,322 **** --- 319,334 ---- return retList + def WaitForServiceStatus(serviceName, status, waitSecs, machine=None): + """Waits for the service to return the specified status. You + should have already requested the service to enter that state""" + hscm = win32service.OpenSCManager(machine,None,win32service.SC_MANAGER_ALL_ACCESS) + for i in range(waitSecs*4): + now_status = QueryServiceStatus(serviceName)[1] + if now_status == status: + break + win32api.Sleep(250) + else: + raise pywintypes.error, (winerror.ERROR_SERVICE_REQUEST_TIMEOUT, "QueryServiceStatus", win32api.FormatMessage(winerror.ERROR_SERVICE_REQUEST_TIMEOUT)[:-2]) + def __StopServiceWithTimeout(hs, waitSecs = 30): try: *************** *** 437,440 **** --- 449,457 ---- print " --perfmondll file: .dll file to use when querying the service for" print " performance data, default = perfmondata.dll" + print "Options for 'start' and 'stop' commands only:" + print " --wait seconds: Wait for the service to actually start or stop." + print " If you specify --wait with the 'stop' option, the service" + print " and all dependent services will be stopped, each waiting" + print " the specified period." sys.exit(1) *************** *** 460,478 **** serviceClassString = GetServiceClassString(cls) ! # First we process all arguments which require access to the ! # arg list directly ! if argv[1]=="start": print "Starting service %s" % (serviceName) try: ! StartService(serviceName, argv[2:]) except win32service.error, (hr, fn, msg): print "Error starting service: %s" % msg ! elif argv[1]=="restart": print "Restarting service %s" % (serviceName) ! RestartService(serviceName, argv[2:]) ! elif argv[1]=="debug": ! svcArgs = string.join(sys.argv[2:]) exeName = LocateSpecificServiceExe(serviceName) try: --- 477,540 ---- serviceClassString = GetServiceClassString(cls) ! # Pull apart the command line ! import getopt ! try: ! opts, args = getopt.getopt(argv[1:], customInstallOptions,["password=","username=","startup=","perfmonini=", "perfmondll=", "interactive", "wait="]) ! except getopt.error, details: ! print details ! usage() ! userName = None ! password = None ! perfMonIni = perfMonDll = None ! startup = None ! interactive = None ! waitSecs = 0 ! for opt, val in opts: ! if opt=='--username': ! userName = val ! elif opt=='--password': ! password = val ! elif opt=='--perfmonini': ! perfMonIni = val ! elif opt=='--perfmondll': ! perfMonDll = val ! elif opt=='--interactive': ! interactive = 1 ! elif opt=='--startup': ! map = {"manual": win32service.SERVICE_DEMAND_START, "auto" : win32service.SERVICE_AUTO_START, "disabled": win32service.SERVICE_DISABLED} ! try: ! startup = map[string.lower(val)] ! except KeyError: ! print "'%s' is not a valid startup option" % val ! elif opt=='--wait': ! try: ! waitSecs = int(val) ! except ValueError: ! print "--wait must specify an integer number of seconds." ! usage() ! ! arg=args[0] ! knownArg = 0 ! # First we process all arguments which pass additional args on ! if arg=="start": ! knownArg = 1 print "Starting service %s" % (serviceName) try: ! StartService(serviceName, args[1:]) ! if waitSecs: ! WaitForServiceStatus(serviceName, win32service.SERVICE_RUNNING, waitSecs) except win32service.error, (hr, fn, msg): print "Error starting service: %s" % msg ! elif arg=="restart": ! knownArg = 1 print "Restarting service %s" % (serviceName) ! RestartService(serviceName, args[1:]) ! if waitSecs: ! WaitForServiceStatus(serviceName, win32service.SERVICE_RUNNING, waitSecs) ! elif arg=="debug": ! knownArg = 1 ! svcArgs = string.join(args[1:]) exeName = LocateSpecificServiceExe(serviceName) try: *************** *** 482,605 **** except KeyboardInterrupt: pass - else: - # Pull apart the command line - import getopt - try: - opts, args = getopt.getopt(argv[1:], customInstallOptions,["password=","username=","startup=","perfmonini=", "perfmondll=", "interactive"]) - except getopt.error, details: - print details - usage() - userName = None - password = None - perfMonIni = perfMonDll = None - startup = None - interactive = None - for opt, val in opts: - if opt=='--username': - userName = val - elif opt=='--password': - password = val - elif opt=='--perfmonini': - perfMonIni = val - elif opt=='--perfmondll': - perfMonDll = val - elif opt=='--interactive': - interactive = 1 - elif opt=='--startup': - map = {"manual": win32service.SERVICE_DEMAND_START, "auto" : win32service.SERVICE_AUTO_START, "disabled": win32service.SERVICE_DISABLED} - try: - startup = map[string.lower(val)] - except KeyError: - print "'%s' is not a valid startup option" % val - if len(args)<>1: - usage() - arg=args[0] - knownArg = 0 - if arg=="install": - knownArg = 1 - try: - serviceDeps = cls._svc_deps_ - except AttributeError: - serviceDeps = None - try: - exeName = cls._exe_name_ - except AttributeError: - exeName = None # Default to PythonService.exe - try: - exeArgs = cls._exe_args_ - except AttributeError: - exeArgs = 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) - # but is unlikely to work, as the Python code controlling it failed. Therefore - # we remove the service if the first bit works, but the second doesnt! - try: - InstallService(serviceClassString, serviceName, serviceDisplayName, serviceDeps = serviceDeps, startType=startup, bRunInteractive=interactive, userName=userName,password=password, exeName=exeName, perfMonIni=perfMonIni,perfMonDll=perfMonDll,exeArgs=exeArgs) - if customOptionHandler: - apply( customOptionHandler, (opts,) ) - print "Service installed" - except win32service.error, (hr, fn, msg): - if hr==winerror.ERROR_SERVICE_EXISTS: - arg = "update" # Fall through to the "update" param! - else: - print "Error installing service: %s (%d)" % (msg, hr) - err = hr - except ValueError, msg: # Can be raised by custom option handler. - print "Error installing service: %s" % str(msg) - err = -1 - # xxx - maybe I should remove after _any_ failed install - however, - # xxx - it may be useful to help debug to leave the service as it failed. - # xxx - We really _must_ remove as per the comments above... - # As we failed here, remove the service, so the next installation - # attempt works. - try: - RemoveService(serviceName) - except win32api.error: - print "Warning - could not remove the partially installed service." ! if arg == "update": ! knownArg = 1 ! try: ! serviceDeps = cls._svc_deps_ ! except AttributeError: ! serviceDeps = None ! try: ! exeName = cls._exe_name_ ! except AttributeError: ! exeName = None # Default to PythonService.exe ! try: ! exeArgs = cls._exe_args_ ! except AttributeError: ! exeArgs = None ! print "Changing service configuration" ! try: ! ChangeServiceConfig(serviceClassString, serviceName, serviceDeps = serviceDeps, startType=startup, bRunInteractive=interactive, userName=userName,password=password, exeName=exeName, displayName = serviceDisplayName, perfMonIni=perfMonIni,perfMonDll=perfMonDll,exeArgs=exeArgs) ! print "Service updated" ! except win32service.error, (hr, fn, msg): ! print "Error changing service configuration: %s (%d)" % (msg,hr) ! err = hr ! elif arg=="remove": ! knownArg = 1 ! print "Removing service %s" % (serviceName) ! try: ! RemoveService(serviceName) ! print "Service removed" ! except win32service.error, (hr, fn, msg): ! print "Error removing service: %s (%d)" % (msg,hr) err = hr ! elif arg=="stop": ! knownArg = 1 ! print "Stopping service %s" % (serviceName) try: StopService(serviceName) ! except win32service.error, (hr, fn, msg): ! print "Error stopping service: %s (%d)" % (msg,hr) ! err = hr ! if not knownArg: ! err = -1 ! print "Unknown command - '%s'" % arg ! usage() return err --- 544,640 ---- except KeyboardInterrupt: pass ! if len(args)<>1: ! usage() ! if arg=="install": ! knownArg = 1 ! try: ! serviceDeps = cls._svc_deps_ ! except AttributeError: ! serviceDeps = None ! try: ! exeName = cls._exe_name_ ! except AttributeError: ! exeName = None # Default to PythonService.exe ! try: ! exeArgs = cls._exe_args_ ! except AttributeError: ! exeArgs = 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) ! # but is unlikely to work, as the Python code controlling it failed. Therefore ! # we remove the service if the first bit works, but the second doesnt! ! try: ! InstallService(serviceClassString, serviceName, serviceDisplayName, serviceDeps = serviceDeps, startType=startup, bRunInteractive=interactive, userName=userName,password=password, exeName=exeName, perfMonIni=perfMonIni,perfMonDll=perfMonDll,exeArgs=exeArgs) ! if customOptionHandler: ! apply( customOptionHandler, (opts,) ) ! print "Service installed" ! except win32service.error, (hr, fn, msg): ! if hr==winerror.ERROR_SERVICE_EXISTS: ! arg = "update" # Fall through to the "update" param! ! else: ! print "Error installing service: %s (%d)" % (msg, hr) err = hr ! except ValueError, msg: # Can be raised by custom option handler. ! print "Error installing service: %s" % str(msg) ! err = -1 ! # xxx - maybe I should remove after _any_ failed install - however, ! # xxx - it may be useful to help debug to leave the service as it failed. ! # xxx - We really _must_ remove as per the comments above... ! # As we failed here, remove the service, so the next installation ! # attempt works. try: + RemoveService(serviceName) + except win32api.error: + print "Warning - could not remove the partially installed service." + + if arg == "update": + knownArg = 1 + try: + serviceDeps = cls._svc_deps_ + except AttributeError: + serviceDeps = None + try: + exeName = cls._exe_name_ + except AttributeError: + exeName = None # Default to PythonService.exe + try: + exeArgs = cls._exe_args_ + except AttributeError: + exeArgs = None + print "Changing service configuration" + try: + ChangeServiceConfig(serviceClassString, serviceName, serviceDeps = serviceDeps, startType=startup, bRunInteractive=interactive, userName=userName,password=password, exeName=exeName, displayName = serviceDisplayName, perfMonIni=perfMonIni,perfMonDll=perfMonDll,exeArgs=exeArgs) + print "Service updated" + except win32service.error, (hr, fn, msg): + print "Error changing service configuration: %s (%d)" % (msg,hr) + err = hr + + elif arg=="remove": + knownArg = 1 + print "Removing service %s" % (serviceName) + try: + RemoveService(serviceName) + print "Service removed" + except win32service.error, (hr, fn, msg): + print "Error removing service: %s (%d)" % (msg,hr) + err = hr + elif arg=="stop": + knownArg = 1 + print "Stopping service %s" % (serviceName) + try: + if waitSecs: + StopServiceWithDeps(serviceName, waitSecs = waitSecs) + else: StopService(serviceName) ! except win32service.error, (hr, fn, msg): ! print "Error stopping service: %s (%d)" % (msg,hr) ! err = hr ! if not knownArg: ! err = -1 ! print "Unknown command - '%s'" % arg ! usage() return err |
From: Mark H. <mha...@us...> - 2004-09-13 01:49:44
|
Update of /cvsroot/pywin32/pywin32/win32/src/PerfMon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26620 Modified Files: MappingManager.cpp perfmondata.cpp Log Message: Patches from Phil Frantz so the perfmon module works in a terminal services environment. Index: MappingManager.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PerfMon/MappingManager.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MappingManager.cpp 2 Sep 1999 00:24:54 -0000 1.1 --- MappingManager.cpp 13 Sep 2004 01:49:35 -0000 1.2 *************** *** 42,49 **** --- 42,57 ---- BOOL MappingManager::Init(const TCHAR *szServiceName, const TCHAR *szMappingName /* = NULL */, const TCHAR *szEventSourceName /* = NULL */) { + TCHAR szGlobalMapping[MAX_PATH+10]; + + if (szMappingName==NULL) szMappingName = szServiceName; if (szEventSourceName==NULL) szEventSourceName = szServiceName; + + + _tcscpy(szGlobalMapping, _T("Global\\")); + _tcscat(szGlobalMapping, szMappingName); + m_hMappedObject = CreateFileMapping((HANDLE)0xFFFFFFFF, NULL, *************** *** 51,55 **** 0, 4096, ! szMappingName); if (m_hMappedObject == NULL) { PyWin_SetAPIError("CreateFileMapping"); --- 59,63 ---- 0, 4096, ! szGlobalMapping); if (m_hMappedObject == NULL) { PyWin_SetAPIError("CreateFileMapping"); Index: perfmondata.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PerfMon/perfmondata.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** perfmondata.cpp 2 Sep 1999 00:24:54 -0000 1.1 --- perfmondata.cpp 13 Sep 2004 01:49:35 -0000 1.2 *************** *** 148,151 **** --- 148,156 ---- DWORD type; TCHAR registryKeyName[MAX_PATH]; + TCHAR szFileMapping[MAX_PATH+10]; + + _tcscpy(szFileMapping, _T("Global\\")); + _tcscat(szFileMapping, szModuleName); + // // Since SCREG is multi-threaded and will call this routine in *************** *** 164,168 **** hSharedMemory = OpenFileMapping(FILE_MAP_READ, FALSE, ! szModuleName); pCounterBlock = NULL; --- 169,173 ---- hSharedMemory = OpenFileMapping(FILE_MAP_READ, FALSE, ! szFileMapping); pCounterBlock = NULL; |
From: Mark H. <mha...@us...> - 2004-09-13 01:46:22
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25987 Modified Files: win32pipe.i Log Message: Fix [ 1005904 ] PeekNamedPipe error reporting PeekNamedPipe would report GetNamedPipeHandleState as failing. Index: win32pipe.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32pipe.i,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** win32pipe.i 2 May 2003 00:10:38 -0000 1.9 --- win32pipe.i 13 Sep 2004 01:46:13 -0000 1.10 *************** *** 426,430 **** rc = Py_BuildValue("s#ii", (char *)buf, bytesRead, totalAvail, bytesLeft); } else ! PyWin_SetAPIError("GetNamedPipeHandleState"); free(buf); return rc; --- 426,430 ---- rc = Py_BuildValue("s#ii", (char *)buf, bytesRead, totalAvail, bytesLeft); } else ! PyWin_SetAPIError("PeekNamedPipe"); free(buf); return rc; |
From: Roger U. <ru...@us...> - 2004-09-12 23:02:40
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29779/win32/Demos Added Files: print_desktop.py Log Message: Demonstrate using PyDEVMODE with DocumentProperties and CreateDC to print an image of the desktop area --- NEW FILE: print_desktop.py --- import win32print, pywintypes, win32con, win32ui, win32gui pname=win32print.GetDefaultPrinter() print pname p=win32print.OpenPrinter(pname) print 'Printer handle: ',p ## call with last parm set to 0 to get total size needed for printer's DEVMODE dmsize=win32print.DocumentProperties(0, p, pname, None, None, 0) ## dmDriverExtra should be total size - fixed size driverextra=dmsize - pywintypes.DEVMODEType().Size ## need a better way to get DEVMODE.dmSize dm=pywintypes.DEVMODEType(driverextra) dm.Fields=dm.Fields|win32con.DM_ORIENTATION|win32con.DM_COPIES dm.Orientation=win32con.DMORIENT_LANDSCAPE dm.Copies=2 win32print.DocumentProperties(0, p, pname, dm, dm, win32con.DM_IN_BUFFER|win32con.DM_OUT_BUFFER) pDC=win32gui.CreateDC('WINSPOOL',pname,dm) printerDC=win32ui.CreateDCFromHandle(pDC) printerwidth=printerDC.GetDeviceCaps(110) ##PHYSICALWIDTH printerheight=printerDC.GetDeviceCaps(111) ##PHYSICALHEIGHT hwnd=win32gui.GetDesktopWindow() ## hwnd=win32gui.GetForegroundWindow() l,t,r,b=win32gui.GetWindowRect(hwnd) desktopheight=b-t desktopwidth=r-l dDC = win32gui.GetWindowDC(hwnd) desktopDC=win32ui.CreateDCFromHandle(dDC) printerDC.StartDoc('desktop.bmp') printerDC.StartPage() printerDC.StretchBlt((0,0),(int(printerwidth*.9),int(printerheight*.9)), ## allow for paper margin desktopDC,(0,0),(desktopwidth,desktopheight),win32con.SRCCOPY) printerDC.EndPage() printerDC.EndDoc() |
From: Roger U. <ru...@us...> - 2004-09-12 22:44:13
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32print In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26267/win32/src/win32print Modified Files: win32print.cpp Log Message: Add DocumentProperties and EnumPrintProcessors Index: win32print.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32print/win32print.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** win32print.cpp 31 Jul 2002 06:07:05 -0000 1.7 --- win32print.cpp 12 Sep 2004 22:44:04 -0000 1.8 *************** *** 559,563 **** --- 559,640 ---- } + // @pymethod int|win32print|DocumentProperties|Changes printer configuration for a printer + // @comm If DM_IN_PROMPT is specified, return value will be IDOK or IDCANCEL + static PyObject *PyDocumentProperties(PyObject *self, PyObject *args) + { + long ret; + HANDLE hprinter; + HWND hwnd; + char *devicename; + PDEVMODE dmoutput, dminput; + PyObject *obdmoutput, *obdminput; + DWORD mode; + // @pyparm int|HWnd||Parent window handle to use if DM_IN_PROMPT is specified to display printer dialog + // @pyparm int|hPrinter||Printer handle as returned by OpenPrinter + // @pyparm string|DeviceName||Name of printer + // @pyparm <o PyDEVMODE>|DevModeOutput||PyDEVMODE object that receives modified info, can be None if DM_OUT_BUFFER not specified + // @pyparm <o PyDEVMODE>|DevModeInput||PyDEVMODE that specifies initial configuration, can be None if DM_IN_BUFFER not specified + // @pyparm int|Mode||A combination of DM_IN_BUFFER, DM_OUT_BUFFER, and DM_IN_PROMPT - pass 0 to retrieve driver data size + if (!PyArg_ParseTuple(args,"llsOOl", &hwnd, &hprinter, &devicename, &obdmoutput, &obdminput, &mode)) + return NULL; + if (!PyWinObject_AsDEVMODE(obdmoutput, &dmoutput, TRUE)) + return NULL; + if (!PyWinObject_AsDEVMODE(obdminput, &dminput, TRUE)) + return NULL; + ret=DocumentProperties(hwnd, hprinter, devicename, dmoutput, dminput, mode); + if (ret < 0){ + PyWin_SetAPIError("DocumentProperties"); + return NULL; + } + if (obdmoutput!=Py_None) + ((PyDEVMODE *)obdmoutput)->modify_in_place(); + return PyInt_FromLong(ret); + } + // @pymethod string,...|win32print|EnumPrintProcessors|List printer providers for specified server and environment + static PyObject *PyEnumPrintProcessors(PyObject *self, PyObject *args) + { + PRINTPROCESSOR_INFO_1 *info=NULL; // currently only level that exists + LPBYTE buf=NULL; + char *servername=NULL, *environment=NULL; + DWORD level=1, bufsize=0, bytes_needed, return_cnt; + PyObject *ret, *tuple_item; + // @pyparm string|Server|None|Name of print server, use None for local machine + // @pyparm string|Environment|None|Environment - eg 'Windows NT x86' - use None for current client environment + if (!PyArg_ParseTuple(args,"|zz", &servername, &environment)) + return NULL; + + EnumPrintProcessors(servername, environment, level, buf, bufsize, &bytes_needed, &return_cnt); + if (bytes_needed==0){ + PyWin_SetAPIError("EnumPrintProcessors"); + return NULL; + } + buf=(LPBYTE)malloc(bytes_needed); + if (buf==NULL){ + PyErr_Format(PyExc_MemoryError,"EnumPrintProcessors: unable to allocate buffer of size %d", bytes_needed); + return NULL; + } + bufsize=bytes_needed; + if (!EnumPrintProcessors(servername, environment, level, buf, bufsize, &bytes_needed, &return_cnt)) + PyWin_SetAPIError("EnumPrintProcessors"); + else{ + ret=PyTuple_New(return_cnt); + if (ret!=NULL){ + info=(PRINTPROCESSOR_INFO_1 *)buf; + for (DWORD buf_ind=0; buf_ind<return_cnt; buf_ind++){ + tuple_item=PyString_FromString(info->pName); + if (tuple_item==NULL){ + Py_DECREF(ret); + ret=NULL; + break; + } + PyTuple_SetItem(ret,buf_ind,tuple_item); + info++; + } + } + } + free(buf); + return ret; + } /* List of functions exported by this module */ *************** *** 578,581 **** --- 655,660 ---- {"GetJob", PyGetJob, 1}, // @pymeth GetJob|Returns dictionary of information about a specified print job. {"SetJob", PySetJob, 1}, // @pymeth SetJob|Pause, cancel, resume, set priority levels on a print job. + {"DocumentProperties", PyDocumentProperties, 1}, //@pymeth DocumentProperties|Changes printer configuration + {"EnumPrintProcessors", PyEnumPrintProcessors, 1}, //@pymeth EnumPrintProcessors|List printer providers for specified server and environment { NULL } }; |
From: Roger U. <ru...@us...> - 2004-09-12 22:42:37
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25925/win32/src Modified Files: win32gui.i Log Message: Add non-MFC version of CreateDC, rewrite parsing of SCROLLINFO tuple to eliminate stale errors Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** win32gui.i 7 Sep 2004 08:38:15 -0000 1.48 --- win32gui.i 12 Sep 2004 22:42:25 -0000 1.49 *************** *** 2772,2823 **** BOOL ParseSCROLLINFOTuple( PyObject *args, SCROLLINFO *pInfo) { ! PyObject *ob; int len = PyTuple_Size(args); ! if (len<1 || len > 5) { ! PyErr_SetString(PyExc_TypeError, "SCROLLINFO tuple has invalid size"); return FALSE; } ! PyErr_Clear(); // clear any errors, so I can detect my own. ! // 0 - mask. ! if ((ob=PyTuple_GetItem(args, 0))==NULL) return FALSE; ! pInfo->fMask = (UINT)PyInt_AsLong(ob); // 1/2 - nMin/nMax ! if (len==2) { PyErr_SetString(PyExc_TypeError, "SCROLLINFO - Both min and max, or neither, must be provided."); return FALSE; } ! if (len<3) return TRUE; ! if ((ob=PyTuple_GetItem(args, 1))==NULL) ! return FALSE; ! if (ob != Py_None) { ! pInfo->fMask |= SIF_RANGE; ! pInfo->nMin = PyInt_AsLong(ob); ! if ((ob=PyTuple_GetItem(args, 2))==NULL) return FALSE; ! pInfo->nMax = PyInt_AsLong(ob); } ! // 3 == nPage. ! if (len<4) return TRUE; ! if ((ob=PyTuple_GetItem(args, 3))==NULL) ! return FALSE; ! if (ob != Py_None) { ! pInfo->fMask |=SIF_PAGE; ! pInfo->nPage = PyInt_AsLong(ob); } ! // 4 == nPos ! if (len<5) return TRUE; ! if ((ob=PyTuple_GetItem(args, 4))==NULL) ! return FALSE; ! if (ob != Py_None) { ! pInfo->fMask |=SIF_POS; ! pInfo->nPos = PyInt_AsLong(ob); } ! // 5 == trackpos ! if (len<6) return TRUE; ! if ((ob=PyTuple_GetItem(args, 5))==NULL) ! return FALSE; ! if (ob != Py_None) { ! pInfo->nTrackPos = PyInt_AsLong(ob); } return TRUE; --- 2772,2813 ---- BOOL ParseSCROLLINFOTuple( PyObject *args, SCROLLINFO *pInfo) { ! static char *err_msg="SCROLLINFO must be a tuple of 1-6 ints"; ! PyObject *obMin=Py_None, *obMax=Py_None, *obPage=Py_None, *obPos=Py_None, *obTrackPos=Py_None; int len = PyTuple_Size(args); ! if (len<1 || len > 6) { ! PyErr_SetString(PyExc_TypeError, err_msg); return FALSE; } ! if (!PyArg_ParseTuple(args, "l|OOOOO", &pInfo->fMask, &obMin, &obMax, &obPage, &obPos, &obTrackPos)){ ! PyErr_SetString(PyExc_TypeError, err_msg); return FALSE; ! } ! PyErr_Clear(); // clear any errors, so I can detect my own. // 1/2 - nMin/nMax ! if ((obMin==Py_None && obMax!=Py_None) || (obMin!=Py_None && obMax==Py_None)){ PyErr_SetString(PyExc_TypeError, "SCROLLINFO - Both min and max, or neither, must be provided."); return FALSE; } ! if (obMin!=Py_None){ ! if (((pInfo->nMin=PyInt_AsLong(obMin))==-1)&&PyErr_Occurred()) return FALSE; ! if (((pInfo->nMax=PyInt_AsLong(obMax))==-1)&&PyErr_Occurred()) ! return FALSE; ! pInfo->fMask |= SIF_RANGE; } ! if (obPage!=Py_None){ ! if (((pInfo->nPage=PyInt_AsLong(obPage))==-1)&&PyErr_Occurred()) ! return FALSE; ! pInfo->fMask |= SIF_PAGE; } ! if (obPos!=Py_None){ ! if (((pInfo->nPos=PyInt_AsLong(obPos))==-1)&&PyErr_Occurred()) ! return FALSE; ! pInfo->fMask |= SIF_POS; } ! if (obTrackPos!=Py_None){ ! if (((pInfo->nTrackPos=PyInt_AsLong(obTrackPos))==-1)&&PyErr_Occurred()) ! return FALSE; ! pInfo->fMask |= SIF_TRACKPOS; } return TRUE; *************** *** 2873,2880 **** SCROLLINFO info; info.cbSize = sizeof(SCROLLINFO); ! if (ParseSCROLLINFOTuple(obInfo, &info) == 0) { ! PyWin_SetAPIError("SetScrollInfo"); return NULL; ! } GUI_BGN_SAVE; int rc = SetScrollInfo(hwnd, nBar, &info, bRedraw); --- 2863,2869 ---- SCROLLINFO info; info.cbSize = sizeof(SCROLLINFO); ! if (ParseSCROLLINFOTuple(obInfo, &info) == 0) return NULL; ! GUI_BGN_SAVE; int rc = SetScrollInfo(hwnd, nBar, &info, bRedraw); *************** *** 3070,3071 **** --- 3059,3084 ---- %native (ListView_SortItems) PyListView_SortItems; %native (ListView_SortItemsEx) PyListView_SortItemsEx; + + // @pyswig int|CreateDC|Creates a device context for a printer or display device + %native (CreateDC) PyCreateDC; + %{ + static PyObject *PyCreateDC(PyObject *self, PyObject *args) + { + PDEVMODE pdevmode; + PyObject *obdevmode=NULL; + char *driver, *device, *dummyoutput=NULL; + HDC hdc; + // @pyparm string|Driver||Name of display or print provider, usually DISPLAY or WINSPOOL + // @pyparm string|Device||Name of specific device, eg printer name returned from GetDefaultPrinter + // @pyparm <o PyDEVMODE>|InitData||A PyDEVMODE that specifies printing parameters, use None for printer defaults + if (!PyArg_ParseTuple(args, "szO", &driver, &device, &obdevmode)) + return NULL; + if (!PyWinObject_AsDEVMODE(obdevmode, &pdevmode, TRUE)) + return NULL; + hdc=CreateDC(driver, device, dummyoutput, pdevmode); + if (hdc!=NULL) + return Py_BuildValue("l",hdc); + PyWin_SetAPIError("CreateDC",GetLastError()); + return NULL; + } + %} |
From: Mark H. <mha...@us...> - 2004-09-11 07:49:06
|
Update of /cvsroot/pywin32/pywin32/AutoDuck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9361 Modified Files: pyhtml.fmt Log Message: Don't bother indicating where the constants were defined Index: pyhtml.fmt =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/pyhtml.fmt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pyhtml.fmt 17 Apr 2002 14:06:19 -0000 1.8 --- pyhtml.fmt 11 Sep 2004 07:48:57 -0000 1.9 *************** *** 218,222 **** <H1>$!n</H1> $(cb)const $1.$2;$(cbe)$(par) - Defined in: $!P$(par) $3$(par) --- 218,221 ---- |
From: Mark H. <mha...@us...> - 2004-09-11 07:47:04
|
Update of /cvsroot/pywin32/pywin32/pyisapi/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9083 Added Files: isapi.html Log Message: Simple overview of the ISAPI framework, which is embedded in the .chm file. --- NEW FILE: isapi.html --- <!-- NOTE: This HTML is displayed inside the CHM file - hence some hrefs will only work in that environment --> <HTML> <BODY> <TITLE>Introduction to Python ISAPI support</TITLE> <h2>Introduction to Python ISAPI support</h2> <h3>See also</h3> <ul> <li><a href="/isapi_modules.html">The isapi related modules</a> </li> <li><a href="/isapi_objects.html">The isapi related objects</a> </li> </ul> <h3>Introduction</h3> This documents Python support for hosting ISAPI exensions and filters inside Microsoft Internet Information Server (IIS). It assumes a basic understanding of the ISAPI filter and extension mechanism. <p> In summary, to implement a filter or extension, you provide a Python module which defines a Filter and/or Extension class. Once your class has been loaded, IIS/ISAPI will, via an extension DLL, call methods on your class. <p> A filter and a class instance need only provide 3 methods - for filters they are called <code>GetFilterVersion</code>, <code>HttpFilterProc</code> and <code>TerminateFilter</code>. For extensions they are named <code>GetExtensionVersion</code>, <code>HttpExtensionProc</code> and <code>TerminateExtension</code>. If you are familiar with writing ISAPI extensions in C/C++, these names and their purpose will be familiar. <p> Most of the work is done in the <code>HttpFilterProc</code> and <code>HttpExtensionProc</code> methods. These both take a single parameter - an <a href="/HTTP_FILTER_CONTEXT.html">HTTP_FILTER_CONTEXT</a> and <a href="/EXTENSION_CONTROL_BLOCK.html">EXTENSION_CONTROL_BLOCK</a> object respectively. <p> In addition to these components, there is an 'isapi' package, containing support facilities (base-classes, exceptions, etc) which can be leveraged by the extension. <h4>Base classes</h4> There are a number of base classes provided to make writing extensions a little simpler. Of particular note is <code>isapi.threaded_extension.ThreadPoolExtension</code>. This implements a thread-pool and informs IIS that the request is progressing in the background. Your sub-class need only provide a <code>Dispatch</code> method, which is called on one of the worker threads rather than the thread that the request came in on. <p> There is base-class for a filter in <code>isapi.simple</code>, but there is no equivilent threaded filter - filters work under a different model, where background processing is not possible. <h4>Samples</h4> Please see the <code>isapi/samples</code> directory for some sample filters and extensions. <H3>Implementation</H3> A Python ISAPI filter extension consists of 2 main components: <UL> <LI>A DLL used by ISAPI to interface with Python.</LI> <LI>A Python script used by that DLL to implement the filter or extension functionality</LI> </UL> <h4>Extension DLL</h4> The DLL is usually managed automatically by the isapi.install module. As the Python script for the extension is installed, a generic DLL provided with the isapi package is installed next to the script, and IIS configured to use this DLL. <p> The name of the DLL always has the same base name as the Python script, but with a leading underscore (_), and an extension of .dll. For example, the sample "redirector.py" will, when installed, have "_redirector.dll" created in the same directory. <p/> The Python script may provide 2 entry points - methods named __FilterFactory__ and __ExtensionFactory__, both taking no arguments and returning a filter or extension object. <h3>Using py2exe and the isapi package</h3> You can instruct py2exe to create a 'frozen' Python ISAPI filter/extension. In this case, py2exe will create a package with everything you need in one directory, and the Python source file embedded in the .zip file. <p> In general, you will want to build a seperate installation executable along with the ISAPI extension. This executable will be built from the same script. See the ISAPI sample in the py2exe distribution. |
From: Mark H. <mha...@us...> - 2004-09-11 07:46:20
|
Update of /cvsroot/pywin32/pywin32/pyisapi/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9036/doc Log Message: Directory /cvsroot/pywin32/pywin32/pyisapi/doc added to the repository |
From: Mark H. <mha...@us...> - 2004-09-11 07:44:42
|
Update of /cvsroot/pywin32/pywin32/pyisapi/isapi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8775 Modified Files: install.py isapicon.py simple.py threaded_extension.py Log Message: Add lots of docstrings. Index: isapicon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pyisapi/isapi/isapicon.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** isapicon.py 1 Sep 2004 03:07:11 -0000 1.1 --- isapicon.py 11 Sep 2004 07:44:32 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- + """Constants needed by ISAPI filters and extensions.""" # ====================================================================== # Copyright 2002-2003 by Blackdog Software Pty Ltd. Index: threaded_extension.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pyisapi/isapi/threaded_extension.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** threaded_extension.py 9 Sep 2004 08:57:15 -0000 1.4 --- threaded_extension.py 11 Sep 2004 07:44:32 -0000 1.5 *************** *** 116,122 **** --- 116,141 ---- def Dispatch(self, ecb): + """Overridden by the sub-class to handle connection requests. + + This class creates a thread-pool using a Windows completion port, + and dispatches requests via this port. Sub-classes can generally + implementeach connection request using blocking reads and writes, and + the thread-pool will still provide decent response to the end user. + + The sub-class can set a max_workers attribute (default is 20). Note + that this generally does *not* mean 20 threads will all be concurrently + running, via the magic of Windows completion ports. + + There is no default implementation - sub-classes must implement this. + """ raise NotImplementedError, "sub-classes should override Dispatch" def HandleDispatchError(self, ecb): + """Handles errors in the Dispatch method. + + When a Dispatch method call fails, this method is called to handle + the exception. The default implementation formats the traceback + in the browser. + """ ecb.HttpStatusCode = isapicon.HSE_STATUS_ERROR #control_block.LogData = "we failed!" Index: simple.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pyisapi/isapi/simple.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** simple.py 4 Sep 2004 09:36:12 -0000 1.2 --- simple.py 11 Sep 2004 07:44:32 -0000 1.3 *************** *** 1,3 **** ! # A simple skeleton for an ISAPI extension. class SimpleExtension: --- 1,11 ---- ! """Simple base-classes for extensions and filters. ! ! None of the filter and extension functions are considered 'optional' by the ! framework. These base-classes provide simple implementations for the ! Initialize and Terminate functions, allowing you to omit them, ! ! It is not necessary to use these base-classes - but if you don't, you ! must ensure each of the required methods are implemented. ! """ class SimpleExtension: *************** *** 7,10 **** --- 15,22 ---- def GetExtensionVersion(self, vi): + """Called by the ISAPI framework to get the extension version + + The default implementation uses the classes docstring to + set the extension description.""" # nod to our reload capability - vi is None when we are reloaded. if vi is not None: *************** *** 12,18 **** --- 24,36 ---- def HttpExtensionProc(self, control_block): + """Called by the ISAPI framework for each extension request. + + sub-classes must provide an implementation for this method. + """ raise NotImplementedError, "sub-classes should override HttpExtensionProc" def TerminateExtension(self, status): + """Called by the ISAPI framework as the extension terminates. + """ pass *************** *** 24,27 **** --- 42,52 ---- def GetFilterVersion(self, fv): + """Called by the ISAPI framework to get the extension version + + The default implementation uses the classes docstring to + set the extension description, and uses the classes + filter_flags attribute to set the ISAPI filter flags - you + must specify filter_flags in your class. + """ if self.filter_flags is None: raise RuntimeError, "You must specify the filter flags" *************** *** 32,38 **** --- 57,69 ---- def HttpFilterProc(self, fc): + """Called by the ISAPI framework for each filter request. + + sub-classes must provide an implementation for this method. + """ raise NotImplementedError, "sub-classes should override HttpExtensionProc" def TerminateFilter(self, status): + """Called by the ISAPI framework as the filter terminates. + """ pass \ No newline at end of file Index: install.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pyisapi/isapi/install.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** install.py 9 Sep 2004 06:52:47 -0000 1.5 --- install.py 11 Sep 2004 07:44:32 -0000 1.6 *************** *** 1,3 **** ! # Installation utilities for Python ISAPI filters and extensions # this code adapted from "Tomcat JK2 ISAPI redirector", part of Apache --- 1,3 ---- ! """Installation utilities for Python ISAPI filters and extensions.""" # this code adapted from "Tomcat JK2 ISAPI redirector", part of Apache *************** *** 395,398 **** --- 395,408 ---- default_arg = "install", opt_parser = None, custom_arg_handlers = {}): + """Perform installation or removal of an ISAPI filter or extension. + + This module handles standard command-line options and configuration + information, and installs, removes or updates the configuration of an + ISAPI filter or extension. + + You must pass your configuration information in params - all other + arguments are optional, and allow you to configure the installation + process. + """ global verbose from optparse import OptionParser |
From: Mark H. <mha...@us...> - 2004-09-11 07:43:49
|
Update of /cvsroot/pywin32/pywin32/AutoDuck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8609 Added Files: py2d.py Log Message: simple tool to grab docstrings from modules and write a .d file autoduck understands --- NEW FILE: py2d.py --- import sys import types class DocInfo: def __init__(self, name, ob): self.name = name self.ob = ob self.short_desc = "" self.desc = "" def BuildArgInfos(ob): ret = [] vars = list(ob.func_code.co_varnames[:ob.func_code.co_argcount]) vars.reverse() # for easier default checking. defs = list(ob.func_defaults or []) for i, n in enumerate(vars): info = DocInfo(n, ob) info.short_desc = info.desc = n info.default = "" if len(defs): info.default = defs.pop() ret.append(info) ret.reverse() return ret def BuildInfo(name, ob): ret = DocInfo(name, ob) docstring = ob.__doc__ or "" ret.desc = ret.short_desc = docstring.strip() if ret.desc: ret.short_desc = ret.desc.splitlines()[0] return ret def format_desc(desc): if not desc: return "" lines = desc.splitlines() chunks = [lines[0]] for line in lines[1:]: line = line.strip() if not line: line = "<nl>" chunks.append( "// " + line ) return "\n".join(chunks) def build_module(fp, mod_name): __import__(mod_name) mod = sys.modules[mod_name] functions = [] classes = [] constants = [] for name, ob in mod.__dict__.items(): if name.startswith("_"): continue if hasattr(ob, "__module__") and ob.__module__ != mod_name: continue if type(ob)==types.ClassType: classes.append(BuildInfo(name, ob)) elif type(ob)==types.FunctionType: functions.append(BuildInfo(name, ob)) elif name.upper()==name and type(ob) in (int, str): constants.append( (name, ob) ) info = BuildInfo(mod_name, mod) print >> fp, "// @module %s|%s" % (mod_name, format_desc(info.desc)) for ob in functions: print >> fp, "// @pymeth %s|%s" % (ob.name, ob.short_desc) for ob in functions: print >> fp, "// @pymethod |%s|%s|%s" % (mod_name, ob.name, format_desc(ob.desc)) for ai in BuildArgInfos(ob.ob): print >> fp, "// @pyparm |%s|%s|%s" % (ai.name, ai.default, ai.short_desc) for ob in classes: ob_name = mod_name + "." + ob.name print >> fp, "// @object %s|%s" % (ob_name, format_desc(ob.desc)) func_infos = [] for n, o in ob.ob.__dict__.items(): if type(o)==types.FunctionType: info = BuildInfo(n, o) func_infos.append(info) for fi in func_infos: print >> fp, "// @pymeth %s|%s" % (fi.name, fi.short_desc) for fi in func_infos: print >> fp, "// @pymethod |%s|%s|%s" % (ob_name, fi.name, format_desc(fi.desc)) for ai in BuildArgInfos(fi.ob): print >> fp, "// @pyparm |%s|%s|%s" % (ai.name, ai.default, ai.short_desc) for (name, val) in constants: desc = "%s = %r" % (name, val) if type(val) in (int, long): desc += " (0x%x)" % (val,) print >> fp, "// @const %s|%s|%s" % (mod_name, name, desc) def main(fp, args): print >> fp, "// @doc" for arg in args: build_module(sys.stdout, arg) if __name__=='__main__': main(sys.stdout, sys.argv[1:]) |
From: Mark H. <mha...@us...> - 2004-09-11 07:43:14
|
Update of /cvsroot/pywin32/pywin32/AutoDuck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8531 Modified Files: pywin32.mak Log Message: Add isapi docs. Index: pywin32.mak =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/pywin32.mak,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pywin32.mak 7 Sep 2004 03:04:16 -0000 1.6 --- pywin32.mak 11 Sep 2004 07:43:01 -0000 1.7 *************** *** 18,21 **** --- 18,24 ---- PYTHONWIN_DIR = ../pythonwin + ISAPI_DIR = ../pyisapi + ISAPI_SOURCE_DIR = $(ISAPI_DIR)/src + # Extraneous HTML files to include into the .CHM: *************** *** 26,29 **** --- 29,33 ---- $(WIN32COM_HELP_DIR)/*.htm* \ $(WIN32COMEXT_DIR)/axscript/demos/client/ie/* \ + $(ISAPI_DIR)/doc/*.html \ $(PYTHONWIN_DIR)/readme.html $(PYTHONWIN_DIR)/doc/* $(PYTHONWIN_DIR)/doc/debugger/* \ *************** *** 80,84 **** $(PYTHONWIN_DIR)\contents.d $(PYTHONWIN_DIR)\*.cpp $(PYTHONWIN_DIR)\*.h ! SOURCE=$(WIN32_SOURCE) $(WIN32COM_SOURCE) $(PYTHONWIN_SOURCE) DOCUMENT_FILE = pywin32-document.xml --- 84,91 ---- $(PYTHONWIN_DIR)\contents.d $(PYTHONWIN_DIR)\*.cpp $(PYTHONWIN_DIR)\*.h ! ISAPI_SOURCE = \ ! $(ISAPI_SOURCE_DIR)\*.cpp $(ISAPI_SOURCE_DIR)\*.h $(GENDIR)\isapi_modules.d ! ! SOURCE=$(WIN32_SOURCE) $(WIN32COM_SOURCE) $(PYTHONWIN_SOURCE) $(ISAPI_SOURCE) DOCUMENT_FILE = pywin32-document.xml *************** *** 95,98 **** --- 102,110 ---- clean: cleanad + pseudo: + + $(GENDIR)\isapi_modules.d: py2d.py pseudo + $(PYTHON) py2d.py isapi isapi.install isapi.simple isapi.threaded_extension isapi.isapicon > $(GENDIR)\isapi_modules.d + "$(GENDIR)\$(TARGET).hhc" : $(SOURCE) Dump2HHC.py $(DOCUMENT_FILE) rem Run autoduck over each category so we can create a nested TOC. *************** *** 100,107 **** $(ADHTMLFMT) /r html "/O$(GENDIR)\temp.html" "/G$(GENDIR)\pythonwin.dump" /t8 $(PYTHONWIN_SOURCE) $(ADHTMLFMT) /r html "/O$(GENDIR)\temp.html" "/G$(GENDIR)\com.dump" /t8 $(WIN32COM_SOURCE) $(PYTHON) Dump2HHC.py "$(GENDIR)" "$(GENDIR)\$(TARGET).hhc" "$(TITLE)" "$(TARGET)" - @del $(GENDIR)\win32.dump - @del $(GENDIR)\pythonwin.dump - @del $(GENDIR)\com.dump --- 112,117 ---- $(ADHTMLFMT) /r html "/O$(GENDIR)\temp.html" "/G$(GENDIR)\pythonwin.dump" /t8 $(PYTHONWIN_SOURCE) $(ADHTMLFMT) /r html "/O$(GENDIR)\temp.html" "/G$(GENDIR)\com.dump" /t8 $(WIN32COM_SOURCE) + $(ADHTMLFMT) /r html "/O$(GENDIR)\temp.html" "/G$(GENDIR)\isapi.dump" /t8 $(ISAPI_SOURCE) $(PYTHON) Dump2HHC.py "$(GENDIR)" "$(GENDIR)\$(TARGET).hhc" "$(TITLE)" "$(TARGET)" |
From: Mark H. <mha...@us...> - 2004-09-11 07:40:31
|
Update of /cvsroot/pywin32/pywin32/AutoDuck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8225 Modified Files: BuildHHP.py Log Message: Split constants into categories Index: BuildHHP.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/BuildHHP.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** BuildHHP.py 17 Apr 2002 14:06:19 -0000 1.8 --- BuildHHP.py 11 Sep 2004 07:40:22 -0000 1.9 *************** *** 111,115 **** for cat in doc: html_files = html_files + '%s\\%s.html\n' % (output_dir, cat.id) ! for suffix in "_overview _modules _objects".split(): html_files = html_files + '%s\\%s%s.html\n' % (output_dir, cat.id, suffix) --- 111,115 ---- for cat in doc: html_files = html_files + '%s\\%s.html\n' % (output_dir, cat.id) ! for suffix in "_overview _modules _objects _constants".split(): html_files = html_files + '%s\\%s%s.html\n' % (output_dir, cat.id, suffix) |
From: Mark H. <mha...@us...> - 2004-09-11 07:39:54
|
Update of /cvsroot/pywin32/pywin32/AutoDuck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8085 Modified Files: Dump2HHC.py Log Message: HAve constants correctly split into categories. Index: Dump2HHC.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/Dump2HHC.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Dump2HHC.py 7 Sep 2004 22:17:00 -0000 1.5 --- Dump2HHC.py 11 Sep 2004 07:39:43 -0000 1.6 *************** *** 23,26 **** --- 23,27 ---- self.overviewTopics = {} self.extOverviewTopics = {} + self.constants = {} def process(self): *************** *** 81,85 **** # tagnames we care about: ! lTags = ["module", "object", "topic"] line = input.readline() if line == '': --- 82,86 ---- # tagnames we care about: ! lTags = ["module", "object", "topic", "const"] line = input.readline() if line == '': *************** *** 136,141 **** elif top.type == "topic": d = cat.overviewTopics ! assert not d.has_key(top.name), "Duplicate named module/object/topic detected: " + top.name # Skip the property fields line for module/object --- 137,147 ---- elif top.type == "topic": d = cat.overviewTopics + elif top.type == "const": + d = cat.constants + else: + raise RuntimeError, "What is '%s'" % (top.type,) ! if d.has_key(top.name): ! print "Duplicate named %s detected: %s" % (top.type, top.name) # Skip the property fields line for module/object *************** *** 245,250 **** _genOneCategoryHTML(output_dir, cat, "Modules", "_modules", cat.modules) _genOneCategoryHTML(output_dir, cat, "Objects", "_objects", cat.objects) ! def _genItemsFromDict(dict, cat, output, target): CHM = "mk:@MSITStore:%s.chm::/" % target keys = dict.keys() --- 251,257 ---- _genOneCategoryHTML(output_dir, cat, "Modules", "_modules", cat.modules) _genOneCategoryHTML(output_dir, cat, "Objects", "_objects", cat.objects) + _genOneCategoryHTML(output_dir, cat, "Constants", "_constants", cat.constants) ! def _genItemsFromDict(dict, cat, output, target, do_children = 1): CHM = "mk:@MSITStore:%s.chm::/" % target keys = dict.keys() *************** *** 260,263 **** --- 267,272 ---- </OBJECT> ''' % locals()) + if not do_children: + continue if len(dict[k].contains) > 0: output.write("<UL>") *************** *** 339,343 **** </OBJECT> <UL>''' % locals()) ! _genItemsFromDict(cat.objects, cat, output, target) output.write(''' </UL>''') --- 348,353 ---- </OBJECT> <UL>''' % locals()) ! # Dont show 'children' for objects - params etc don't need their own child nodes! ! _genItemsFromDict(cat.objects, cat, output, target, do_children=0) output.write(''' </UL>''') *************** *** 347,353 **** <param name="Name" value="Constants"> <param name="ImageNumber" value="1"> ! <param name="Local" value="%(CHM)sconstants.html"> </OBJECT> ! ''' % { "CHM" : CHM}) # Finish this category output.write(''' --- 357,367 ---- <param name="Name" value="Constants"> <param name="ImageNumber" value="1"> ! <param name="Local" value="%(CHM)s%(cat_id)s_constants.html"> </OBJECT> ! <UL> ! ''' % locals()) ! _genItemsFromDict(cat.constants, cat, output, target) ! output.write(""" ! </UL>""") # Finish this category output.write(''' |
From: Mark H. <mha...@us...> - 2004-09-11 07:39:17
|
Update of /cvsroot/pywin32/pywin32/AutoDuck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7988 Modified Files: common.mak Log Message: Make 'clean' just nuke the temp dir Index: common.mak =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/common.mak,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** common.mak 7 Sep 2004 03:04:16 -0000 1.9 --- common.mak 11 Sep 2004 07:39:08 -0000 1.10 *************** *** 5,21 **** cleanad: ! if exist "$(GENDIR)\*.rtf" del "$(GENDIR)\*.rtf" ! if exist "$(GENDIR)\*.hpj" del "$(GENDIR)\*.hpj" ! if exist "$(GENDIR)\*.log" del "$(GENDIR)\*.log" ! if exist "$(GENDIR)\*.hlog" del "$(GENDIR)\*.hlog" ! if exist "$(GENDIR)\*.hhlog" del "$(GENDIR)\*.hhlog" ! if exist "$(GENDIR)\*.doc" del "$(GENDIR)\*.doc" ! if exist "$(GENDIR)\*.hlp" del "$(GENDIR)\*.hlp" ! if exist "$(GENDIR)\*.html" del "$(GENDIR)\*.html" ! if exist "$(GENDIR)\*.idx" del "$(GENDIR)\*.idx" ! if exist "$(GENDIR)\*.dump" del "$(GENDIR)\*.dump" ! if exist "$(GENDIR)\*.hhk" del "$(GENDIR)\*.hhk" ! if exist "$(GENDIR)\*.hhc" del "$(GENDIR)\*.hhc" ! if exist "$(GENDIR)\html\*" rd /s /q "$(GENDIR)\html" # Generate a Help file --- 5,9 ---- cleanad: ! if exist "$(GENDIR)\*" del "$(GENDIR)\*" /q # Generate a Help file |
From: Mark H. <mha...@us...> - 2004-09-11 07:38:34
|
Update of /cvsroot/pywin32/pywin32/AutoDuck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7908 Modified Files: pywin32-document.xml Log Message: Add a new top-level ISAPI category Index: pywin32-document.xml =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/pywin32-document.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pywin32-document.xml 18 Aug 2002 06:03:03 -0000 1.2 --- pywin32-document.xml 11 Sep 2004 07:38:25 -0000 1.3 *************** *** 28,30 **** --- 28,35 ---- </overviews> </category> + <category id="isapi" label="ISAPI filters and extensions"> + <overviews> + <item name="Introduction to Python ISAPI support" href="pyisapi/doc/isapi.html"/> + </overviews> + </category> </document> |
From: Mark H. <mha...@us...> - 2004-09-10 21:55:58
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24075 Modified Files: PythonService.cpp Log Message: * Add RunningAsService() * Correctly initialize a static array (which I'm amazed didn't crash!) * Prevent 2 log messages on a simple import error. * Add extra comments to indicate how the control flow. Index: PythonService.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PythonService.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** PythonService.cpp 20 Feb 2004 08:10:43 -0000 1.13 --- PythonService.cpp 10 Sep 2004 06:58:57 -0000 1.14 *************** *** 36,39 **** --- 36,40 ---- TCHAR g_szEventSourceName[MAX_PATH] = _T("Python Service"); BOOL bServiceDebug = FALSE; + BOOL bServiceRunning = FALSE; // Globals *************** *** 68,72 **** // The global SCM dispatch table. A trailing NULL indicates to the SCM // how many are used - as we add new entries, we null the next. ! static SERVICE_TABLE_ENTRY DispatchTable[] = { { NULL, NULL } --- 69,73 ---- // The global SCM dispatch table. A trailing NULL indicates to the SCM // how many are used - as we add new entries, we null the next. ! static SERVICE_TABLE_ENTRY DispatchTable[MAX_SERVICES] = { { NULL, NULL } *************** *** 321,324 **** --- 322,336 ---- } + // @pymethod True/False|servicemanager|RunningAsService|Indicates if the code is + // being executed as a service. + static PyObject *PyRunningAsService(PyObject *self, PyObject *args) + { + if (!PyArg_ParseTuple(args, ":RunningAsService")) + return NULL; + PyObject *rc = bServiceRunning ? Py_True : Py_False; + Py_INCREF(rc); + return rc; + } + // @pymethod int|servicemanager|PumpWaitingMessages|Pumps all waiting messages. // @rdesc Returns 1 if a WM_QUIT message was received, else 0 *************** *** 442,445 **** --- 454,458 ---- {"PrepareToHostSingle", PyPrepareToHostSingle, 1}, // @pymeth PrepareToHostSingle| {"PrepareToHostMultiple", PyPrepareToHostMultiple, 1}, // @pymeth PrepareToHostMultiple| + {"RunningAsService", PyRunningAsService, 1}, // @pymeth RunningAsService|Indicates if the code is running as a service. {NULL} }; *************** *** 736,742 **** --- 749,763 ---- PyObject *start = NULL; + bServiceRunning = TRUE; if (bServiceDebug) SetConsoleCtrlHandler( DebugControlHandler, TRUE ); + // NOTE: If possible, we want to always call RegisterServiceCtrlHandlerEx, + // even in error situations. Otherwise Windows will get a little upset + // and turn us into a zombie. Grabbing the service handle and reporting + // an error condition works correctly, whereas exiting doesn't. + // Note also that in the usual, non-error case, + // RegisterServiceCtrlHandlerEx is actually called via the Python code + // (servicemanager.RegisterServiceCtrlHandler), not via us. CEnterLeavePython _celp; PY_SERVICE_TABLE_ENTRY *pe; *************** *** 753,760 **** LPTSTR lpszStrings[] = {lpszArgv[0], NULL}; ReportError(E_PYS_NO_SERVICE, (LPCTSTR *)lpszStrings); goto cleanup; } assert(pe->sshStatusHandle==0); // should have no scm handle yet. ! instance = LoadPythonServiceInstance(pe->klass, dwArgc, lpszArgv); // If Python has not yet registered the service control handler, then // we are in serious trouble - it is likely the service will enter a --- 774,784 ---- LPTSTR lpszStrings[] = {lpszArgv[0], NULL}; ReportError(E_PYS_NO_SERVICE, (LPCTSTR *)lpszStrings); + // This is still yucky and will send us zombie. It should never happen + // and needs too much of a reorg to fix. goto cleanup; } assert(pe->sshStatusHandle==0); // should have no scm handle yet. ! if (pe->klass) // avoid an extra redundant log message. ! instance = LoadPythonServiceInstance(pe->klass, dwArgc, lpszArgv); // If Python has not yet registered the service control handler, then // we are in serious trouble - it is likely the service will enter a *************** *** 764,771 **** // is rooted (that is a technical term!) if (!bServiceDebug && pe->sshStatusHandle==0) { ! // If Python seemed to init OK, but hasnt done what we expect, ! // report an error, as we are gunna fail! if (instance) ReportPythonError(E_PYS_NOT_CONTROL_HANDLER); if (!bServiceDebug) // Note - we upgraded this to the win2k only "Ex" function. --- 788,798 ---- // is rooted (that is a technical term!) if (!bServiceDebug && pe->sshStatusHandle==0) { ! // If we don't have a pe->sshStatusHandle(), then the Python code ! // failed to register itself with the SCM. ! // If we have an instance, it means that instance simply neglected ! // to do the right thing - report that as an error. if (instance) ReportPythonError(E_PYS_NOT_CONTROL_HANDLER); + // else no instance - an error has already been reported. if (!bServiceDebug) // Note - we upgraded this to the win2k only "Ex" function. *************** *** 1011,1020 **** if (obPath==NULL) { ReportPythonError(PYS_E_NO_SYS_PATH); ! return FALSE; } PyObject *obNew = PyString_FromString(valueBuf); if (obNew==NULL) { ReportPythonError(PYS_E_NO_MEMORY_FOR_SYS_PATH); ! return FALSE; } PyList_Append(obPath, obNew); --- 1038,1047 ---- if (obPath==NULL) { ReportPythonError(PYS_E_NO_SYS_PATH); ! return NULL; } PyObject *obNew = PyString_FromString(valueBuf); if (obNew==NULL) { ReportPythonError(PYS_E_NO_MEMORY_FOR_SYS_PATH); ! return NULL; } PyList_Append(obPath, obNew); |
From: Mark H. <mha...@us...> - 2004-09-10 06:33:37
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/service In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18086 Modified Files: pipeTestService.py Log Message: Move the import of servicemanager to the top-level, and add comments. Index: pipeTestService.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/service/pipeTestService.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pipeTestService.py 12 Mar 2003 12:24:39 -0000 1.4 --- pipeTestService.py 10 Sep 2004 06:20:36 -0000 1.5 *************** *** 19,22 **** --- 19,27 ---- from ntsecuritycon import * + # Old versions of the service framework would not let you import this + # module at the top-level. Now you can, and can check 'Debugging()' and + # 'RunningAsService()' to check your context. + import servicemanager + import traceback import thread *************** *** 103,107 **** # Write an event log record - in debug mode we will also # see this message printed. - import servicemanager servicemanager.LogMsg( servicemanager.EVENTLOG_INFORMATION_TYPE, --- 108,111 ---- |
From: Roger U. <ru...@us...> - 2004-09-10 04:17:16
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28251/win32/src Modified Files: PyDEVMODE.cpp PyWinObjects.h Log Message: Add a method to PyDEVMODE to propagate changes when an Api function modifies a DEVMODE, use null PyObject pointer for manually handled properties Index: PyWinObjects.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinObjects.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyWinObjects.h 7 Sep 2004 04:27:02 -0000 1.7 --- PyWinObjects.h 10 Sep 2004 03:40:21 -0000 1.8 *************** *** 239,243 **** --- 239,247 ---- static PyObject *Clear(PyObject *self, PyObject *args); static PyObject *tp_new(PyTypeObject *, PyObject *, PyObject *); + // use this where a function modifies a passed-in PyDEVMODE to make changes visible to Python + void modify_in_place(void) + {memcpy(&devmode, pdevmode, pdevmode->dmSize);} PDEVMODE GetDEVMODE(void); + PyObject *obdummy; protected: // Pointer to variable length DEVMODE with dmDriverExtra bytes allocated at end, always use this externally Index: PyDEVMODE.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyDEVMODE.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyDEVMODE.cpp 7 Sep 2004 04:27:04 -0000 1.1 --- PyDEVMODE.cpp 10 Sep 2004 03:40:21 -0000 1.2 *************** *** 1,6 **** --- 1,8 ---- + // @doc - This file contains autoduck documentation #include "PyWinTypes.h" #include "structmember.h" #include "PyWinObjects.h" + // @object PyDEVMODE|Python object wrapping a DEVMODE structure struct PyMethodDef PyDEVMODE::methods[] = { {"Clear", PyDEVMODE::Clear, 1}, // @pymeth Clear|Resets all members of the structure *************** *** 11,15 **** struct PyMemberDef PyDEVMODE::members[] = { // DeviceName is a dummy so it will show up in property list, get and set handle manually ! {"DeviceName", T_OBJECT, 0, 0, "String of at most 32 chars"}, {"SpecVersion", T_USHORT, OFF(devmode.dmSpecVersion), 0, "Should always be set to DM_SPECVERSION"}, {"DriverVersion", T_USHORT, OFF(devmode.dmDriverVersion), 0, ""}, --- 13,17 ---- struct PyMemberDef PyDEVMODE::members[] = { // DeviceName is a dummy so it will show up in property list, get and set handle manually ! {"DeviceName", T_OBJECT, OFF(obdummy), 0, "String of at most 32 chars"}, {"SpecVersion", T_USHORT, OFF(devmode.dmSpecVersion), 0, "Should always be set to DM_SPECVERSION"}, {"DriverVersion", T_USHORT, OFF(devmode.dmDriverVersion), 0, ""}, *************** *** 34,39 **** {"YResolution", T_SHORT, OFF(devmode.dmYResolution), 0, "Vertical printer resolution in DPI - if this is set, PrintQuality indicates horizontal DPI"}, {"TTOption", T_SHORT, OFF(devmode.dmTTOption), 0, "TrueType options: DMTT_BITMAP, DMTT_DOWNLOAD, DMTT_DOWNLOAD_OUTLINE, DMTT_SUBDEV"}, ! {"Collate", T_SHORT, OFF(devmode.dmCollate), 0, "DMCOLLATE_TRUE or DMCOLLATE_FLASE"}, ! {"FormName", T_OBJECT, 0, 0, "String of at most 32 chars"}, // same semantics as DeviceName {"LogPixels", T_USHORT, OFF(devmode.dmLogPixels), 0, "Pixels per inch (only for display devices)"}, {"BitsPerPel", T_ULONG, OFF(devmode.dmBitsPerPel), 0, "Color resolution in bits per pixel"}, --- 36,41 ---- {"YResolution", T_SHORT, OFF(devmode.dmYResolution), 0, "Vertical printer resolution in DPI - if this is set, PrintQuality indicates horizontal DPI"}, {"TTOption", T_SHORT, OFF(devmode.dmTTOption), 0, "TrueType options: DMTT_BITMAP, DMTT_DOWNLOAD, DMTT_DOWNLOAD_OUTLINE, DMTT_SUBDEV"}, ! {"Collate", T_SHORT, OFF(devmode.dmCollate), 0, "DMCOLLATE_TRUE or DMCOLLATE_FLASE"}, ! {"FormName", T_OBJECT, OFF(obdummy), 0, "String of at most 32 chars"}, // same semantics as DeviceName {"LogPixels", T_USHORT, OFF(devmode.dmLogPixels), 0, "Pixels per inch (only for display devices)"}, {"BitsPerPel", T_ULONG, OFF(devmode.dmBitsPerPel), 0, "Color resolution in bits per pixel"}, *************** *** 51,60 **** {"PanningWidth", T_ULONG, OFF(devmode.dmPanningWidth), 0, ""}, {"PanningHeight", T_ULONG, OFF(devmode.dmPanningHeight), 0, ""}, ! {"DriverData", T_OBJECT, OFF(devmode)+sizeof(DEVMODE), 0, "Driver data appended to end of structure"}, {NULL} }; - - // @object PyDEVMODE|Python object wrapping a DEVMODE structure PYWINTYPES_EXPORT PyTypeObject PyDEVMODEType = { --- 53,60 ---- {"PanningWidth", T_ULONG, OFF(devmode.dmPanningWidth), 0, ""}, {"PanningHeight", T_ULONG, OFF(devmode.dmPanningHeight), 0, ""}, ! {"DriverData", T_OBJECT, OFF(obdummy), 0, "Driver data appended to end of structure"}, {NULL} }; PYWINTYPES_EXPORT PyTypeObject PyDEVMODEType = { *************** *** 110,113 **** --- 110,114 ---- else; memcpy(pdevmode, pdm, pdm->dmSize + pdm->dmDriverExtra); + obdummy=NULL; _Py_NewReference(this); } *************** *** 124,127 **** --- 125,129 ---- devmode.dmSize=dmSize; devmode.dmSpecVersion=DM_SPECVERSION; + obdummy=NULL; _Py_NewReference(this); } *************** *** 140,143 **** --- 142,146 ---- devmode.dmSpecVersion=DM_SPECVERSION; devmode.dmDriverExtra=dmDriverExtra; + obdummy=NULL; _Py_NewReference(this); } *************** *** 168,171 **** --- 171,175 ---- } + // @pymethod |PyDEVMODE|Clear|Resets all members of the structure PyObject *PyDEVMODE::Clear(PyObject *self, PyObject *args) { |
From: Trent M. <tm...@us...> - 2004-09-09 17:18:57
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25685 Modified Files: setup_win32all.py Log Message: Add instructions for getting the build files required for the axdebug extension and change the expected lib name to "ad1", from the old "msdbg". Index: setup_win32all.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup_win32all.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** setup_win32all.py 7 Sep 2004 10:15:54 -0000 1.30 --- setup_win32all.py 9 Sep 2004 17:18:33 -0000 1.31 *************** *** 19,22 **** --- 19,28 ---- warnings; if you do use them, you must install the correct libraries. + The 'axdebug' extension requires Active Debugging dev files available here: + http://support.microsoft.com/default.aspx?kbid=223389 + Download Scriptng.exe, unpack the files to a temporary directory and manually + copy the .h and .lib files to your Platform SDK installation's include + and lib directories, respectively -- overwriting some files of the same name. + To install the win32all extensions, execute: python setup_win32all.py -q install *************** *** 852,856 **** WinExt_win32com('axdebug', dsp_file=r"com\Active Debugging.dsp", ! libraries="axscript msdbg", # ad1.lib should work, but fails in debug? pch_header = "stdafx.h", ), --- 858,862 ---- WinExt_win32com('axdebug', dsp_file=r"com\Active Debugging.dsp", ! libraries="axscript ad1", pch_header = "stdafx.h", ), |