Beispiel #1
0
    def to_xml(self, pretty_print=False):
        """Serialize to XML string.

        :param pretty_print (optional): `bool` human-readable XML.
        :returns: `str` XML.
        """
        message = Node("MaltegoMessage")
        message.append(self.to_node())
        return etree.tostring(message, pretty_print=pretty_print)
Beispiel #2
0
    def to_xml(self, pretty_print=False):
        """Serialize to XML string.

        :param pretty_print (optional): `bool` human-readable XML.
        :returns: `str` XML.
        """
        message = Node('MaltegoMessage')
        message.append(self.to_node())
        return etree.tostring(message, pretty_print=pretty_print)
Beispiel #3
0
    def to_node(self):
        """Serialize to `etree.Element` instance.

        :returns: `etree.Element` instance.
        """
        node = super(TransformResponse, self).to_node()

        entities_node = Node("Entities", parent=node)
        for entity in self.entities:
            entities_node.append(entity.to_node())

        return node
Beispiel #4
0
    def to_node(self):
        """Serialize to `etree.Element` instance.

        :returns: `etree.Element` instance.
        """
        node = super(TransformResponse, self).to_node()

        entities_node = Node('Entities', parent=node)
        for entity in self.entities:
            entities_node.append(entity.to_node())

        return node
Beispiel #5
0
    def to_node(self):
        """Serialize to `etree.Element` instance.

        :returns: `etree.Element` instance.
        """
        node = Node("Maltego{}Message".format(self.__class__.__name__))

        if self.ui_messages:
            ui_messages = Node("UIMessages", parent=node)
            for message in self.ui_messages:
                ui_messages.append(message.to_node())

        return node
Beispiel #6
0
    def to_node(self):
        """Serialize to `etree.Element` instance.

        :returns: `etree.Element` instance.
        """
        node = Node(
            'Maltego{}Message'.format(self.__class__.__name__)
        )

        if self.ui_messages:
            ui_messages = Node('UIMessages', parent=node)
            for message in self.ui_messages:
                ui_messages.append(message.to_node())

        return node