"""Abstract base middleware class (optional use)."""fromabcimportABC,abstractmethodfromwsgidav.utilimportNO_DEFAULT,get_dict_value__docformat__="reStructuredText"
[docs]classBaseMiddleware(ABC):"""Abstract base middleware class (optional). Note: this is a convenience class, that *may* be used to implement WsgiDAV middlewares. However it is not a reqiuement: any object that implements the WSGI specification can be added to the stack. Derived classes in WsgiDAV include:: wsgidav.dir_browser.WsgiDavDirBrowser wsgidav.mw.debug_filter.WsgiDavDebugFilter wsgidav.error_printer.ErrorPrinter wsgidav.http_authenticator.HTTPAuthenticator wsgidav.request_resolver.RequestResolver """def__init__(self,wsgidav_app,next_app,config):self.wsgidav_app=wsgidav_appself.next_app=next_appself.config=configself.verbose=config.get("verbose",3)
[docs]defis_disabled(self):"""Optionally return True to skip this module on startup."""returnFalse
[docs]defget_config(self,key_path:str,default=NO_DEFAULT):"""Optionally return True to skip this module on startup."""res=get_dict_value(self.config,key_path,default)returnres