X-Git-Url: https://git.llucax.com/software/pymin.git/blobdiff_plain/83738d4fffe1910d9d75849657086d2e4e921a15..d6dfd46ed31d985e364b9ea9a404c394f15c2348:/pymindaemon.py diff --git a/pymindaemon.py b/pymindaemon.py index b7e56e4..b440c52 100644 --- a/pymindaemon.py +++ b/pymindaemon.py @@ -70,11 +70,11 @@ class PyminDaemon(eventloop.EventLoop): response = u'ERROR ' except Exception, e: import traceback - result = u'Internal server error' + result = u'Internal server error\n' traceback.print_exc() # TODO logging! response = u'ERROR ' if result is None: - response += u'0' + response += u'0\n' else: response += u'%d\n%s' % (len(result), result) self.file.sendto(response, addr) @@ -88,13 +88,11 @@ class PyminDaemon(eventloop.EventLoop): if __name__ == '__main__': - from dispatcher import handler - - @handler + @handler(u"Print all the arguments, return nothing.") def test_handler(*args): print 'test:', args - @handler + @handler(u"Echo the message passed as argument.") def echo_handler(message): print 'echo:', message return message