Minor cleanups from port to oslo.messaging.

This commit is contained in:
Kenneth Giusti 2014-04-23 12:10:51 -04:00
parent f9ed4940e7
commit 6affbe6864
4 changed files with 10 additions and 14 deletions

@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.
#
from dingus.container import Container, ContainerEventHandler
from dingus.container import Container
from dingus.connection import Connection, ConnectionEventHandler
from dingus.link import ReceiverLink, ReceiverEventHandler
from dingus.link import SenderLink, SenderEventHandler

@ -24,10 +24,10 @@ import heapq
import logging
import proton
import time
from warnings import warn
import warnings
from dingus.link import _SessionProxy
from dingus.endpoint import Endpoint
from dingus.link import _SessionProxy
LOG = logging.getLogger(__name__)
@ -212,7 +212,8 @@ class Connection(Endpoint):
@property
def sasl(self):
warn(DeprecationWarning("sasl deprecated, use pn_sasl instead"))
text = "sasl deprecated, use pn_sasl instead"
warnings.warn(DeprecationWarning(text))
return self.pn_sasl
def pn_ssl(self):
@ -254,7 +255,7 @@ class Connection(Endpoint):
def destroy(self):
self._sender_links.clear()
self._receiver_links.clear()
self._container._remove_connection(self._name)
self._container.remove_connection(self._name)
self._container = None
self._pn_collector = None
self._pn_connection = None
@ -377,7 +378,8 @@ class Connection(Endpoint):
@property
def next_tick(self):
warn(DeprecationWarning("next_tick deprecated, use deadline instead"))
text = "next_tick deprecated, use deadline instead"
warnings.warn(DeprecationWarning(text))
return self.deadline
@property

@ -15,7 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
__all__ = [
"ContainerEventHandler",
"Container"
]
@ -27,11 +26,6 @@ from dingus.connection import Connection
LOG = logging.getLogger(__name__)
class ContainerEventHandler(object):
# TODO(kgiusti) - ContainerEventHandler
pass
class Container(object):
"""An implementation of an AMQP 1.0 container."""
def __init__(self, name, properties=None):
@ -91,6 +85,6 @@ class Container(object):
def get_connection(self, name):
return self._connections.get(name, None)
def _remove_connection(self, name):
def remove_connection(self, name):
if name in self._connections:
del self._connections[name]

@ -585,7 +585,7 @@ class _SessionProxy(Endpoint):
return rl
def link_destroyed(self, link):
"""Link has been destroyed"""
"""Link has been destroyed."""
self._links.discard(link)
if not self._links:
# no more links