Beispiel #1
0
    def render(self, request):
        xml = self.target.messages.getMessageById(self.id)
        if xml:
            request.setHeader('content-type', 'text/xml')
            request.write(unicode(XML.toString(xml)).encode('utf-8'))
            request.finish()
        else:
            request.write(error.NoResource("Message not found").render(request))
            request.finish()
	return ""
Beispiel #2
0
 def xmlrpc_getLatestMessages(self, path, limit=None):
     """Return 'limit' latest messages delivered to this stats target,
        or all available recent messages if 'limit' isn't specified.
        """
     return [(id, XML.toString(doc)) for id, doc in
             StatsTarget(path).messages.getLatest(limit)]
Beispiel #3
0
 def get_source(self):
     return XML.toString(self.xml)
Beispiel #4
0
    def formatItem(self, content):
	# Convert the root node, not the document- we don't want to
	# be outputting another XML declaration inside our larger document.
	return xml(XML.toString(content.childNodes[0]).encode('utf8'))
Beispiel #5
0
 def parseToString(self, message):
     return XML.toString(self.parse(message).documentElement)