Makes the specified object available over DBus @type dbusObject: an object implementing the L{IDBusObject} interface @param dbusObject: The object to export over DBus
(self, dbusObject)
| 660 | p.connectionLost(reason) |
| 661 | |
| 662 | def exportObject(self, dbusObject): |
| 663 | """ |
| 664 | Makes the specified object available over DBus |
| 665 | |
| 666 | @type dbusObject: an object implementing the L{IDBusObject} interface |
| 667 | @param dbusObject: The object to export over DBus |
| 668 | """ |
| 669 | o = IDBusObject(dbusObject) |
| 670 | self.exports[o.getObjectPath()] = o |
| 671 | o.setObjectHandler(self) |
| 672 | |
| 673 | i = {} |
| 674 | for iface in o.getInterfaces(): |
| 675 | i[iface.name] = o.getAllProperties(iface.name) |
| 676 | |
| 677 | msig = message.SignalMessage( |
| 678 | o.getObjectPath(), |
| 679 | 'InterfacesAdded', |
| 680 | 'org.freedesktop.DBus.ObjectManager', |
| 681 | signature='sa{sa{sv}}', |
| 682 | body=[o.getObjectPath(), i], |
| 683 | ) |
| 684 | |
| 685 | self.conn.sendMessage(msig) |
| 686 | |
| 687 | def unexportObject(self, objectPath): |
| 688 | """ |