qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [1/7] qpid-proton git commit: NO-JIRA: Add lazy handlers property to python Handler
Date Mon, 28 Sep 2015 12:11:10 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master c56bcff5f -> 5598d501f


NO-JIRA: Add lazy handlers property to python Handler


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

Branch: refs/heads/master
Commit: 3bae2f0cb637726d48518386022fa80c505cf41b
Parents: 69fa53b
Author: Bozo Dragojevic <bozzo@digiverse.si>
Authored: Mon Sep 28 10:53:15 2015 +0200
Committer: Bozo Dragojevic <bozzo@digiverse.si>
Committed: Mon Sep 28 12:42:33 2015 +0200

----------------------------------------------------------------------
 proton-c/bindings/python/proton/__init__.py | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/3bae2f0c/proton-c/bindings/python/proton/__init__.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/__init__.py b/proton-c/bindings/python/proton/__init__.py
index dcc2be7..a315f62 100644
--- a/proton-c/bindings/python/proton/__init__.py
+++ b/proton-c/bindings/python/proton/__init__.py
@@ -3850,7 +3850,16 @@ class Event(Wrapper, EventBase):
   def __repr__(self):
     return "%s(%s)" % (self.type, self.context)
 
+class LazyHandlers(object):
+  def __get__(self, obj, clazz):
+    if obj is None:
+      return self
+    ret = []
+    obj.__dict__['handlers'] = ret
+    return ret
+
 class Handler(object):
+  handlers = LazyHandlers()
 
   def on_unhandled(self, method, *args):
     pass


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


Mime
View raw message