mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 19:22:45 +01:00
httpserver: add method 'doHook' to callbacks.
This commit is contained in:
parent
9457f4dbe7
commit
38d78a4213
@ -184,6 +184,7 @@ class RealSupyHTTPServer(HTTPServer):
|
||||
'reloaded the plugin and it didn\'t properly unhook. '
|
||||
'Forced unhook.') % subdir)
|
||||
self.callbacks[subdir] = callback
|
||||
callback.doHook(self, subdir)
|
||||
def unhook(self, subdir):
|
||||
callback = self.callbacks.pop(subdir) # May raise a KeyError. We don't care.
|
||||
callback.doUnhook(self)
|
||||
@ -283,6 +284,9 @@ class SupyHTTPServerCallback(object):
|
||||
|
||||
doPost = doHead = doGet
|
||||
|
||||
def doHook(self, handler, subdir):
|
||||
"""Method called when hooking this callback."""
|
||||
pass
|
||||
def doUnhook(self, handler):
|
||||
"""Method called when unhooking this callback."""
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user