From 9bf7c799973fb7158797f92880cefb3c5939611c Mon Sep 17 00:00:00 2001 From: Yves Date: Sun, 20 Jun 2010 14:53:22 +0200 Subject: ebus_app korrigiert, sql-modell ist noch falsch --- ebus/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ebus') diff --git a/ebus/__init__.py b/ebus/__init__.py index 9ac981d..ad79846 100644 --- a/ebus/__init__.py +++ b/ebus/__init__.py @@ -117,7 +117,10 @@ class EbusXMLMixin(object): p=EbusXMLMixin.ebus_xml.xpath("/ebus/packets/packet[@primary=$primary and @secondary=$secondary]", primary="#x%.2x"%self.primary_command, secondary="#x%.2x"%self.secondary_command) - return len(p)>0 and p[0] or None + if len(p)>0 and p[0] is not None: + return p[0] + else: + return None def _get_source(self): s=EbusXMLMixin.ebus_xml.xpath("/ebus/devices/device[@address=$address]", -- cgit v1.2.1