put all abstract methods together

This commit is contained in:
Michel Oosterhof
2015-03-10 09:40:18 +00:00
parent 79bc99f47a
commit e53840355a

View File

@@ -74,8 +74,6 @@ class Output(object):
# return self.emit( msg )
# elif isinstance( msg, str ):
# return self.emit( { 'message':msg, 'sessionid':sessionid } )
# used when the HoneypotTransport prefix is not available.
def logDispatch(self, *msg, **kw):
ev = kw
ev['message'] = msg
@@ -91,6 +89,11 @@ class Output(object):
"""Abstract method to shut down output plugin"""
pass
@abc.abstractmethod
def handleLog( self, session, event ):
"""Handle a general event within the output plugin"""
pass
# this is the main emit() hook that gets called by the the Twisted logging
def emit(self, event):
# ignore stdout and stderr in output plugins
@@ -139,9 +142,4 @@ class Output(object):
self.handleLog( self.sessions[sessionno], ev )
# print "error calling handleLog for event %s" % repr(ev)
@abc.abstractmethod
def handleLog( self, session, event ):
"""Handle a general event within the output plugin"""
pass
# vim: set sw=4 et: