qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject qpid-proton git commit: PROTON-977: make some tests more explicit
Date Thu, 06 Aug 2015 15:56:09 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master bf7ed36ae -> 59943d7f1


PROTON-977: make some tests more explicit


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

Branch: refs/heads/master
Commit: 59943d7f153ed7624eb104f424d6ba839ad416e3
Parents: bf7ed36
Author: Gordon Sim <gsim@redhat.com>
Authored: Thu Aug 6 16:52:18 2015 +0100
Committer: Gordon Sim <gsim@redhat.com>
Committed: Thu Aug 6 16:52:18 2015 +0100

----------------------------------------------------------------------
 proton-c/bindings/python/proton/handlers.py | 46 ++++++++++++------------
 proton-c/bindings/python/proton/reactor.py  |  4 +--
 2 files changed, 25 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/59943d7f/proton-c/bindings/python/proton/handlers.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/handlers.py b/proton-c/bindings/python/proton/handlers.py
index f4ad5a9..301f20c 100644
--- a/proton-c/bindings/python/proton/handlers.py
+++ b/proton-c/bindings/python/proton/handlers.py
@@ -56,21 +56,21 @@ class OutgoingMessageHandler(Handler):
         Called when the sender link has credit and messages can
         therefore be transferred.
         """
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_sendable', event)
 
     def on_accepted(self, event):
         """
         Called when the remote peer accepts an outgoing message.
         """
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_accepted', event)
 
     def on_rejected(self, event):
         """
         Called when the remote peer rejects an outgoing message.
         """
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_rejected', event)
 
     def on_released(self, event):
@@ -79,7 +79,7 @@ class OutgoingMessageHandler(Handler):
         that this may be in response to either the RELEASE or MODIFIED
         state as defined by the AMQP specification.
         """
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_released', event)
 
     def on_settled(self, event):
@@ -88,7 +88,7 @@ class OutgoingMessageHandler(Handler):
         message. This is the point at which it shouod never be
         retransmitted.
         """
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_settled', event)
 
 def recv_msg(delivery):
@@ -182,11 +182,11 @@ class IncomingMessageHandler(Handler, Acking):
         explicitly accepting it, the ``delivery`` should be used, also
         obtainable via a property on the event.
         """
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_message', event)
 
     def on_settled(self, event):
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_settled', event)
 
 class EndpointStateHandler(Handler):
@@ -294,75 +294,75 @@ class EndpointStateHandler(Handler):
             event.link.open()
 
     def on_connection_opened(self, event):
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_connection_opened', event)
 
     def on_session_opened(self, event):
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_session_opened', event)
 
     def on_link_opened(self, event):
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_link_opened', event)
 
     def on_connection_opening(self, event):
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_connection_opening', event)
 
     def on_session_opening(self, event):
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_session_opening', event)
 
     def on_link_opening(self, event):
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_link_opening', event)
 
     def on_connection_error(self, event):
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_connection_error', event)
         else:
             self.log_error(event.connection, "connection")
 
     def on_session_error(self, event):
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_session_error', event)
         else:
             self.log_error(event.session, "session")
             event.connection.close()
 
     def on_link_error(self, event):
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_link_error', event)
         else:
             self.log_error(event.link, "link")
             event.connection.close()
 
     def on_connection_closed(self, event):
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_connection_closed', event)
 
     def on_session_closed(self, event):
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_session_closed', event)
 
     def on_link_closed(self, event):
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_link_closed', event)
 
     def on_connection_closing(self, event):
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_connection_closing', event)
         elif self.peer_close_is_error:
             self.on_connection_error(event)
 
     def on_session_closing(self, event):
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_session_closing', event)
         elif self.peer_close_is_error:
             self.on_session_error(event)
 
     def on_link_closing(self, event):
-        if self.delegate:
+        if self.delegate != None:
             dispatch(self.delegate, 'on_link_closing', event)
         elif self.peer_close_is_error:
             self.on_link_error(event)
@@ -371,7 +371,7 @@ class EndpointStateHandler(Handler):
         self.on_transport_closed(event)
 
     def on_transport_closed(self, event):
-        if self.delegate and event.connection and self.is_local_open(event.connection):
+        if self.delegate != None and event.connection and self.is_local_open(event.connection):
             dispatch(self.delegate, 'on_disconnected', event)
 
 class MessagingHandler(Handler, Acking):

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/59943d7f/proton-c/bindings/python/proton/reactor.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/reactor.py b/proton-c/bindings/python/proton/reactor.py
index a1d8c62..dce1e08 100644
--- a/proton-c/bindings/python/proton/reactor.py
+++ b/proton-c/bindings/python/proton/reactor.py
@@ -700,7 +700,7 @@ class Container(Reactor):
             snd.source.address = source
         if target:
             snd.target.address = target
-        if handler:
+        if handler != None:
             snd.handler = handler
         if tags:
             snd.tag_generator = tags
@@ -743,7 +743,7 @@ class Container(Reactor):
             rcv.source.dynamic = True
         if target:
             rcv.target.address = target
-        if handler:
+        if handler != None:
             rcv.handler = handler
         _apply_link_options(options, rcv)
         rcv.open()


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


Mime
View raw message