From 7dfccdecbf326e5f3355672cfa6e0b67697652af Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Fri, 28 Sep 2007 13:59:05 -0300 Subject: [PATCH] Invert PyminDaemon constructor options and add defaults. It's more likely to just want to override the routes and not the addr. --- pymin | 2 +- pymindaemon.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pymin b/pymin index 829b9a5..37feab9 100755 --- a/pymin +++ b/pymin @@ -4,5 +4,5 @@ from pymindaemon import PyminDaemon import config -PyminDaemon(config.bind_addr, config.routes).run() +PyminDaemon(config.routes, config.bind_addr).run() diff --git a/pymindaemon.py b/pymindaemon.py index 98ced48..c3fdda6 100644 --- a/pymindaemon.py +++ b/pymindaemon.py @@ -33,7 +33,7 @@ class PyminDaemon(eventloop.EventLoop): >>> PyminDaemon(('', 9999), dict(test=test_handler)).run() """ - def __init__(self, bind_addr, routes): + def __init__(self, routes=dict(), bind_addr=('', 9999)): r"""Initialize the PyminDaemon object. See PyminDaemon class documentation for more info. @@ -94,5 +94,5 @@ if __name__ == '__main__': print 'echo:', message return message - PyminDaemon(('', 9999), dict(test=test_handler, echo=echo_handler)).run() + PyminDaemon(dict(test=test_handler, echo=echo_handler)).run() -- 2.43.0