From: Leandro Lucarella Date: Fri, 28 Sep 2007 16:59:05 +0000 (-0300) Subject: Invert PyminDaemon constructor options and add defaults. X-Git-Url: https://git.llucax.com/software/pymin.git/commitdiff_plain/7dfccdecbf326e5f3355672cfa6e0b67697652af?ds=sidebyside;hp=-c Invert PyminDaemon constructor options and add defaults. It's more likely to just want to override the routes and not the addr. --- 7dfccdecbf326e5f3355672cfa6e0b67697652af 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()