[node-patches] Change in ovirt-node[master]: base: Show the property name o a signal
fabiand at fedoraproject.org
fabiand at fedoraproject.org
Tue Aug 13 14:23:33 UTC 2013
Fabian Deutsch has uploaded a new change for review.
Change subject: base: Show the property name o a signal
......................................................................
base: Show the property name o a signal
This helps debugging, ebcause you see to what member of an object the
signal is assigned.
Change-Id: I6df74c54990571a1b841c8fdfcb0209804d7cec0
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirt/node/base.py
1 file changed, 5 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/27/18027/1
diff --git a/src/ovirt/node/base.py b/src/ovirt/node/base.py
index 7c6046d..c728213 100644
--- a/src/ovirt/node/base.py
+++ b/src/ovirt/node/base.py
@@ -50,7 +50,7 @@
def list_signals(self):
return [(k, v) for k, v in self.__dict__.items()
- if isinstance(v, Base.Signal)]
+ if Base.Signal in v.__class__.mro()]
def build_str(self, attributes=[], additional_pairs={}, name=None):
assert type(attributes) is list
@@ -93,11 +93,12 @@
self.callbacks = []
def target_property(self):
- return dict(self.target.list_signals())[self][0]
+ return dict((v, k) for k, v in self.target.list_signals())[self]
def __call__(self, userdata=None):
self.emit(userdata)
def __str__(self):
- return "<%s target='%s' at %s>" % \
- (self.__class__.__name__, self.target, hex(id(self)))
+ return "<%s %s target='%s' at %s>" % \
+ (self.__class__.__name__, self.target_property(),
+ self.target, hex(id(self)))
--
To view, visit http://gerrit.ovirt.org/18027
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6df74c54990571a1b841c8fdfcb0209804d7cec0
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>
More information about the node-patches
mailing list