qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject [2/7] qpid-proton git commit: PROTON-1922: [Python] Change examples to use relative imports
Date Tue, 28 Aug 2018 21:39:02 GMT
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 <astitcher@apache.org>
Authored: Wed Aug 8 13:50:15 2018 -0400
Committer: Andrew Stitcher <astitcher@apache.org>
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


Mime
View raw message