From 776aa03e340e3cb753bd56dea363caa44b866640 Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Tue, 9 Dec 2008 21:24:51 +0000 Subject: modified hello-world to optionally take a broker as an argument git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@724898 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/python/hello-world | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'qpid/python/hello-world') diff --git a/qpid/python/hello-world b/qpid/python/hello-world index 5d312e7371..efee84059c 100755 --- a/qpid/python/hello-world +++ b/qpid/python/hello-world @@ -17,12 +17,23 @@ # specific language governing permissions and limitations # under the License. # +import sys from qpid.connection import Connection from qpid.util import connect from qpid.datatypes import uuid4, Message +broker = "127.0.0.1" +port = 5672 + +if len(sys.argv) > 1: broker = sys.argv[1] +if len(sys.argv) > 2: port = int(sys.argv[2]) + +if len(sys.argv) > 3: + print >> sys.stderr, "usage: hello-world [ [ ] ]" + sys.exit(1) + # connect to the server and start a session -conn = Connection(connect("127.0.0.1", 5672)) +conn = Connection(connect(broker, port)) conn.start() ssn = conn.session(str(uuid4())) -- cgit v1.2.1