o
    ª›h
  ã                   @  s0   d Z ddlmZ G dd„ dƒZG dd„ dƒZdS )aƒ  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.
é    )Úannotationsc                   @  s0   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
S )ÚSimpleExtensionz'Base class for a simple ISAPI extensionc                 C  ó   d S ©N© ©Úselfr   r   úBc:\Users\shubh\Videos\agent\nova\Lib\site-packages\isapi/simple.pyÚ__init__   ó   zSimpleExtension.__init__c                 C  s   |dur
| j |_dS dS )z£Called by the ISAPI framework to get the extension version

        The default implementation uses the classes docstring to
        set the extension description.N)Ú__doc__ZExtensionDesc)r   Úvir   r   r	   ÚGetExtensionVersion   s   ÿz#SimpleExtension.GetExtensionVersionc                 C  ó   t dƒ‚)z‡Called by the ISAPI framework for each extension request.

        sub-classes must provide an implementation for this method.
        ú-sub-classes should override HttpExtensionProc©ÚNotImplementedError)r   Zcontrol_blockr   r   r	   ÚHttpExtensionProc   ó   z!SimpleExtension.HttpExtensionProcc                 C  ó   dS )z:Called by the ISAPI framework as the extension terminates.Nr   ©r   Ústatusr   r   r	   ÚTerminateExtension$   ó   z"SimpleExtension.TerminateExtensionN)Ú__name__Ú
__module__Ú__qualname__r   r
   r   r   r   r   r   r   r	   r      s    	r   c                   @  s>   e Zd ZU dZdZded< dd„ Zdd„ Zd	d
„ Zdd„ Z	dS )ÚSimpleFilterz&Base class for a a simple ISAPI filterNz
int | NoneÚfilter_flagsc                 C  r   r   r   r   r   r   r	   r
   .   r   zSimpleFilter.__init__c                 C  s2   | j du r	tdƒ‚|dur| j |_| j|_dS dS )a5  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.
        Nz!You must specify the filter flags)r   ÚRuntimeErrorÚFlagsr   Z
FilterDesc)r   Zfvr   r   r	   ÚGetFilterVersion1   s   
þzSimpleFilter.GetFilterVersionc                 C  r   )z„Called by the ISAPI framework for each filter request.

        sub-classes must provide an implementation for this method.
        r   r   )r   Zfcr   r   r	   ÚHttpFilterProc@   r   zSimpleFilter.HttpFilterProcc                 C  r   )z7Called by the ISAPI framework as the filter terminates.Nr   r   r   r   r	   ÚTerminateFilterG   r   zSimpleFilter.TerminateFilter)
r   r   r   r   r   Ú__annotations__r
   r!   r"   r#   r   r   r   r	   r   )   s   
 r   N)r   Ú
__future__r   r   r   r   r   r   r	   Ú<module>   s    
