From 61eb2a0fb48fa0d98cd6a320f592cec518626c8b Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Mon, 17 Jan 2011 16:32:20 +0100 Subject: [PATCH] Added ExchangeType.type for the name of the exchange type --- kombu/transport/virtual/exchange.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kombu/transport/virtual/exchange.py b/kombu/transport/virtual/exchange.py index ef5533b3..baf133c3 100644 --- a/kombu/transport/virtual/exchange.py +++ b/kombu/transport/virtual/exchange.py @@ -18,6 +18,7 @@ class ExchangeType(object): :param channel: AMQ Channel """ + type = None def __init__(self, channel): self.channel = channel @@ -46,6 +47,7 @@ class ExchangeType(object): class DirectExchange(ExchangeType): """The `direct` exchange routes based on exact routing keys.""" + type = "direct" def lookup(self, table, exchange, routing_key, default): return [queue for rkey, _, queue in table @@ -55,6 +57,7 @@ class DirectExchange(ExchangeType): class TopicExchange(ExchangeType): """The `topic` exchanges routes based on words separated by dots, and wildcard characters `*` (any single word), and `#` (one or more words).""" + type = "topic" #: map of wildcard to regex conversions wildcards = {"*": r".*?[^\.]", @@ -96,6 +99,7 @@ class FanoutExchange(ExchangeType): for an example implementation of these methods. """ + type = "fanout" def lookup(self, table, exchange, routing_key, default): return [queue for _, _, queue in table]