mirror of https://github.com/Mikaela/Limnoria.git
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. '
|
'reloaded the plugin and it didn\'t properly unhook. '
|
||||||
'Forced unhook.') % subdir)
|
'Forced unhook.') % subdir)
|
||||||
self.callbacks[subdir] = callback
|
self.callbacks[subdir] = callback
|
||||||
|
callback.doHook(self, subdir)
|
||||||
def unhook(self, subdir):
|
def unhook(self, subdir):
|
||||||
callback = self.callbacks.pop(subdir) # May raise a KeyError. We don't care.
|
callback = self.callbacks.pop(subdir) # May raise a KeyError. We don't care.
|
||||||
callback.doUnhook(self)
|
callback.doUnhook(self)
|
||||||
|
@ -283,6 +284,9 @@ class SupyHTTPServerCallback(object):
|
||||||
|
|
||||||
doPost = doHead = doGet
|
doPost = doHead = doGet
|
||||||
|
|
||||||
|
def doHook(self, handler, subdir):
|
||||||
|
"""Method called when hooking this callback."""
|
||||||
|
pass
|
||||||
def doUnhook(self, handler):
|
def doUnhook(self, handler):
|
||||||
"""Method called when unhooking this callback."""
|
"""Method called when unhooking this callback."""
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue