Author: gnichols
Date: 2012-01-23 20:46:52 +0000 (Mon, 23 Jan 2012)
New Revision: 1164
Modified:
trunk/v7/documentbase.py
Log:
Bug 782197 - FEAT: v7 should support dbus udisks in place of hal/kudzu/hardware.py for storage test
Modified: trunk/v7/documentbase.py
===================================================================
--- trunk/v7/documentbase.py 2012-01-23 19:34:06 UTC (rev 1163)
+++ trunk/v7/documentbase.py 2012-01-23 20:46:52 UTC (rev 1164)
@@ -150,14 +150,16 @@
self.setAttribute(deviceElement, Attributes.product, device.getProduct())
self.setAttribute(deviceElement, Attributes.device_bus, device.getBus())
self.setAttribute(deviceElement, Attributes.device_class, device.getClass())
+ print "set device-class in document to " + device.getClass()
self.setAttribute(deviceElement, Attributes.source, device.getSource())
for (key, value) in device.properties.iteritems():
- propertyElement = self.document.createElement(Tags.property)
- self.setAttribute(propertyElement, Tags.name, key)
- if value:
+ # only create a property element if the value is there (some string, non-zero integer, or True).
+ if value:
+ propertyElement = self.document.createElement(Tags.property)
+ self.setAttribute(propertyElement, Tags.name, key)
self.setTextNode(propertyElement, "%s" % value)
- deviceElement.appendChild(propertyElement)
+ deviceElement.appendChild(propertyElement)
self.element.appendChild(deviceElement)