You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2018/08/28 21:39:04 UTC

[4/7] qpid-proton git commit: PROTON-1922: [Python] make the local imports purely relative

PROTON-1922: [Python] make the local imports purely relative


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/d4bfe13f
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/d4bfe13f
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/d4bfe13f

Branch: refs/heads/master
Commit: d4bfe13fb21c2388ba3f168a579ee4aef3554740
Parents: 46dd05a
Author: Andrew Stitcher <as...@apache.org>
Authored: Fri Aug 3 18:59:50 2018 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Tue Aug 28 16:33:06 2018 -0400

----------------------------------------------------------------------
 python/proton/__init__.py |  5 -----
 python/proton/_url.py     |  1 +
 python/proton/_wrapper.py |  5 ++++-
 python/proton/handlers.py |  8 +++++---
 python/proton/reactor.py  | 35 +++++++++++++++++++----------------
 python/proton/utils.py    | 20 +++++++++++++++-----
 6 files changed, 44 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d4bfe13f/python/proton/__init__.py
----------------------------------------------------------------------
diff --git a/python/proton/__init__.py b/python/proton/__init__.py
index 1e8416c..774b97b 100644
--- a/python/proton/__init__.py
+++ b/python/proton/__init__.py
@@ -129,8 +129,3 @@ handler = NullHandler()
 
 log = logging.getLogger("proton")
 log.addHandler(handler)
-
-
-def generate_uuid():
-    import uuid
-    return uuid.uuid4()

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d4bfe13f/python/proton/_url.py
----------------------------------------------------------------------
diff --git a/python/proton/_url.py b/python/proton/_url.py
index 4fb35eb..67e1456 100644
--- a/python/proton/_url.py
+++ b/python/proton/_url.py
@@ -20,6 +20,7 @@
 from __future__ import absolute_import
 
 import socket
+
 from ._compat import urlparse, urlunparse, quote, unquote
 
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d4bfe13f/python/proton/_wrapper.py
----------------------------------------------------------------------
diff --git a/python/proton/_wrapper.py b/python/proton/_wrapper.py
index 805ecb1..4ee98e8 100644
--- a/python/proton/_wrapper.py
+++ b/python/proton/_wrapper.py
@@ -17,11 +17,15 @@
 # under the License.
 #
 
+from __future__ import absolute_import
+
 from cproton import pn_incref, pn_decref, \
     pn_py2void, pn_void2py, \
     pn_record_get, pn_record_def, pn_record_set, \
     PN_PYREF
 
+from ._exceptions import ProtonException
+
 
 class EmptyAttrs:
 
@@ -49,7 +53,6 @@ class Wrapper(object):
                 self.__dict__["_impl"] = impl
                 self.__dict__["_attrs"] = EMPTY_ATTRS
                 self.__dict__["_record"] = None
-                from proton import ProtonException
                 raise ProtonException(
                     "Wrapper failed to create wrapped object. Check for file descriptor or memory exhaustion.")
             init = True

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d4bfe13f/python/proton/handlers.py
----------------------------------------------------------------------
diff --git a/python/proton/handlers.py b/python/proton/handlers.py
index b30408e..bf9c1db 100644
--- a/python/proton/handlers.py
+++ b/python/proton/handlers.py
@@ -24,9 +24,11 @@ import time
 import weakref
 from select import select
 
-from proton import Delivery, Endpoint
-from proton import Message, Handler, ProtonException
-from ._events import dispatch
+from ._delivery import Delivery
+from ._endpoints import Endpoint
+from ._message import Message
+from ._exceptions import ProtonException
+from ._events import Handler, dispatch
 
 log = logging.getLogger("proton")
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d4bfe13f/python/proton/reactor.py
----------------------------------------------------------------------
diff --git a/python/proton/reactor.py b/python/proton/reactor.py
index ccdbf94..ab9c7db 100644
--- a/python/proton/reactor.py
+++ b/python/proton/reactor.py
@@ -1,4 +1,3 @@
-from __future__ import absolute_import
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -17,25 +16,13 @@ from __future__ import absolute_import
 # specific language governing permissions and limitations
 # under the License.
 #
+
 from __future__ import absolute_import
 
 import os
 import logging
 import traceback
-
-from proton import Connection, Delivery, Described
-from proton import Endpoint, EventType, Handler, Link, Message
-from proton import Session, SSL, SSLDomain, SSLUnavailable, symbol
-from proton import Terminus, Transport, ulong, Url
-from proton.handlers import OutgoingMessageHandler
-
-from proton import generate_uuid
-
-from ._common import isstring, secs2millis, millis2secs, unicode2utf8, utf82unicode
-
-from ._events import EventBase
-from ._reactor_impl import Selectable, WrappedHandler, _chandler
-from ._wrapper import Wrapper, PYCTX
+import uuid
 
 from cproton import PN_MILLIS_MAX, PN_PYREF, PN_ACCEPTED, \
     pn_reactor_stop, pn_selectable_attachments, pn_reactor_quiesced, pn_reactor_acceptor, \
@@ -47,13 +34,29 @@ from cproton import PN_MILLIS_MAX, PN_PYREF, PN_ACCEPTED, \
     pn_reactor_start, pn_reactor_set_connection_host, pn_cast_pn_task, pn_decref, pn_reactor_set_timeout, \
     pn_reactor_mark, pn_reactor_get_handler, pn_reactor_wakeup
 
-from . import _compat
+from ._delivery import  Delivery
+from ._endpoints import Connection, Endpoint, Link, Session, Terminus
+from ._data import Described, symbol, ulong
+from ._message import  Message
+from ._transport import Transport, SSL, SSLDomain, SSLUnavailable
+from ._url import Url
+from ._common import isstring, secs2millis, millis2secs, unicode2utf8, utf82unicode
+from ._events import EventType, EventBase, Handler
+from ._reactor_impl import Selectable, WrappedHandler, _chandler
+from ._wrapper import Wrapper, PYCTX
 
+from .handlers import OutgoingMessageHandler
+
+from . import _compat
 from ._compat import queue
 
 log = logging.getLogger("proton")
 
 
+def generate_uuid():
+    return uuid.uuid4()
+
+
 def _timeout2millis(secs):
     if secs is None: return PN_MILLIS_MAX
     return secs2millis(secs)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d4bfe13f/python/proton/utils.py
----------------------------------------------------------------------
diff --git a/python/proton/utils.py b/python/proton/utils.py
index c6f8cb4..fd8f57a 100644
--- a/python/proton/utils.py
+++ b/python/proton/utils.py
@@ -16,14 +16,24 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-import collections, socket, time, threading
 
-from proton import ConnectionException, Delivery, Endpoint, Handler, Link, LinkException, Message
-from proton import ProtonException, Timeout, Url
-from proton.reactor import Container
-from proton.handlers import MessagingHandler, IncomingMessageHandler
+from __future__ import absolute_import
+
+import collections
+import time
+import threading
+
 from cproton import pn_reactor_collector, pn_collector_release
 
+from ._exceptions import ProtonException, ConnectionException, LinkException, Timeout
+from ._delivery import Delivery
+from ._endpoints import Endpoint, Link
+from ._events import Handler
+from ._url import Url
+
+from .reactor import Container
+from .handlers import MessagingHandler, IncomingMessageHandler
+
 
 class BlockingLink(object):
     def __init__(self, connection, link):


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org