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
|