From commits-return-46667-archive-asf-public=cust-asf.ponee.io@qpid.apache.org Tue Aug 28 23:39:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9A0BF18072F for ; Tue, 28 Aug 2018 23:39:03 +0200 (CEST) Received: (qmail 55784 invoked by uid 500); 28 Aug 2018 21:39:02 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 55693 invoked by uid 99); 28 Aug 2018 21:39:02 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Aug 2018 21:39:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B0664E0016; Tue, 28 Aug 2018 21:39:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: astitcher@apache.org To: commits@qpid.apache.org Date: Tue, 28 Aug 2018 21:39:02 -0000 Message-Id: <9d1bce6e2011495cbcefc8a892b125e9@git.apache.org> In-Reply-To: <4fdc4cc32e754322a81ff297f2f0e559@git.apache.org> References: <4fdc4cc32e754322a81ff297f2f0e559@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/7] qpid-proton git commit: PROTON-1922: [Python] Change examples to use relative imports PROTON-1922: [Python] Change examples to use relative imports Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/7d545693 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/7d545693 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/7d545693 Branch: refs/heads/master Commit: 7d54569303ba0471e1a8f34496e5cd9e79ae3e90 Parents: 0642f2b Author: Andrew Stitcher Authored: Wed Aug 8 13:50:15 2018 -0400 Committer: Andrew Stitcher Committed: Tue Aug 28 16:33:06 2018 -0400 ---------------------------------------------------------------------- python/examples/abstract_server.py | 4 +++- python/examples/broker.py | 6 +++--- python/examples/server_direct.py | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7d545693/python/examples/abstract_server.py ---------------------------------------------------------------------- diff --git a/python/examples/abstract_server.py b/python/examples/abstract_server.py index fed7fb2..138ef66 100755 --- a/python/examples/abstract_server.py +++ b/python/examples/abstract_server.py @@ -18,8 +18,10 @@ # under the License. # +from __future__ import absolute_import from __future__ import print_function -from proton_server import Server + +from .proton_server import Server class Application(Server): def __init__(self, host, address): http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7d545693/python/examples/broker.py ---------------------------------------------------------------------- diff --git a/python/examples/broker.py b/python/examples/broker.py index 8769268..bbbd4f9 100755 --- a/python/examples/broker.py +++ b/python/examples/broker.py @@ -18,8 +18,8 @@ # under the License. # -import collections, optparse -from proton import Endpoint, generate_uuid +import collections, optparse, uuid +from proton import Endpoint from proton.handlers import MessagingHandler from proton.reactor import Container @@ -76,7 +76,7 @@ class Broker(MessagingHandler): def on_link_opening(self, event): if event.link.is_sender: if event.link.remote_source.dynamic: - address = str(generate_uuid()) + address = str(uuid.uuid4()) event.link.source.address = address q = Queue(True) self.queues[address] = q http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7d545693/python/examples/server_direct.py ---------------------------------------------------------------------- diff --git a/python/examples/server_direct.py b/python/examples/server_direct.py index a9910f1..71f73e9 100755 --- a/python/examples/server_direct.py +++ b/python/examples/server_direct.py @@ -19,7 +19,9 @@ # from __future__ import print_function -from proton import generate_uuid, Message + +import uuid +from proton import Message from proton.handlers import MessagingHandler from proton.reactor import Container @@ -37,7 +39,7 @@ class Server(MessagingHandler): def on_link_opening(self, event): if event.link.is_sender: if event.link.remote_source and event.link.remote_source.dynamic: - event.link.source.address = str(generate_uuid()) + event.link.source.address = str(uuid.uuid4()) self.senders[event.link.source.address] = event.link elif event.link.remote_target and event.link.remote_target.address: event.link.target.address = event.link.remote_target.address --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org