From e6ce3ff64cfb30c7c210032db5c32595f6989839 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 30 Oct 2016 16:30:44 +0000 Subject: [PATCH 1/2] bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 321f89c..6d1b504 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup( name='wampy', - version='0.4.2', + version='0.5.0', description='WAMP RPC and Pub/Sub for python apps and microservices', long_description=long_description, url='https://github.com/noisyboiler/wampy', From d0baf30b58a8ff2183e2be391f428ee8cc3a7625 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 30 Oct 2016 16:38:58 +0000 Subject: [PATCH 2/2] router url from command line args --- wampy/cli/run.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/wampy/cli/run.py b/wampy/cli/run.py index 420c595..e7bfa5d 100644 --- a/wampy/cli/run.py +++ b/wampy/cli/run.py @@ -5,6 +5,7 @@ """ import os import sys +from urlparse import urlparse import eventlet @@ -55,14 +56,11 @@ def wait(self): app.stop() -def run(app): +def run(app, host, port): module_name, app_name = app[0].split(':') mod = import_module(module_name) app_class = getattr(mod, app_name) - # add to app args here - host = "localhost" - port = 8080 app = app_class( name=app_class.__class__.__name__, host=host, @@ -95,7 +93,12 @@ def main(args): sys.path.insert(0, '.') app = args.application - run(app) + router_url = args.router + parsed_connection_details = urlparse(router_url) + host = parsed_connection_details.hostname + port = parsed_connection_details.port + + run(app, host, port) def init_parser(parser): @@ -105,7 +108,7 @@ def init_parser(parser): help='python path to one wampy application class to run') parser.add_argument( - '--router', default='ws://localhost:8091', + '--router', default='http://localhost:8080', help='WAMP router url') return parser