/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos

  • Committer: Teddy Hogeborn
  • Date: 2009-09-29 02:54:35 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090929025435-jocwelhkxkfj8zj6
* mandos (DBusObjectWithProperties.Introspect): Add the name
                                                attributes for the
                                                return values for the
                                                standard D-Bus
                                                Properties methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
626
626
        """Standard D-Bus method, overloaded to insert property tags.
627
627
        """
628
628
        xmlstring = dbus.service.Object.Introspect(self, object_path,
629
 
                                           connection)
 
629
                                                   connection)
630
630
        document = xml.dom.minidom.parseString(xmlstring)
631
631
        del xmlstring
632
632
        def make_tag(document, name, prop):
642
642
                        if prop._dbus_interface
643
643
                        == if_tag.getAttribute(u"name")):
644
644
                if_tag.appendChild(tag)
 
645
            # Add the names to the return values for the
 
646
            # "org.freedesktop.DBus.Properties" methods
 
647
            if (if_tag.getAttribute(u"name")
 
648
                == u"org.freedesktop.DBus.Properties"):
 
649
                for cn in if_tag.getElementsByTagName(u"method"):
 
650
                    if cn.getAttribute(u"name") == u"Get":
 
651
                        for arg in cn.getElementsByTagName(u"arg"):
 
652
                            if (arg.getAttribute(u"direction")
 
653
                                == u"out"):
 
654
                                arg.setAttribute(u"name", u"value")
 
655
                    elif cn.getAttribute(u"name") == u"GetAll":
 
656
                        for arg in cn.getElementsByTagName(u"arg"):
 
657
                            if (arg.getAttribute(u"direction")
 
658
                                == u"out"):
 
659
                                arg.setAttribute(u"name", u"props")
645
660
        xmlstring = document.toxml(u"utf-8")
646
661
        document.unlink()
647
662
        return xmlstring