utils.py
branchstable
changeset 3094 978ed8c2c0e4
parent 3091 c3d73cecb29e
child 3101 e75ab3635f07
equal deleted inserted replaced
3093:12a69f7f963b 3094:978ed8c2c0e4
   306         # xmldecl and html opening tag
   306         # xmldecl and html opening tag
   307         self.xmldecl = u'<?xml version="1.0" encoding="%s"?>\n' % req.encoding
   307         self.xmldecl = u'<?xml version="1.0" encoding="%s"?>\n' % req.encoding
   308         self.htmltag = u'<html xmlns="http://www.w3.org/1999/xhtml" ' \
   308         self.htmltag = u'<html xmlns="http://www.w3.org/1999/xhtml" ' \
   309                        'xmlns:cubicweb="http://www.logilab.org/2008/cubicweb" ' \
   309                        'xmlns:cubicweb="http://www.logilab.org/2008/cubicweb" ' \
   310                        'xml:lang="%s" lang="%s">' % (req.lang, req.lang)
   310                        'xml:lang="%s" lang="%s">' % (req.lang, req.lang)
   311 
   311         # keep main_stream's reference on req for easier text/html demoting
       
   312         req.main_stream = self
   312 
   313 
   313     def write(self, data):
   314     def write(self, data):
   314         """StringIO interface: this method will be assigned to self.w
   315         """StringIO interface: this method will be assigned to self.w
   315         """
   316         """
   316         self.body.write(data)
   317         self.body.write(data)